Unify collision shape transformations

This makes static collision shape transformations the same or practically the same as animated collision shape per-frame overridden transformations, fixing incorrect rotations of scaled shapes (this also affected initial rotations of animated shapes and is evident in tests). Unfortunately this doesn't fix some weird transformation bugs animated collision shapes always had and static collision shapes have now (Starwind now runs into these).

The differences were that the initial transformations had the scale applied separately and didn't use the rotation matrix correctly (getRotate must be applied to an orthogonal matrix). Also copying the rotation matrix directly instead of using a quaternion as a middle-man should be slightly more optimal.

This also corrects the row/column convention the tests use (btMatrix3x3 and NIF rotation matrix convention is actually the same, OpenGL's is transponed). This allows the derived test matrices to make sense.

Edited by Alexei Kotov

Merge request reports

Loading