A quaternion, used to represent rotation.

Constructors

  • Creates a new quat.

    Parameters

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

    Returns quat

Properties

w: number

w component of the quat.

x: number

x component of the quat.

y: number

y component of the quat.

z: number

z component of the quat.

Methods

  • Returns the dot product of the two quats.

    Parameters

    Returns number

  • Returns whether this quat and b are equal.

    Parameters

    Returns boolean

  • Returns the rotation angle of the quat.

    Returns number

  • Returns the rotation axis of the quat.

    Returns vec3

  • Returns an inverted version of the quat.

    Returns quat

  • Returns the product of this quat and b.

    Parameters

    Returns quat

  • Returns the result of rotating direction vector vec3 by this quat.

    Parameters

    Returns vec3

  • Normalizes the quat.

    Returns void

  • Returns an euler angle representation of the quat, in radians.

    Returns vec3

  • Returns a string representation of the quat.

    Returns string