Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Vector

Hierarchy

  • Vector

Index

Constructors

constructor

  • new Vector(x?: number, y?: number, z?: number, w?: number): Vector
  • Parameters

    • Default value x: number = 0
    • Default value y: number = 0
    • Default value z: number = 0
    • Default value w: number = 0

    Returns Vector

Properties

w

w: number

x

x: number

y

y: number

z

z: number

Accessors

Static BACK

BACK:

Static DOWN

DOWN:

Static FORWARD

FORWARD:

Static LEFT

LEFT:

Static ONE

ONE:

Static RIGHT

RIGHT:

Static UP

UP:

Static ZERO

ZERO:

Methods

add

clone

cross

damp

degreeToRadians

distance

divide

dot

ease

equals

  • equals(vector: Vector): boolean

floor

  • floor(): this

int

  • int(): this

length

  • length(): number

lengthSquared

  • lengthSquared(): number

lerp

magnitude

  • magnitude(): number

multiply

negate

normalize

scale

  • scale(scalar: number): Vector

set

  • set(x: number, y: number, z?: number): Vector

subtract

toArray

  • toArray(): Array<number>

transformWithMatrixIV

transformWithMatrixIVTo2d

Static add

Static angle2d

Static clamp

Static clone

Static create

  • create(x: number, y: number, z?: number): Vector

Static degreeToRadians

Static ease

Static equals

Static fromAngle

  • fromAngle(angle: number, length?: number): Vector

Static fromArray

  • fromArray(values: Array<number>): Vector

Static fromRotationMatrixIV

Static getEularRotationTo

Static getXyzRotationTo

  • getXyzRotationTo(originVector: Vector, targetVector: Vector): number[]
  • Parameters

    Returns number[]

    Array An array with three numbers, angleX, angleY and angleZ in radians.

Static max

Static min

Static negate

Static subtract

Static toArray

  • toArray(v: Vector): Array<number>