Game Development Reference
In-Depth Information
*/
Matrix3 contactToWorld;
/**
* Holds the closing velocity at the point of contact. This is
* set when the calculateInternals function is run.
*/
Vector3 contactVelocity;
/**
* Holds the required change in velocity for this contact to be
* resolved.
*/
real desiredDeltaVelocity;
/**
* Holds the world space position of the contact point
* relative to the center of each body. This is set when
* the calculateInternals function is run.
*/
Vector3 relativeContactPosition[2];
};
The preparation routine only needs to call each contact in turn and ask it to calculate
the appropriate data:
Excerpt from include/cyclone/contacts.h
/**
* The contact resolution routine. One resolver instance
* can be shared for the whole simulation, as long as you need
* roughly the same parameters each time (which is normal).
*/
class ContactResolver
{
protected:
/**
* Sets up contacts ready for processing. This makes sure their
* internal data is configured correctly and the correct set of
* bodies is made alive.
*/
void prepareContacts(Contact *contactArray, unsigned numContacts,
real duration);
};
Search Nedrilad ::




Custom Search