List of all members | Public Member Functions | Public Attributes | Related Functions
thor::Particle Class Reference

Particle class More...

Public Member Functions

 Particle (sf::Time totalLifetime)
 Constructor. More...
 

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

sf::Time getElapsedLifetime (const Particle &particle)
 Returns the time passed since the particle has been emitted.
 
sf::Time getTotalLifetime (const Particle &particle)
 Returns the total time the particle is alive.
 
sf::Time getRemainingLifetime (const Particle &particle)
 Returns the time left until the particle dies.
 
float getElapsedRatio (const Particle &particle)
 Returns elapsed lifetime / total lifetime.
 
float getRemainingRatio (const Particle &particle)
 Returns remaining lifetime / total lifetime.
 
void abandonParticle (Particle &particle)
 Marks a particle for removal. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

thor::Particle::Particle ( sf::Time  totalLifetime)
explicit

Constructor.

Parameters
totalLifetimeHow long the particle totally exists.

The documentation for this class was generated from the following file: