Optional
x: numberInput x coordinate
Optional
y: numberInput y coordinate
Optional
z: numberInput z coordinate
Optional
w: numberInput w coordinate
W cooridinate
X cooridinate
Y cooridinate
Z cooridinate
Return the angle between this quaternion and quaternion q in radians.
Input one quaternion
Return the angle between this quaternion and quaternion q in radians.
Create a new quaternion with identical x, y, z and w properties to this one.
Return cloned instance
Copy the x, y, z and w properties of q into this quaternion.
Input the quaternion copied from
Return this quaternion
Calculate the dot product of quaternions v and this one.
Input one quaternion
Return the dot product of quaternions v and this one
Compare the x, y, z and w properties of v to the equivalent properties of this quaternion to determine if they represent the same rotation.
Input quaternion that this quaternion will be compared to.
Return true if the specified quaternion and this quaternion represent the same rotation.
Set this quaternion's x, y, z and w properties from an array.
Input an array of format (x, y, z, w) used to construct the quaternion.
Optional
offset: numberInput an optional offset into the array
Return this quaternion
Compute 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().
Return the squared Euclidean length (straight-line length) of this quaternion
Multiply this quaternion by q.
Input one quaternion to multiply
Return this quaternion
Sets this quaternion to a x b.
Input one quaternion
Input one quaternion
Return this quaternion
Pre-multiply this quaternion by q.
Input one quaternion
Return this quaternion
Rotate this quaternion by a given angular step to the defined quaternion q. The method ensures that the final quaternion will not overshoot q.
Input the target quaternion.
Input the angular step in radians.
Return this quaternion
Set this quaternion from rotation specified by axis and angle. Axis is assumed to be normalized, angle is in radians.
Input one normalized axis
Input one angle in radians
Return this quaternion
Set this quaternion from rotation component of the specified matrix.
Input a Matrix4 of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).
Return this quaternion
Set this quaternion to the rotation required to rotate direction vector vFrom to direction vector vTo.
Input one normalized direction vector
Input one normalized direction vector
Return this quaternion
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).
Input the other quaternion rotation
Input interpolation factor in the closed interval [0, 1].
Return this quaternion
Perform a spherical linear interpolation between the given quaternions and stores the result in this quaternion.
Input one quaternion rotation
Input the other quaternion rotation
Input interpolation factor in the closed interval [0, 1].
Return this quaternion
Return the numerical elements of this quaternion in an array of format [x, y, z, w].
Optional
array: number[]Input an optional array to store the quaternion. If not specified, a new array will be created.
Optional
offset: number(optional) if specified, the result will be copied into this Array.
Return an array
Static
multiplyThis multiplication implementation assumes the quaternion data are managed in flat arrays.
Input the output array.
Input an offset into the output array.
Input the source array of the starting quaternion.
Input an offset into the array src0.
Input the source array of the target quaternion.
Input an offset into the array src1.
Return an array
Static
slerpThis SLERP implementation assumes the quaternion data are managed in flat arrays.
Input the output array
Input an offset into the output array
Input the source array of the starting quaternion.
Input an offset into the array src0.
Input the source array of the target quaternion.
Input an offset into the array src1.
Input normalized interpolation factor (between 0 and 1).
Create one instance of this class