Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Vector2

Hierarchy

  • Vector2

Index

Constructors

constructor

  • new Vector2(x?: undefined | number, y?: undefined | number): Vector2

Properties

x

x: number

y

y: number

Static dummy

dummy: Vector2 = new Vector2()

Static one

one: Vector2 = new Vector2(1.0, 1.0)

Static pool

pool: ObjectPool<Vector2> = new ObjectPool(Vector2, 128)

Static right

right: Vector2 = new Vector2(1, 0)

Static up

up: Vector2 = new Vector2(0, 1)

Static zero

zero: Vector2 = new Vector2()

Accessors

length

  • get length(): number

lengthSq

  • get lengthSq(): number

Methods

add

addVectors

asArray

  • asArray(): number[]

copy

dot

equals

multiply

  • multiply(scalar: number): this

normalize

  • normalize(): this

rotate

  • rotate(radians: number): this

set

  • set(x: number, y: number): this

substract

substractVectors

Static distance

Static distanceSq

Static fromArray

  • fromArray(arr: number[]): void

Static fromPool