Optional
x: numberx coordinate
Optional
y: numbery coordinate
Optional
z: numberz coordinate
Optional
w: numberw coordinate
Readonly
isCopies values of q to this quaternion.
Sets x, y, z, w properties of this quaternion from the attribute.
the source attribute.
index in the attribute.
Inverts this quaternion.
Multiplies this quaternion by b.
Sets this quaternion to a x b Adapted from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm.
Normalizes this quaternion.
Sets values of this quaternion.
Sets this quaternion from rotation specified by axis and angle. Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm. Axis have to be normalized, angle is in radians.
Sets this quaternion from rotation specified by Euler angles.
Optional
update: booleanSets this quaternion from rotation component of m. Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm.
Returns an array [x, y, z, w], or copies x, y, z and w into the provided array.
Optional
array: number[](optional) array to store the quaternion to. If this is not provided, a new array will be created.
Optional
offset: number(optional) optional offset into the array.
The created or provided array.
Copies x, y, z and w into the provided array-like.
array-like to store the quaternion to.
Optional
offset: number(optional) optional offset into the array.
The provided array-like.
Static
multiplyStatic
slerpStatic
slerp
Implementation of a quaternion. This is used for rotating things without incurring in the dreaded gimbal lock issue, amongst other advantages.
Example