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

Applies a translational acceleration to particles over time. More...

Public Member Functions

 ForceAffector (sf::Vector2f acceleration)
 Constructor. More...
 
void operator() (Particle &particle, sf::Time dt)
 Affects particles. More...
 

Detailed Description

Applies a translational acceleration to particles over time.

Affector class that applies an acceleration vector to each particle. A popular use case is gravity.

Constructor & Destructor Documentation

thor::ForceAffector::ForceAffector ( sf::Vector2f  acceleration)
explicit

Constructor.

Parameters
accelerationThe acceleration vector. The particle's velocity changes by this vector each second.

Member Function Documentation

void thor::ForceAffector::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: