Fades particles out over time. More...
Public Types | |
typedef std::tr1::shared_ptr < FadeOutAffector > | Ptr |
Shared pointer type referring to FadeOutAffector objects. | |
Static Public Member Functions | |
static Ptr | Create (float timeRatio=1.f) |
Creates an affector that decreases the alpha value towards the end of the particle lifetime. | |
Public Member Functions | |
FadeOutAffector (float timeRatio=1.f) | |
Constructor. | |
virtual void | Affect (Particle &particle, float dt) |
Affects particles. | |
void | SetTimeRatio (float timeRatio) |
Sets the time ratio (how long the fade-out time is compared to the particle lifetime). | |
float | GetTimeRatio () const |
Returns the time ratio (how long the fade-out time is compared to the particle lifetime). |
Fades particles out over time.
Affector class that constantly decreases the alpha color value of a particle.
thor::FadeOutAffector::FadeOutAffector | ( | float | timeRatio = 1.f | ) | [explicit] |
Constructor.
timeRatio | How long the fade-out time is in comparison to the total particle lifetime. For example, 1.f means over the whole lifetime, and 0.25f means to fade out the particle only in the last quarter. |
virtual void thor::FadeOutAffector::Affect | ( | Particle & | particle, |
float | dt | ||
) | [virtual] |
Affects particles.
particle | The particle currently being affected. |
dt | Time interval during which particles are affected. |
Implements thor::Affector.
static Ptr thor::FadeOutAffector::Create | ( | float | timeRatio = 1.f | ) | [static] |
Creates an affector that decreases the alpha value towards the end of the particle lifetime.
timeRatio | How long the fade-out time is in comparison to the total particle lifetime. For example, 1.f means over the whole lifetime, and 0.25f means to fade out the particle only in the last quarter. |