x coordinate
y coordinate
z coordinate
w coordinate
w coordinate
x coordinate
y coordinate
z coordinate
Returns the angle between this quaternion and quaternion q in radians.
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 q into this quaternion.
Calculates the dot product of quaternions 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.
Quaternion that this quaternion will be compared to.
Sets .x, .y, .z, .w properties of this quaternion from the attribute.
The source attribute.
index in the attribute.
Sets this quaternion to the identity quaternion; that is, to the quaternion that represents "no rotation".
Inverts this quaternion - calculates the .conjugate. The quaternion is assumed to have unit length.
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 q.
Normalizes this quaternion - that is, calculated the quaternion that performs the same rotation as this one, but has .length equal to 1.
Pre-multiplies this quaternion by q.
Sets this quaternion to a uniformly random, normalized quaternion.
The target quaternion.
The angular step in radians. Rotates this quaternion by a given angular step to the defined quaternion q. The method ensures that the final quaternion will not overshoot q.
Sets .x, .y, .z, .w properties of this quaternion.
Sets this quaternion from the rotation specified by Euler angle.
A Matrix4 of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).
interpolation factor in the closed interval [0, 1]. 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. Also see the static version of the slerp below. // rotate a mesh towards a target quaternion mesh.quaternion.slerp( endQuaternion, 0.01 );
The output array.
An offset into the output array.
The source array of the starting quaternion.
The source array of the target quatnerion.
Normalized interpolation factor (between 0 and 1). Like the static slerp method above, but operates directly on flat arrays of numbers.
Performs a spherical linear interpolation between the given quaternions and stores the result in this quaternion.
Sets this quaternion's .x, .y, .z and .w properties from an array.
array of format (x, y, z, w) used to construct the quaternion.
an offset into the array.
Copies x, y, z and w into the provided array-like.
array-like to store the quaternion to.
(optional) optional offset into the array.
The provided array-like.
Generated using TypeDoc
Implementation of a quaternion. Quaternions are used in three.js to represent rotations. See the ngx3js docs page for details.
Examples
misc / animation / groups misc / animation / keys physics / ammo / break webgl / buffergeometry / instancing / interleaved webgl / custom / attributes / points3
Code Example