Utilities operating on Vector3 objects. All methods are static and do not modify the input objects.

Constructors

Methods

  • magnitude

    The magnitude of a vector

    Parameters

    Returns number

  • rotateX

    Rotates the vector around the x axis counterclockwise (left hand rule)

    Parameters

    • v: Vector3
    • a: number

      Angle in radians

    Returns Vector3

  • rotateY

    Rotates the vector around the y axis counterclockwise (left hand rule)

    Parameters

    • v: Vector3
    • a: number

      Angle in radians

    Returns Vector3

  • rotateZ

    Rotates the vector around the z axis counterclockwise (left hand rule)

    Parameters

    • v: Vector3
    • a: number

      Angle in radians

    Returns Vector3

  • scale

    Multiple all entries in a vector by a single scalar value producing a new vector

    Parameters

    Returns Vector3

  • toString

    Create a string representation of a vector3

    Parameters

    • v: Vector3
    • Optionaloptions: { decimals?: number; delimiter?: string }

    Returns string