Creates a new ObservableQuaternion, defaulting to identity (0, 0, 0, 1)
Observer notified when any component changes
The x component
The y component
The z component
The w component
Sets the w component
New w component
Sets the x component
New x component
Sets the y component
New y component
Sets the z component
New z component
Returns the angle of the turn from this rotation to q
Both quaternions are assumed unit-length.
The other quaternion
The angle in radians, from 0 to π
Creates a copy of this quaternion that notifies observer, or this quaternion's observer when
left out
A copy of a node's quaternion that keeps the node as its observer makes the node recompute its
transform on every change, though the node doesn't turn. For a plain copy, use
new Quaternion().copyFrom(node.quaternion).
Optionalobserver: Observer<ObservableQuaternion>
Observer for the copy
The new quaternion
Negates x, y and z, leaving w, which reverses a unit quaternion's turn
Target to write the result into instead of this quaternion
The result quaternion for chaining
Copies q into this quaternion
The quaternion to copy from
This quaternion for chaining
Copies this quaternion into target and returns it
The quaternion to copy into
The given target
Returns the dot product of this quaternion and q
The other quaternion
The dot product
Returns true when x, y, z and w match q exactly, with no tolerance
The quaternion to compare with
Whether all components match
Reads x, y, z, w from array starting at offset
The array to read from
The offset into array to read at
This quaternion for chaining
Inverts this rotation, so it turns the other way
Computes the conjugate, which is the inverse of a unit quaternion.
Target to write the result into instead of this quaternion
The result quaternion for chaining
Returns the squared length of this quaternion
Cheaper than ObservableQuaternion#magnitude and enough to check for drift.
The squared magnitude
Multiplies this quaternion by q (this = this * q), turning the node by q around its own axes
Quaternion#multiply explains the order.
The quaternion to multiply by
Target to write the result into instead of this quaternion
The result quaternion for chaining
Scales this quaternion to unit length, undoing the drift of repeated multiplies
A zero quaternion becomes identity.
Target to write the result into instead of this quaternion
The result quaternion for chaining
Pre-multiplies this quaternion by q (this = q * this), turning the node by q around its
parent's axes
The quaternion to pre-multiply by
Target to write the result into instead of this quaternion
The result quaternion for chaining
Sets this quaternion to a turn of angle radians around the unit-length axis
The unit-length rotation axis
The rotation angle in radians
Target to write the result into instead of this quaternion
The result quaternion for chaining
Sets this quaternion from Euler angles in radians, in the XYZ order of Container3D#rotation
The Euler angles as (x, y, z) radians
Target to write the result into instead of this quaternion
The result quaternion for chaining
Sets this quaternion to the rotation in m
The upper-left 3x3 of m must be a pure rotation, with no scale. Use
ObservableQuaternion#setFromScaledRotationMatrix for a matrix with scale.
The rotation matrix to extract from
Target to write the result into instead of this quaternion
The result quaternion for chaining
Sets this quaternion to the rotation in m, a transform that may also scale each axis
Quaternion#setFromScaledRotationMatrix says what a zero or mirrored scale gives.
The transform to extract from
Target to write the result into instead of this quaternion
The result quaternion for chaining
Sets this quaternion to the shortest turn that takes unit-length vFrom to unit-length vTo
Quaternion#setFromUnitVectors says what happens when they point opposite ways.
The unit-length start direction
The unit-length end direction
Target to write the result into instead of this quaternion
The result quaternion for chaining
Blends from this rotation toward qb by t, turning at an even rate the shorter way round
The quaternion to interpolate towards
The interpolation factor in [0, 1]
Target to write the result into instead of this quaternion
The result quaternion for chaining
Writes this quaternion's values into array starting at offset
The array to write into; a new array when omitted
The offset into array to write at
The written array
A Quaternion that tells an observer when it changes
A node's quaternion is one, so changing it turns the node. It has the same methods as Quaternion. Each in-place method notifies the observer at most once, and not at all when no component changed. Given an
outtarget, a method writes there and leaves this quaternion and its observer alone.Example