Skip to content

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

ParameterTypeDescription
spinAnglenumberAccumulated self-rotation around the local Y axis (rad).
axialTiltnumberBody's axial tilt around the local Z axis (rad).
outQuaternionQuaternion to write into. Returned for fluent chaining.

Returns

Quaternion

Distribué sous la licence indiquée dans le dépôt.