
14.4 The Collision Resolution Pr ocess 369
unsigned numContacts,
real duration);
};
Excerpt from file src/contacts.cpp
void ContactResolver::prepareContacts(Contact* contacts,
unsigned numContacts,
real duration)
{
// Generate contact velocity and axis information.
Contact* lastContact = contacts + numContacts;
for (Contact* contact=contacts; contact < lastContact; contact++)
{
// Calculate the internal contact data (inertia, basis, etc.).
contact->calculateInternals(duration);
}
}
In the calculateInternals method of the contact, we need to calculate each of
the three bits of data: contact basis, relative position, and relative velocity:
Excerpt from file include/cyclo ...