Function: computeBodyQuaternion()
ts
function computeBodyQuaternion(
spinAngle,
axialTilt,
out): Quaternion;Composes the body's world quaternion from its spin angle and axial tilt.
The order is Q = Q_tilt(Z) * Q_spin(Y) — spin is applied first in the local frame, then the tilt rotates the spinning sphere around the Z axis. Reversing the order would tilt the pole first and rotate around world-Y, making the pole trace a cone (visible "tumble").
Parameters
| Parameter | Type | Description |
|---|---|---|
spinAngle | number | Accumulated self-rotation around the local Y axis (rad). |
axialTilt | number | Body's axial tilt around the local Z axis (rad). |
out | Quaternion | Quaternion to write into. Returned for fluent chaining. |
Returns
Quaternion