Store square roots for world-space inverse angular inertia #629
Labels
A-Dynamics
Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on
C-Enhancement
New feature or request
D-Complex
Challenging from a design or technical perspective. Ask for help if you'd like to help tackle this!
Rapier stores world-space angular inertia as the square root of the inverse angular inertia tensor,
effective_world_inv_inertia_sqrt
. Avian and most other physics engines on the other hand just store the inverse angular inertia tensor, not its square root.The reason Rapier stores square roots is to keep angular inertia values more reasonable, allowing the use of larger mass properties before numerical problems start causing simulation artifacts. For example, an inverse angular inertia of
10e-16
becomes just10e-8
.In a simple test with 1x1x1 cubes colliding with each other, Avian "only" supported a mass of
10e13
before the inverse angular inertia became0.0
, while Rapier supported at least a mass of10e19
before visible simulation artifacts started showing up. This is likely thanks to the use of square roots.Pros
Cons
Is It Worth It?
I think we should definitely experiment with this; it would be great to support larger objects and mass properties without stability issues.
However, we should carefully profile to see if there is a measurable performance impact, and determine if that cost is acceptable. I would perhaps wait until some of the current in-progress optimizations and reworks are complete before working on this.
The text was updated successfully, but these errors were encountered: