A 3-dimensional vector.

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

Hierarchy

  • Vector3

Constructors

  • Returns Vector3

  • Parameters

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

    Returns Vector3

Properties

x: number
y: number
z: number

Methods

  • Adds the scalar value s to the vector's x, y, and z components.

    Parameters

    • s: number

    Returns Vector3

  • Divides the vector by the scalar value s.

    Parameters

    • s: number

    Returns Vector3

  • Returns the dot product of the vector and v.

    Parameters

    Returns number

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

    Parameters

    Returns boolean

  • Returns the vector's length.

    Returns number

  • Returns the vector's squared length.

    Returns number

  • 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: Vector3
    • a: number

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

    Returns Vector3

  • Multiplies the vector by the scalar value s.

    Parameters

    • s: number

    Returns Vector3

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

    Parameters

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

    Returns Vector3

  • Subtracts the scalar value s from the vector's x, y, and z components.

    Parameters

    • s: number

    Returns Vector3

Generated using TypeDoc