Preparing search index...

    Quaternion type for representing rotations in 3D space.

    Index

    Constructors

    • Constructs a quaternion with the given w, x, y, z components.

      Parameters

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

      Returns quat

    Properties

    w: number

    The w (scalar) component of the quaternion.

    x: number

    The x component of the quaternion.

    y: number

    The y component of the quaternion.

    z: number

    The z component of the quaternion.

    Methods

    • Creates a quaternion from an angle in radians and a rotation axis.

      Parameters

      • angle: number
      • axis: vec3

      Returns quat

    • Returns the angle in radians between two quaternions.

      Parameters

      Returns number

    • Computes the dot product with another quaternion.

      Parameters

      Returns number

    • Returns true if this quaternion equals another quaternion.

      Parameters

      Returns boolean

    • Creates a quaternion from Euler angles given as separate x, y, z values.

      Parameters

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

      Returns quat

    • Creates a quaternion from a vec3 of Euler angles.

      Parameters

      Returns quat

    • Creates a quaternion from a 3x3 rotation matrix.

      Parameters

      Returns quat

    • Creates a quaternion from a 4x4 rotation matrix.

      Parameters

      Returns quat

    • Returns the rotation angle in radians represented by this quaternion.

      Returns number

    • Returns the rotation axis as a vec3.

      Returns vec3

    • Returns the inverse of this quaternion.

      Returns quat

    • Linearly interpolates between two quaternions by factor t.

      Parameters

      Returns quat

    • Creates a quaternion representing a rotation that looks from one point toward another.

      Parameters

      Returns quat

    • Multiplies this quaternion by another, combining rotations.

      Parameters

      Returns quat

    • Rotates a vec3 by this quaternion.

      Parameters

      Returns vec3

    • Returns a normalized copy of this quaternion.

      Returns void

    • Returns the identity quaternion representing no rotation.

      Returns quat

    • Creates a quaternion representing the rotation from one vector to another.

      Parameters

      Returns quat

    • Spherically interpolates between two quaternions by factor t.

      Parameters

      Returns quat

    • Converts this quaternion to Euler angles in radians.

      Returns vec3

    • Returns a string representation of this quaternion.

      Returns string