VoltAir
|
A collection of WaterParticles which can perform updates each frame. More...
Public Member Functions | |
WaterParticleSet () | |
Construct an empty WaterParticleSet. More... | |
int | getParticleCount () const |
Returns the number of WaterParticles in this set. More... | |
void | addParticle (WaterParticle *particle) |
Adds a WaterParticle to be tracked by this set. More... | |
WaterParticle * | getParticleWithUserData (void *userData) const |
Returns the WaterParticle associated with the given particle's user data, or nullptr if it does not correspond to a WaterParticle in this set. More... | |
bool | containsParticle (WaterParticle *particle) const |
Returns whether or not the given WaterParticle exists in this set. More... | |
void | clearParticles () |
Deletes all WaterParticles associated with this set, deleting the associated LiquidFun particles as well. More... | |
void | update () |
Calls WaterParticle::update() on all WaterParticles in this set. More... | |
A collection of WaterParticles which can perform updates each frame.
This class is used to track particles which came from the same logical source, for example a particle emitter like ParticleEmitterLogic. When this object is destroyed, all associated particles are also deleted.
WaterParticleSet::WaterParticleSet | ( | ) |
Construct an empty WaterParticleSet.
void WaterParticleSet::addParticle | ( | WaterParticle * | particle | ) |
Adds a WaterParticle to be tracked by this set.
particle | WaterParticle to add |
void WaterParticleSet::clearParticles | ( | ) |
Deletes all WaterParticles associated with this set, deleting the associated LiquidFun particles as well.
bool WaterParticleSet::containsParticle | ( | WaterParticle * | particle | ) | const |
Returns whether or not the given WaterParticle exists in this set.
particle | WaterParticle to check |
|
inline |
Returns the number of WaterParticles in this set.
WaterParticle* WaterParticleSet::getParticleWithUserData | ( | void * | userData | ) | const |
Returns the WaterParticle associated with the given particle's user data, or nullptr
if it does not correspond to a WaterParticle in this set.
userData | LiquidFun particle's user data value |
void WaterParticleSet::update | ( | ) |
Calls WaterParticle::update() on all WaterParticles in this set.