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));
Updates the quaternion to a value that represents a rotation in Euler angles. Axes are applied in the order of ZXY.
new Quaternion().setFromEulerAngles(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].
Static axisGets the quaternion that represents a rotation of degree degrees around the axis.
let q = Quaternion.axisAngle(new Vector3(0, 1, 0), 90);
Static eulerGets the quaternion by the value that represents a rotation in Euler angles. Axes are applied in the order of ZXY.
Gets the quaternion by the value that represents a rotation in Euler angles. Axes are applied in the order of ZXY.
Static fromGets a Quaternion that changes orientation from from direction to another direction to.
Static lookCreates a Quaternion looking towards forward direction with the upward direction being up.
up is optional, and if omitted, it will be treated as if new Vector3(0, 1, 0) was specified.
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.