Stability improvements

We can make several improvements to the stability of our physics engine. We fixed the problem of sinking using linear projection in Chapter 15, Manifolds and Impulses. Linear projection introduces its own flaws into our engine: jitter and object crawling. We used heavy friction to cover these issues up. Older physics engines had similar issues; they tended to use aggressive sleeping to cover these issues up. When a rigid body is asleep, it has no forces acting on it (including gravity) and therefore does not sink.

The more modern approach to fixing these issues is called Baumgarte Stabilization. Baumgarte Stabilization works by adding extra energy to physics resolution. This extra energy causes some jitter, but fixes the ...

Get Game Physics Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.