Bromeon
Public Types | Static Public Member Functions | Public Member Functions
thor::ForceAffector Class Reference

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

Inheritance diagram for thor::ForceAffector:
Inheritance graph

List of all members.

Public Types

typedef std::tr1::shared_ptr
< ForceAffector
Ptr
 Shared pointer type referring to AccelerationAffector objects.

Static Public Member Functions

static Ptr Create (sf::Vector2f acceleration)
 Creates an affector that accelerates particles continuously.

Public Member Functions

 ForceAffector (sf::Vector2f acceleration)
 Constructor.
virtual void Affect (Particle &particle, float dt)
 Affects particles.
void SetAcceleration (sf::Vector2f acceleration)
 Sets the linear acceleration applied to the particles.
sf::Vector2f GetAcceleration () const
 Returns the linear acceleration applied to the particles (in degrees).

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

virtual void thor::ForceAffector::Affect ( Particle particle,
float  dt 
) [virtual]

Affects particles.

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

Implements thor::Affector.

static Ptr thor::ForceAffector::Create ( sf::Vector2f  acceleration) [static]

Creates an affector that accelerates particles continuously.

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


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