
7.2 Collision Processing 123
7.2.2 Resolving Interpenetration
When two objects are interpenetrating, we will move them apart just enough to sep-
arate them. We will expect the collision detector to tell us how far the objects have
interpenetrated, as part of the
Contact data structure that it creates. The calculation
of the interpenetration depth depends on the geometries of the objects colliding. As
seen previously, this is the domain of the collision detection system, rather than the
physics simulator, and we’ll treat it as a magic process until Chapter 12.
We add a data member to the contact data structure to hold this information:
Excerpt from file ...