Class Vector3

A 3D vector.

Hierarchy

  • Vector3

Implements

Constructors

  • Constructs a new vector from the given x, y, and z values.

    Parameters

    • x: number

      The x coordinate.

    • y: number

      The y coordinate.

    • z: number

      The z coordinate.

    Returns Vector3

Properties

x: number

X coordinate.

y: number

Y coordinate.

z: number

Z coordinate.

one: Vector3 = ...

A vector with all components set to 1.

zero: Vector3 = ...

A vector with all components set to 0.

Methods

  • Divides a vector by another, or by a scalar.

    Returns

    The quotient of the two values.

    Parameters

    • other: number | Vector3

      The other vector to divide by, or a scalar.

    Returns Vector3

  • Calculates the dot product of two vectors.

    Returns

    The dot product of the two vectors.

    Parameters

    • other: Vector3

      The other vector to calculate the dot product with.

    Returns number

  • Calculates the magnitude of the vector.

    Returns

    The magnitude of the vector.

    Returns number

  • Multiplies a vector by another, or by a scalar.

    Returns

    The product of the two values.

    Parameters

    • other: number | Vector3

      The other vector to multiply by, or a scalar.

    Returns Vector3

Generated using TypeDoc