Particle class More...
Public Member Functions | |
Particle (float 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. | |
Related Functions | |
float | thor::GetPassedLifetime (const Particle &particle) |
Returns the time passed since the particle has been emitted. | |
float | thor::GetTotalLifetime (const Particle &particle) |
Returns the total time the particle is alive. | |
float | thor::GetRemainingLifetime (const Particle &particle) |
Returns the time still to pass until the particle dies. | |
float | thor::GetPassedRatio (const Particle &particle) |
Returns passed lifetime / total lifetime. | |
float | thor::GetRemainingRatio (const Particle &particle) |
Returns remaining lifetime / total lifetime. |
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 | ( | float | totalLifetime | ) | [explicit] |
Constructor.
totalLifetime | How long the particle exists (in seconds). |