C4 Engine
C4 Engine API Documentation

ParticleSystem::AnimateParticles

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

virtual void 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 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.

If there are no particles in the particle system when the AnimateParticles function returns and the kParticleSystemSelfDestruct flag is set, then the particle system is deleted immediately after the AnimateParticles function returns.
See Also

Particle

ParticleSystem::GetFirstParticle

ParticleSystem::GetLastParticle

ParticleSystem::AddParticle

ParticleSystem::AddFarthestParticle

ParticleSystem::FreeParticle

ParticleSystem::SetParticleSystemFlags