Game Development Reference
In-Depth Information
struct ContactGenRegistration
{
ParticleContactGenerator *gen;
ContactGenRegistration *next;
};
/**
* Holds the list of contact generators.
*/
ContactGenRegistration *firstContactGen;
/**
* Holds the list of contacts.
*/
ParticleContact *contacts;
/**
* Holds the maximum number of contacts allowed (i.e., the
* size of the contacts array).
*/
unsigned maxContacts;
public:
/**
* Calls each of the registered contact generators to report
* their contacts. Returns the number of generated contacts.
*/
unsigned generateContacts();
/**
* Integrates all the particles in this world forward in time
* by the given duration.
*/
void integrate(real duration);
/**
* Processes all the physics for the particle world.
*/
void runPhysics(real duration);
};
Excerpt from src/pworld.cpp
unsigned ParticleWorld::generateContacts()
{
Search Nedrilad ::




Custom Search