示例#1
0
        public Vector3 CalculatePositionVelocityGravity(ColoredParticle particle)
        {
            var lifeTime = (CurrentTime - particle.SpawnTime);
            var ret      = particle.StartPosition
                           + particle.StartVelocity * lifeTime
                           + Gravity * lifeTime * lifeTime;



            return(ret);
        }
示例#2
0
        public void Update(float elapsed)
        {
            if (!emitting)
            {
                return;
            }

            elapsedLeft += elapsed;

            while (elapsedLeft > EmitInterval)
            {
                elapsedLeft -= EmitInterval;
                //TODO: when emitting multiple correct for timing?
                var p = new ColoredParticle();
                InitializeParticle(p);
                p.SpawnTime = effect.CurrentTime;
                effect.AddParticle(p);
            }
        }
示例#3
0
 public void AddParticle(ColoredParticle particle)
 {
     particles.Add(particle);
 }