Members
approxEquals
basis
Column-major 3x3 basis of the quaternion, for building render matrices.
- qQuat
- Undocumented
conjugate
Inverse of a unit quaternion.
- qQuat
- Undocumented
equals
fromAxisAngle
- axisVec3
- Undocumented
- anglenumber
- Undocumented
fromBasis
Quaternion from an orthonormal basis, given as the images of +X, +Y and +Z.
Shepperd's method: pick the largest diagonal term first. The naive single-branch formula divides by a quantity that goes to zero for rotations near 180 degrees, which is exactly the case a surface frame on the far side of a planet hits.
fromUnitVectors
Shortest rotation taking unit vector from to unit vector to.
IDENTITY
integrate
Integrate an orientation by a body-frame angular velocity over dt.
Exact rotation about the (constant over the step) angular velocity axis
rather than the usual first-order q + 0.5*ω*q*dt: the first-order form
denormalizes, and at time-warp the accumulated drift is visible within a few
seconds of wall clock.
multiply
Hamilton product: a then b applied in a's frame, i.e. rotate by b∘a.
normalize
- qQuat
- Undocumented
quat
- xnumber
- Undocumented
- ynumber
- Undocumented
- znumber
- Undocumented
- wnumber
- Undocumented
Quat
Unit quaternion, (x, y, z) vector part and w scalar part.
Orientations are quaternions everywhere in the simulation. Euler angles show up only at presentation boundaries: 6-DoF flight has no privileged axis, so any Euler convention gimbal-locks somewhere a player will actually fly.
rotate
Rotate a vector from local axes into the quaternion's parent axes.
rotateInverse
Rotate a vector from parent axes into the quaternion's local axes.