A ParticleLayer to manage particles in world space. More...
#include <WorldParticleLayer.h>
Classes | |
struct | WorldParticle |
Layer specific particle data for managing particles in world space. More... | |
Public Member Functions | |
WorldParticleLayer (float speedFactor) | |
Creates a new WorldParticleLayer. | |
virtual | ~WorldParticleLayer () |
Deletes this WorldParticleLayer. | |
float | getSpeedFactor () const |
Returns the global scaling factor to be applied to all particle velocities. | |
void | setSpeedFactor (float speedFactor) |
Sets the global scaling factor to be applied to all particle velocities. | |
bool | isPaused () const |
Returns true if this WorldParticleLayer is in paused state. | |
void | setPaused (bool paused) |
Sets the paused state of this WorldParticleLayer. | |
WorldParticle * | getWorldParticle (ParticleStorage::Particle *p) |
Returns the world space specific data of the given particle. | |
virtual void | moveParticles (double dt) |
Moves the particles based on their velocity. | |
Protected Member Functions | |
WorldParticleLayer () | |
Creates an uninitialized WorldParticleLayer. | |
void | init (float speedFactor) |
Initializes this WorldParticleLayer. | |
virtual void | initParticle (ParticleStorage::Particle *p) |
Initializes the world position and velocity of the given particle. | |
Private Attributes | |
float | speedFactor |
Global scaling factor to be applied to all particle velocities. | |
bool | paused |
If true, particles position won't be updated. |
A ParticleLayer to manage particles in world space.
This class provides particle data to store a position and a velocity for each particle. It updates the positions based on velocities at each frame, but it does not compute the velocities itself. This should be done by another layer.
proland::WorldParticleLayer::WorldParticleLayer | ( | float | speedFactor | ) |
Creates a new WorldParticleLayer.
speedFactor | a global scaling factor to be applied to all particle velocities. |
virtual proland::WorldParticleLayer::~WorldParticleLayer | ( | ) | [virtual] |
Deletes this WorldParticleLayer.
proland::WorldParticleLayer::WorldParticleLayer | ( | ) | [protected] |
Creates an uninitialized WorldParticleLayer.
float proland::WorldParticleLayer::getSpeedFactor | ( | ) | const |
Returns the global scaling factor to be applied to all particle velocities.
WorldParticle* proland::WorldParticleLayer::getWorldParticle | ( | ParticleStorage::Particle * | p | ) | [inline] |
Returns the world space specific data of the given particle.
p | a particle. |
void proland::WorldParticleLayer::init | ( | float | speedFactor | ) | [protected] |
Initializes this WorldParticleLayer.
See WorldParticleLayer.
virtual void proland::WorldParticleLayer::initParticle | ( | ParticleStorage::Particle * | p | ) | [protected, virtual] |
Initializes the world position and velocity of the given particle.
Reimplemented from proland::ParticleLayer.
bool proland::WorldParticleLayer::isPaused | ( | ) | const |
Returns true if this WorldParticleLayer is in paused state.
virtual void proland::WorldParticleLayer::moveParticles | ( | double | dt | ) | [virtual] |
Moves the particles based on their velocity.
The velocities are not updated. This should be done by another layer.
Reimplemented from proland::ParticleLayer.
void proland::WorldParticleLayer::setPaused | ( | bool | paused | ) |
Sets the paused state of this WorldParticleLayer.
paused | if true, particles position won't be updated. |
void proland::WorldParticleLayer::setSpeedFactor | ( | float | speedFactor | ) |
Sets the global scaling factor to be applied to all particle velocities.
bool proland::WorldParticleLayer::paused [private] |
If true, particles position won't be updated.
float proland::WorldParticleLayer::speedFactor [private] |
Global scaling factor to be applied to all particle velocities.