VoltAir
|
A Particle which destroys itself after a decay time has elapsed. More...
Public Member Functions | |
WaterParticle (ParticleLayer *layer, const QPointF &position, const QPointF &velocity, const QColor &color, float decayTime) | |
Constructs a WaterParticle in the given ParticleLayer with the specified position, velocity, color, and time-to-live. More... | |
WaterParticle (ParticleLayer *layer, int index, float decayTime) | |
Constructs a WaterParticle to represent an already existing particle in the particle system. More... | |
void | beginDecaying () |
Start the decay of this WaterParticle. More... | |
void | resetDecayTime () |
Reset the decay time of this WaterParticle. More... | |
void | update () |
Process the decay timer, deleting this WaterParticle if the decay time has elapsed. More... | |
Public Member Functions inherited from Particle | |
Particle (ParticleLayer *layer) | |
Constructs a new Particle. More... | |
bool | isDestroyed () const |
Returns whether or not destroy() was already called. More... | |
void | destroy () |
Destroys the associated LiquidFun particle, removing it from the b2ParticleSystem . More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Particle | |
void | createNewParticle (const QPointF &position, const QPointF &velocity, const QColor &color) |
Constructs a new LiquidFun particle in the particle system associated with this wrapper, using the specified position, velocity, and color. More... | |
void | mapToExistingParticle (int index) |
Associates this Particle with an existing LiquidFun particle in the b2ParticleSystem . More... | |
A Particle which destroys itself after a decay time has elapsed.
WaterParticle::WaterParticle | ( | ParticleLayer * | layer, |
const QPointF & | position, | ||
const QPointF & | velocity, | ||
const QColor & | color, | ||
float | decayTime | ||
) |
Constructs a WaterParticle in the given ParticleLayer with the specified position, velocity, color, and time-to-live.
layer | ParticleLayer to spawn particle in |
position | Position in world coordinates to spawn the particle at |
velocity | Initial velocity of the particle |
color | Color of the particle |
decayTime | Decay time of the particle |
WaterParticle::WaterParticle | ( | ParticleLayer * | layer, |
int | index, | ||
float | decayTime | ||
) |
Constructs a WaterParticle to represent an already existing particle in the particle system.
This method uses Particle::mapToExistingParticle() to attach to an existing particle.
layer | ParticleLayer the existing particle is in |
index | Index of the particle to attach to |
decayTime | Decay time of the particle |
void WaterParticle::beginDecaying | ( | ) |
Start the decay of this WaterParticle.
Once the decay time interval of game time has elapsed, the WaterParticle will delete itself in update().
void WaterParticle::resetDecayTime | ( | ) |
Reset the decay time of this WaterParticle.
void WaterParticle::update | ( | ) |
Process the decay timer, deleting this WaterParticle if the decay time has elapsed.