x coordinate
y coordinate
z coordinate
w coordinate
Clones this quaternion.
Copies values of q to this quaternion.
Inverts this quaternion.
Computes length of 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.
Sets this quaternion from rotation component of m. Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm.
Generated using TypeDoc
Implementation of a quaternion. This is used for rotating things without incurring in the dreaded gimbal lock issue, amongst other advantages.
var quaternion = new THREE.Quaternion(); quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 ); var vector = new THREE.Vector3( 1, 0, 0 ); vector.applyQuaternion( quaternion );