Reactor.PointParticleSystem.RetireActiveParticles C# (CSharp) Method

RetireActiveParticles() private method

Helper for checking when active particles have reached the end of their life. It moves old particles from the active area of the queue to the retired section.
private RetireActiveParticles ( ) : void
return void
        void RetireActiveParticles()
        {
            float particleDuration = (float)settings.Duration.TotalSeconds;

            while (firstActiveParticle != firstNewParticle)
            {
                // Is this particle old enough to retire?
                float particleAge = currentTime - particles[firstActiveParticle].Time;

                if (particleAge < particleDuration)
                    break;

                // Remember the time at which we retired this particle.
                particles[firstActiveParticle].Time = drawCounter;

                // Move the particle from the active to the retired queue.
                firstActiveParticle++;

                if (firstActiveParticle >= particles.Length)
                    firstActiveParticle = 0;
            }
        }