Computes the world-space inverse inertia matrix for a given body rotation.
Formula: I_inv_world = R * diag(invInertiaDiagonal) * R * mInertiaRotation * R^T
where R is the body's rotation matrix.
Written out in scalars rather than as four mat4 calls through shared scratch. The three
intermediate matrices only ever existed to feed the next step, so they live as locals instead of
module state; the arithmetic is unchanged, so the result is bit-identical (see
tst/inverse-inertia-scalar-form.test.ts). Module-scope scratch is the reason the helper version
was slower: a buffer the whole module can see cannot live in registers.
Computes the world-space inverse inertia matrix for a given body rotation.
Formula: I_inv_world = R * diag(invInertiaDiagonal) * R * mInertiaRotation * R^T where R is the body's rotation matrix.
Written out in scalars rather than as four
mat4calls through shared scratch. The three intermediate matrices only ever existed to feed the next step, so they live as locals instead of module state; the arithmetic is unchanged, so the result is bit-identical (seetst/inverse-inertia-scalar-form.test.ts). Module-scope scratch is the reason the helper version was slower: a buffer the whole module can see cannot live in registers.