The x coordinate of the quaternion. Default is 0.
The y coordinate of the quaternion. Default is 0.
The z coordinate of the quaternion. Default is 0.
The w coordinate of the quaternion. Default is 1.
The w coordinate of the quaternion.
The w coordinate of the quaternion.
The x coordinate of the quaternion.
The x coordinate of the quaternion.
The y coordinate of the quaternion.
The y coordinate of the quaternion.
The z coordinate of the quaternion.
The z coordinate of the quaternion.
Creates a new quaternion with identical x, y, z and w properties to this one.
Returns the rotational conjugate of this quaternion. The conjugate of a quaternion represents the same rotation in the opposite direction about the rotational axis.
Copies the x, y, z and w properties of v into this quaternion.
The other quaternion to copy the coordinates from.
Calculates the dot product of the quaternion v and this one.
Compares the x, y, z and w properties of v to the equivalent properties of this quaternion to determine if they represent the same rotation.
The quaternion that this one will be compared to.
Sets this quaternion's x, y, z, and w properties from the provided array.
The array of format [x, y, z, w] used to construct this quaternion.
An offset into the array from where to start reading the elements. Defaults to 0.
Conjugates and normalizes this quaternion.
Computes the Euclidean length (straight-line length) of this quaternion, considered as a 4 dimensional vector.
Computes the squared Euclidean length (straight-line length) of this quaternion, considered as a 4 dimensional vector. This can be useful if you are comparing the lengths of two quaternions, as this is a slightly more efficient calculation than length().
Multiplies this quaternion by the other quaternion q.
The quaternion to multiply this one by.
Sets this quaternion to a x b. Adapted from the method outlined here.
First quaternion to multiply.
Second quaternion to multiply.
Normalizes this quaternion, that is, calculates the quaternion that performs the same rotation as this one, but has a length equal to 1.
Pre-multiplies this quaternion by the other quaternion q.
The quaternion to pre-multiply this one by.
Sets the x, y, z and w properties of this quaternion.
The x coordinate of the quaternion.
The y coordinate of the quaternion.
The z coordinate of the quaternion.
The w coordinate of the quaternion.
Sets this quaternion from the rotation specified by axis and angle. The axis is assumed to be normalized, and angle is in radians. Adapted from the method here.
The normalized axis of rotation.
The rotation angle in radians.
Sets this quaternion from the rotation specified by the euler transform.
The euler transform to set this quaternion from.
Sets this quaternion from the rotation components of m. Adapted from the method here.
A matrix of which the upper left 3x3 is a pure rotation matrix (i.e. unscaled).
Sets this quaternion to the rotation required to rotate the direction vector vFrom to the direction vector vTo. vFrom and vTo are assumed to be normalized. Adapted from the method here
Handles the spherical linear interpolation between quaternions. t represents the amount of rotation between this quaternion (where t is 0) and qb (where t is 1). This quaternion is set to the result. A slerp static method also exists.
The other quaternion rotation to interpolate towards.
The interpolation factor in the closed interval [0, 1].
Returns the numerical elements of this quaternion in an array of format [x, y, z, w].
The array to store the quaternion in. If not specified, a new array will be created.
An offset into the array where to write the elements of this quaternion.
Handles the spherical linear interpolation between two quaternions and store the result in a third one. t represents the amount of rotation between qStart (where t is 0) and qEnd (where t is 1). The quaternion qTarget is set to the result. A slerp instance method also exists.
The starting quaternion (where t is 0).
The ending quaternion (where t is 1).
The target quaternion that gets set with the result.
The interpolation factor in the closed interval [0, 1].
Handles the spherical linear interpolation between two quaternions and store the result in a third one, each one being is stored as an array of numbers. t represents the amount of rotation between qStartArray (where t is 0) and qEndArray (where t is 1). The quaternion qTargetArray is set to the result. A slerp instance method also exists.
The interpolation factor in the closed interval [0, 1].
Creates a new quaternion.