private void renderSingle(ParticleEffect effect)
        {
            foreach (var p in effect.Particles)
            {
                if (currentBox >= boxes.Count)
                {
                    createBoxesPool(boxes.Count + 10);
                }

                var box = boxes[currentBox];
                box.Visible     = true;
                box.WorldMatrix = Matrix.Scaling(p.Size * MathHelper.One) * Matrix.Translation(effect.CalculatePosition(p));
                currentBox++;
            }

            for (int i = currentBox; i < boxes.Count; i++)
            {
                boxes[i].Visible = false;
            }
        }
Exemple #2
0
 public CustomEmitter(ParticleEffect effect)
 {
     this.effect = effect;
 }
 public void RenderEffect(ParticleEffect effect)
 {
     RenderEffects(new[] { effect });
 }