A 4-dimensional vector.

Methods that manipulate values are generally destructive. To preserve the original values, explicitly call clone() to create a duplicate instance.

Hierarchy

  • Vector4

Constructors

Properties

w x y z

Methods

Constructors

  • Returns Vector4

  • Parameters

    • x: number
    • y: number
    • z: number
    • w: number

    Returns Vector4

Properties

w: number
x: number
y: number
z: number

Methods

  • Compares the vector to v, and returns true if they are approximately equal.

    Parameters

    Returns boolean

  • Calculates the linear interpolation (lerp) between the current value and v, using a as the interpolation factor, then updates the vector's value to the result.

    Parameters

    • v: Vector4
    • a: number

      The interpolation factor, specified as a number between [0, 1].

    Returns Vector4

  • Sets the vector's component values to those specified in x, y, z and w.

    Parameters

    • x: number
    • y: number
    • z: number
    • w: number

    Returns Vector4

Generated using TypeDoc