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... | |
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).
|
explicit |
Constructor.
Applies an animation during the whole lifetime of the particles.
particleAnimation | An animation function that is applied to the particle. Its second parameter progress corresponds to getElapsedRatio(particle), the delta time of operator() is ignored. |
void thor::AnimationAffector::operator() | ( | Particle & | particle, |
sf::Time | dt | ||
) |
Affects particles.
particle | The particle currently being affected. |
dt | Time interval during which particles are affected. |