VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Public Member Functions | List of all members
WaterParticleSet Class Reference

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...
 
WaterParticlegetParticleWithUserData (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

WaterParticleSet::WaterParticleSet ( )

Construct an empty WaterParticleSet.

Member Function Documentation

void WaterParticleSet::addParticle ( WaterParticle particle)

Adds a WaterParticle to be tracked by this set.

Parameters
particleWaterParticle 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.

Parameters
particleWaterParticle to check
int WaterParticleSet::getParticleCount ( ) const
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.

Parameters
userDataLiquidFun particle's user data value
void WaterParticleSet::update ( )

Calls WaterParticle::update() on all WaterParticles in this set.