public Vector3 CalculatePositionVelocityGravity(ColoredParticle particle) { var lifeTime = (CurrentTime - particle.SpawnTime); var ret = particle.StartPosition + particle.StartVelocity * lifeTime + Gravity * lifeTime * lifeTime; return(ret); }
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); } }
public void AddParticle(ColoredParticle particle) { particles.Add(particle); }