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... | |
Applies a translational acceleration to particles over time.
Affector class that applies an acceleration vector to each particle. A popular use case is gravity.
|
explicit |
Constructor.
acceleration | The acceleration vector. The particle's velocity changes by this vector each second. |
void thor::ForceAffector::operator() | ( | Particle & | particle, |
sf::Time | dt | ||
) |
Affects particles.
particle | The particle currently being affected. |
dt | Time interval during which particles are affected. |