Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Vector

Hierarchy

  • Vector
    • Vector

Index

Methods

add

  • NOTE: The second argument is deprecated.

    add(v:T):T;

    Parameters

    • v: Vector

    Returns Vector

addScalar

  • addScalar(scalar: number): Vector
  • Adds the scalar value s to this vector's values.

    Parameters

    • scalar: number

    Returns Vector

addScaledVector

  • addScaledVector(vector: Vector, scale: number): Vector
  • Parameters

    • vector: Vector
    • scale: number

    Returns Vector

addVectors

  • addVectors(a: Vector, b: Vector): Vector
  • addVectors(a:T, b:T):T;

    Parameters

    • a: Vector
    • b: Vector

    Returns Vector

clone

  • clone(): Vector
  • clone():T;

    Returns Vector

copy

  • copy(v:T):T;

    Parameters

    • v: Vector

    Returns Vector

Optional distanceTo

  • distanceTo(v: Vector): number
  • NOTE: Vector4 doesn't have the property.

    distanceTo(v:T):number;

    Parameters

    • v: Vector

    Returns number

Optional distanceToSquared

  • distanceToSquared(v: Vector): number
  • NOTE: Vector4 doesn't have the property.

    distanceToSquared(v:T):number;

    Parameters

    • v: Vector

    Returns number

divideScalar

  • divideScalar(s: number): Vector
  • divideScalar(s:number):T;

    Parameters

    • s: number

    Returns Vector

dot

  • dot(v: Vector): number
  • dot(v:T):T;

    Parameters

    • v: Vector

    Returns number

equals

  • equals(v: Vector): boolean
  • equals(v:T):boolean;

    Parameters

    • v: Vector

    Returns boolean

getComponent

  • getComponent(index: number): number
  • Parameters

    • index: number

    Returns number

length

  • length(): number
  • length():number;

    Returns number

lengthSq

  • lengthSq(): number
  • lengthSq():number;

    Returns number

lerp

  • lerp(v: Vector, alpha: number): Vector
  • lerp(v:T, alpha:number):T;

    Parameters

    • v: Vector
    • alpha: number

    Returns Vector

multiplyScalar

  • multiplyScalar(s: number): Vector
  • multiplyScalar(s:number):T;

    Parameters

    • s: number

    Returns Vector

negate

  • negate():T;

    Returns Vector

normalize

  • normalize():T;

    Returns Vector

set

  • set(...args: number[]): Vector
  • Parameters

    • Rest ...args: number[]

    Returns Vector

setComponent

  • setComponent(index: number, value: number): Vector
  • Parameters

    • index: number
    • value: number

    Returns Vector

setLength

  • setLength(l: number): Vector
  • setLength(l:number):T;

    Parameters

    • l: number

    Returns Vector

setScalar

  • setScalar(scalar: number): Vector
  • Parameters

    • scalar: number

    Returns Vector

sub

  • sub(v:T):T;

    Parameters

    • v: Vector

    Returns Vector

subVectors

  • subVectors(a: Vector, b: Vector): Vector
  • subVectors(a:T, b:T):T;

    Parameters

    • a: Vector
    • b: Vector

    Returns Vector