Game Development Reference
* Holds the normal restitution coefficient at the contact.
* Holds the direction of the contact in world coordinates.
The structure holds a pointer to each object involved in the collision; a vector
representing the contact normal, from the first object's perspective; and a data mem-
ber for the coefficient of restitution for the contact. If we are dealing with a collision
between an object and the scenery (i.e., there is only one object involved), then the
pointer for the second object will be NULL .
To resolve one contact we implement the collision equations from earlier in the
section to give
Excerpt from include/cyclone/pcontacts.h
// ... Other ParticleContact code as before ...
* Resolves this contact, for both velocity and interpenetration.
void resolve(real duration);
* Calculates the separating velocity at this contact.
real calculateSeparatingVelocity() const;
* Handles the impulse calculations for this collision.
void resolveVelocity(real duration);
Excerpt from src/pcontacts.cpp
void ParticleContact::resolve(real duration)