![]() |
Particle class More...
Public Member Functions | |
Particle (sf::Time totalLifetime) | |
Constructor. | |
Public Attributes | |
sf::Vector2f | position |
Current position. | |
sf::Vector2f | velocity |
Velocity (change in position per second). | |
float | rotation |
Current rotation angle. | |
float | rotationSpeed |
Angular velocity (change in rotation per second). | |
sf::Vector2f | scale |
Scale, where (1,1) represents the original size. | |
sf::Color | color |
Particle color. | |
unsigned int | textureIndex |
Index of the used texture rect, returned by ParticleSystem::addTextureRect() | |
Related Functions | |
(Note that these are not member functions.) | |
sf::Time | thor::getElapsedLifetime (const Particle &particle) |
Returns the time passed since the particle has been emitted. | |
sf::Time | thor::getTotalLifetime (const Particle &particle) |
Returns the total time the particle is alive. | |
sf::Time | thor::getRemainingLifetime (const Particle &particle) |
Returns the time left until the particle dies. | |
float | thor::getElapsedRatio (const Particle &particle) |
Returns elapsed lifetime / total lifetime. | |
float | thor::getRemainingRatio (const Particle &particle) |
Returns remaining lifetime / total lifetime. | |
void | thor::abandonParticle (Particle &particle) |
Marks a particle for removal. |
Particle class
This class represents single particles of a particle system. It stores properties like position, rotation, scale, movement, color and life time.
You normally don't have to work directly with particles outside of an affector or emitter.
thor::Particle::Particle | ( | sf::Time | totalLifetime | ) | [explicit] |
Constructor.
totalLifetime | How long the particle totally exists. |