Quaternion
Represents a quaternion for 3D rotations.
Fields
The X component of the quaternion.
The Y component of the quaternion.
The Z component of the quaternion.
The W component of the quaternion.
Functions
Returns a normalized version of the quaternion.
Returns: >The normalized quaternion.
Transforms a vector by the quaternion rotation.
- v
- The vector to transform.
Returns: The transformed vector.
Spherically interpolates between two quaternions.
- a
- The starting quaternion.
- b
- The ending quaternion.
- t
- The interpolation factor (0 to 1).
Returns: The interpolated quaternion.
Spherically interpolates between this quaternion and another quaternion.
- b
- The ending quaternion.
- t
- The interpolation factor (0 to 1).
Returns: The interpolated quaternion.
Converts the quaternion to Euler angles in degrees (in Yxz order).
Returns: The Euler angles in degrees.
Creates a quaternion from Euler angles in degrees. (in Yxz order).
- euler
- The Euler angles in degrees.
Returns: The resulting quaternion.
Creates a quaternion from an axis and angle (in radians).
- axis
- The rotation axis (should be normalized).
- angle
- The rotation angle in radians.
Returns: The resulting quaternion.
Rotates this quaternion by an additional rotation around the specified axis.
- axis
- The rotation axis (should be normalized).
- angle
- The rotation angle in radians.
Returns: The rotated quaternion.
Returns the inverse of the quaternion, which represents the opposite rotation.
Returns: The inverse quaternion.