Cyclone Cyclone: cyclone::ParticleWorld Class Reference

cyclone::ParticleWorld Class Reference

Keeps track of a set of particles, and provides the means to update them all. More...

#include <pworld.h>

Collaboration diagram for cyclone::ParticleWorld:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< Particle * > Particles
typedef std::vector< ParticleContactGenerator * > ContactGenerators

Public Member Functions

 ParticleWorld (unsigned maxContacts, unsigned iterations=0)
 Creates a new particle simulator that can handle up to the given number of contacts per frame.ParticleWorld.
unsigned generateContacts ()
 Calls each of the registered contact generators to report their contacts.
void integrate (real duration)
 Integrates all the particles in this world forward in time by the given duration.
void runPhysics (real duration)
 Processes all the physics for the particle world.ParticleWorldRun.
void startFrame ()
 Initializes the world for a simulation frame.
ParticlesgetParticles ()
 Returns the list of particles.
ContactGeneratorsgetContactGenerators ()
 Returns the list of contact generators.
ParticleForceRegistrygetForceRegistry ()
 Returns the force registry.

Protected Attributes

Particles particles
 Holds the particles.
bool calculateIterations
 True if the world should calculate the number of iterations to give the contact resolver at each frame.
ParticleForceRegistry registry
 Holds the force generators for the particles in this world.
ParticleContactResolver resolver
 Holds the resolver for contacts.
ContactGenerators contactGenerators
 Contact generators.
ParticleContactcontacts
 Holds the list of contacts.
unsigned maxContacts
 Holds the maximum number of contacts allowed (i.e.

Detailed Description

Keeps track of a set of particles, and provides the means to update them all.


Member Typedef Documentation

typedef std::vector<ParticleContactGenerator*> cyclone::ParticleWorld::ContactGenerators
 

typedef std::vector<Particle*> cyclone::ParticleWorld::Particles
 


Constructor & Destructor Documentation

cyclone::ParticleWorld::ParticleWorld unsigned  maxContacts,
unsigned  iterations = 0
 

Creates a new particle simulator that can handle up to the given number of contacts per frame.ParticleWorld.

You can also optionally give a number of contact-resolution iterations to use. If you don't give a number of iterations, then twice the number of contacts will be used.


Member Function Documentation

unsigned cyclone::ParticleWorld::generateContacts  ) 
 

Calls each of the registered contact generators to report their contacts.

Returns the number of generated contacts.

ContactGenerators& cyclone::ParticleWorld::getContactGenerators  ) 
 

Returns the list of contact generators.

ParticleForceRegistry& cyclone::ParticleWorld::getForceRegistry  ) 
 

Returns the force registry.

Particles& cyclone::ParticleWorld::getParticles  ) 
 

Returns the list of particles.

void cyclone::ParticleWorld::integrate real  duration  ) 
 

Integrates all the particles in this world forward in time by the given duration.

void cyclone::ParticleWorld::runPhysics real  duration  ) 
 

Processes all the physics for the particle world.ParticleWorldRun.

void cyclone::ParticleWorld::startFrame  ) 
 

Initializes the world for a simulation frame.

This clears the force accumulators for particles in the world. After calling this, the particles can have their forces for this frame added.


Member Data Documentation

bool cyclone::ParticleWorld::calculateIterations [protected]
 

True if the world should calculate the number of iterations to give the contact resolver at each frame.

ContactGenerators cyclone::ParticleWorld::contactGenerators [protected]
 

Contact generators.

ParticleContact* cyclone::ParticleWorld::contacts [protected]
 

Holds the list of contacts.

unsigned cyclone::ParticleWorld::maxContacts [protected]
 

Holds the maximum number of contacts allowed (i.e.

the size of the contacts array).

Particles cyclone::ParticleWorld::particles [protected]
 

Holds the particles.

ParticleForceRegistry cyclone::ParticleWorld::registry [protected]
 

Holds the force generators for the particles in this world.

ParticleContactResolver cyclone::ParticleWorld::resolver [protected]
 

Holds the resolver for contacts.


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