
13.2 Contact Generation 299
Contact
normal
Contact
point
Penetration depth
FIGURE 13.5 The relationship among the collision point, collision normal, and penetration depth.
The previous elements are stored in a c ontact data structure as follows:
Excerpt from file include/cyclone/contacts.h
/**
* A contact represents two bodies in contact. Resolving a
* contact removes their interpenetration, and applies sufficient
* impulse to keep them apart. Colliding bodies may also rebound.
* Contacts can be used to represent positional joints, by making
* the contact constraint keep the bodies in their correct
* orientation.
*/
class Contact
{
/**
* Holds the position of