Clones the instance.
Returns the dot product of the quaternion and v
.
Compares the quaternion to v
, and returns true
if they are approximately equal.
Updates the quaternion's value to the identity rotation. This is the state of having no rotation.
Inverts the quaternion's value.
Multiplies the quaternion's value by v
.
Normalizes the quaternion's value.
Sets the quaternion's component values to those specified in x
, y
, z
, and w
.
Updates the quaternion to a value that represents a rotation of degree
degrees around the axis
.
new Quaternion().setFromAxisAngle(new Vector3(0, 1, 0), 90);
Updates the quaternion to a value that represents a rotation in Euler angles. Axes are applied in the order of ZXY.
new Quaternion().setFromEulerAngles(new Vector3(90, 0, 0));
Calculates the spherical linear interpolation (slerp) between the current value and v
, using a
as the interpolation factor, then updates the quaternion's value to the result.
let min = new Quaternion().identity();
let max = new Quaternion().setFromEulerAngles(0, 45, 0);
min.clone().slerp(max, 0.5);
The interpolation factor, specified as a number between [0, 1].
Generated using TypeDoc
A quaternion.
Methods that manipulate values are generally destructive. To preserve the original values, explicitly call
clone()
to create a duplicate instance.