crashcat docs
    Preparing search index...

    Function getInverseInertiaForRotation

    • 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.

      Parameters

      • out: Mat4

        output Mat4 to store the result

      • motionProperties: MotionProperties

        motion properties containing inertia data

      • bodyRotation: Mat4

        body's rotation matrix (Mat4)

      Returns Mat4

      out parameter