List of all members | Public Member Functions
thor::AnimationAffector Class Reference

Affector that animates particles using a function. More...

Public Member Functions

 AnimationAffector (std::function< void(Particle &, float)> particleAnimation)
 Constructor. More...
void operator() (Particle &particle, sf::Time dt)
 Affects particles. More...

Detailed Description

Affector that animates particles using a function.

This affector can be used to apply animations of Thor's Animations module to particles. Such animations are described by a function with signature void(Particle& animated, float progress).

Constructor & Destructor Documentation

thor::AnimationAffector::AnimationAffector ( std::function< void(Particle &, float)>  particleAnimation)


Applies an animation during the whole lifetime of the particles.

particleAnimationAn animation function that is applied to the particle. Its second parameter progress corresponds to getElapsedRatio(particle), the delta time of operator() is ignored.

Member Function Documentation

void thor::AnimationAffector::operator() ( Particle particle,
sf::Time  dt 

Affects particles.

particleThe particle currently being affected.
dtTime interval during which particles are affected.

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