A quaternion.

Hierarchy (View Summary)

Constructors

Properties

k: number[] = ...

The components of the vector.

Accessors

  • get w(): number
  • Get the W component of the vector.

    Returns number

    The W component of the vector.

  • set w(value: number): void
  • Set the W component of the vector.

    Parameters

    • value: number

    Returns void

  • get x(): number
  • Get the X component of the vector.

    Returns number

    The X component of the vector.

  • set x(value: number): void
  • Set the X component of the vector.

    Parameters

    • value: number

    Returns void

  • get y(): number
  • Get the Y component of the vector.

    Returns number

    The Y component of the vector.

  • set y(value: number): void
  • Set the Y component of the vector.

    Parameters

    • value: number

    Returns void

  • get z(): number
  • Get the Z component of the vector.

    Returns number

    The Z component of the vector.

  • set z(value: number): void
  • Set the Z component of the vector.

    Parameters

    • value: number

    Returns void

Methods

  • Adds the XYZ components of another vector to this vector.

    Parameters

    • x: number

      The value to add to the X component.

    • y: number

      The value to add to the Y component.

    • z: number

      The value to add to the Z component.

    Returns this

    This instance.

  • Scales another vector and adds its XYZ components to this vector.

    Parameters

    • x: number

      The value to add to the X component.

    • y: number

      The value to add to the Y component.

    • z: number

      The value to add to the Z component.

    • scale: number

      The scaling to apply to the input vector.

    Returns this

    This instance.

  • Clamps the components of the vector at the given boundary.

    Parameters

    • floor: number

      The lowest value to allow.

    • ceil: number

      The largest value to allow.

    Returns this

    This instance.

  • Divides the XYZ components of the vector by the given scale.

    Parameters

    • scale: number

      The scaling to apply to the vector.

    Returns this

    This instance.

  • Divides the XYZ components of this vector by another vector.

    Parameters

    • x: number

      The value to divide the X component with.

    • y: number

      The value to divide the Y component with.

    • z: number

      The value to divide the Z component with.

    Returns this

    This instance.

  • Multiplies the XYZ components of the vector by the given scale.

    Parameters

    • scale: number

      The scaling to apply to the vector.

    Returns this

    This instance.

  • Multiplies the XYZ components of this vector by another vector.

    Parameters

    • x: number

      The value to multiply with the X component.

    • y: number

      The value to multiply with the Y component.

    • z: number

      The value to multiply with the Z component.

    Returns this

    This instance.

  • Sets all components of the quaternion to the given value.

    Parameters

    • value: number

      The value to assign to the components of the quaternion.

    Returns this

    This instance.

  • Sets the components of the quaternion to the given values.

    Parameters

    • x: number

      The X component for the quaternion.

    • y: number

      The Y component for the quaternion.

    • z: number = 0

      The Z component for the quaternion.

    • w: number = 1

      The W component for the quaternion.

    Returns this

    This instance.

  • Subtracts the XYZ components of another vector from this vector.

    Parameters

    • x: number

      The value to subtract from the X component.

    • y: number

      The value to subtract from the Y component.

    • z: number

      The value to subtract from the Z component.

    Returns this

    This instance.