C4 Engine Terathon Software C4 Engine API Documentation

• Effect Manager

API Links
Developer Links

ParticleSystem::AnimateParticles

Defined in:  C4Particles.h
Called once per frame to update the positions of the particles.
Prototype

virtual bool AnimateParticles(void);

Description
The AnimateParticles function can be overridden by subclasses of the ParticleSystem class so that they can implement custom particle motion. The AnimateParticles function can update any properties of the particles in the system, including position, color, and radius. Particles may also be created or destroyed inside this function. The AnimateParticles function should return true if there are still particles in the system upon returning and should return false if all of the particles have been destroyed. If the AnimateParticles function returns false and the kParticleSystemSelfDestruct flag is set, then the particle effect is deleted immediately after AnimateParticles returns.

The default implementation of the AnimateParticles function moves each particle according to its current velocity. It also decreases each particle's life time by the amount of time passed since the previous frame and destroys any particle whose life time reaches zero.
See Also
Particle

ParticleSystem::GetFirstParticle

ParticleSystem::GetLastParticle

ParticleSystem::AddParticle

ParticleSystem::AddFarthestParticle

ParticleSystem::FreeParticle

ParticleSystem::SetParticleSystemFlags