Public Member Functions
thor::AnimationAffector Class Reference

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

List of all members.

Public Member Functions

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

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) [explicit]

Constructor.

Applies an animation during the whole lifetime of the particles.

Parameters:
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.

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


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