Game Development Reference
be the total change in velocity, not the total velocity:
p = ˙
where g 1 ...g n is the set of all impulses acting on the object. In practice we won't
accumulate impulses in the way we did forces. We will apply impulses as they arise
during the collision resolution process. Each will be applied one at a time using the
The result of our collision resolution will be an impulse to apply to each object.
The impulse will be immediately applied and will instantly change the velocity of the
p = ˙
C OLLISION P ROCESSING
To handle collisions we will create a new piece of code—the ContactResolver .Ithas
the job of taking a whole set of collisions and applying the relevant impulses to the
objects involved. Each collision is provided in a Contact data structure, which looks
Excerpt from include/cyclone/pcontacts.h
* A contact represents two objects in contact (in this case
* ParticleContact representing two particles). Resolving a
* contact removes their interpenetration, and applies sufficient
* impulse to keep them apart. Colliding bodies may also rebound.
* The contact has no callable functions, it just holds the
* contact details. To resolve a set of contacts, use the particle
* contact resolver class.
* Holds the particles that are involved in the contact. The
* second of these can be NULL, for contacts with the scenery.