Cyclone Cyclone: cyclone::ParticleContactResolver Class Reference

cyclone::ParticleContactResolver Class Reference

The contact resolution routine for particle contacts. More...

#include <pcontacts.h>

List of all members.

Public Member Functions

 ParticleContactResolver (unsigned iterations)
 Creates a new contact resolver.
void setIterations (unsigned iterations)
 Sets the number of iterations that can be used.
void resolveContacts (ParticleContact *contactArray, unsigned numContacts, real duration)
 Resolves a set of particle contacts for both penetration and velocity.

Protected Attributes

unsigned iterations
 Holds the number of iterations allowed.
unsigned iterationsUsed
 This is a performance tracking value - we keep a record of the actual number of iterations used.


Detailed Description

The contact resolution routine for particle contacts.

One resolver instance can be shared for the whole simulation.


Constructor & Destructor Documentation

cyclone::ParticleContactResolver::ParticleContactResolver unsigned  iterations  ) 
 

Creates a new contact resolver.


Member Function Documentation

void cyclone::ParticleContactResolver::resolveContacts ParticleContact contactArray,
unsigned  numContacts,
real  duration
 

Resolves a set of particle contacts for both penetration and velocity.

/<PCResolverResolve

Contacts that cannot interact with each other should be passed to separate calls to resolveContacts, as the resolution algorithm takes much longer for lots of contacts than it does for the same number of contacts in small sets.

Parameters:
contactArray Pointer to an array of particle contact objects.
numContacts The number of contacts in the array to resolve.
numIterations The number of iterations through the resolution algorithm. This should be at least the number of contacts (otherwise some constraints will not be resolved - although sometimes this is not noticable). If the iterations are not needed they will not be used, so adding more iterations may not make any difference. But in some cases you would need millions of iterations. Think about the number of iterations as a bound: if you specify a large number, sometimes the algorithm WILL use it, and you may drop frames.
duration The duration of the previous integration step. This is used to compensate for forces applied. />PCResolverResolve

void cyclone::ParticleContactResolver::setIterations unsigned  iterations  ) 
 

Sets the number of iterations that can be used.


Member Data Documentation

unsigned cyclone::ParticleContactResolver::iterations [protected]
 

Holds the number of iterations allowed.

unsigned cyclone::ParticleContactResolver::iterationsUsed [protected]
 

This is a performance tracking value - we keep a record of the actual number of iterations used.


The documentation for this class was generated from the following file: