IT lexicon › Programming › Penetration depth

Penetration depth

Programming På svenska → Updated: 2026-10-24

How deeply two overlapping bodies have sunk into each other — the shortest push that separates them, along the contact normal.

Once the narrow phase reports that two shapes collide, the solver needs to know how much they overlap and which way to undo it. The penetration depth is the minimum translation (MTD) that just barely separates them, plus the normal it points along. For convex shapes GJK decides whether they intersect at all; when they do, EPA (the Expanding Polytope Algorithm, van den Bergen around 2001) grows a simplex until it finds the depth and normal.

Shoving bodies apart by the full depth in one step produces bouncy, jittery stacks, so engines correct only a fraction each step and leave a small allowed overlap (slop). Baumgarte stabilisation is the classic recipe.

← Back to the lexicon