Creates a new Quaternion.
The x component. Defaults to 0.
The y component. Defaults to 0.
The z component. Defaults to 0.
The w component. Defaults to 1.
The w component.
The x component.
The y component.
The z component.
Copies the values from another quaternion.
The other quaternion.
this
Resets the quaternion to the identity rotation.
this
Calculates the Euclidean length of the quaternion.
The length.
Multiplies this quaternion by another (this = this * q).
The other quaternion.
this
Normalizes the quaternion to a unit length of 1.
this
Pre-multiplies this quaternion by another (this = q * this).
The other quaternion.
this
Sets the components of the quaternion.
The x component.
The y component.
The z component.
The w component.
this
Sets the quaternion from axis and angle.
The rotation axis (must be normalized).
The rotation angle in radians.
this
Sets the quaternion from a rotation matrix.
The rotation matrix.
this
Spherically interpolates this quaternion toward another by a factor t, taking the shortest
arc (flips q if the two quaternions are more than 90 degrees apart). Falls back to linear
interpolation + normalize when the two rotations are nearly identical, where slerp's formula
becomes numerically unstable (division by a near-zero sinHalfTheta).
The target quaternion.
The interpolation factor, typically in [0, 1] (0 = stays at this, 1 = becomes q).
this
A class representing a quaternion for rotations.