Пример #1
0
        public bool KillParticle(int i)
        {
            if (Particles[i].Lifetime < Particles[i].Lifespan)
            {
                return(false);
            }

            PhysicsObj.RemovePartFromShadowCells(Parts[i]);

            // added -- couldn't find where this was done in original, but this links to PartStorage,
            // which persists even though Parts[i] is nulled below, and is reused for BirthratePerSec emitters.
            // for BirthRatePerSec moving particles, Pos needs to be reset for each reused PartStorage
            Parts[i].Pos.Clear();

            Parts[i] = null;
            NumParticles--;

            // acviewer custom
            if (RenderBatch != null)
            {
                RenderBatch.DestroyParticle(this, i);
            }

            return(true);
        }
Пример #2
0
        public bool KillParticle(int i)
        {
            if (Particles[i].Lifetime < Particles[i].Lifespan)
            {
                return(false);
            }

            PhysicsObj.RemovePartFromShadowCells(Parts[i]);
            Parts[i] = null;
            NumParticles--;
            return(true);
        }