Ejemplo n.º 1
0
 private void Create(int type, int number, Firework parent)
 {
     for (var i = 0; i < number; i++)
     {
         Create(type, parent);
     }
 }
Ejemplo n.º 2
0
        public Firework CreateFirework(Firework parent = null)
        {
            var f   = new Firework(Type, MathF.Rand(MinAge, MaxAge), _model);
            var vel = new Vector3();

            if (parent != null)
            {
                f.Position = parent.Position;
                vel       += parent.Velocity;
            }
            else
            {
                f.Position = new Vector3(0, 3.0f, 0);
            }
            vel           += MathF.RandVector(MinVelocity, MaxVelocity);
            f.Velocity     = vel;
            f.Mass         = 1;
            f.Damping      = Damping;
            f.Acceleration = Constants.Gravity;
            f.ClearAccumulator();
            return(f);
        }
Ejemplo n.º 3
0
        private void Create(int type, Firework parent)
        {
            var rule = _rules[type - 1];

            _fireworks.Add(rule.CreateFirework(parent));
        }
Ejemplo n.º 4
0
 public Firework CreateFirework(Firework parent = null) {
     var f = new Firework(Type, MathF.Rand(MinAge, MaxAge), _model);
     var vel = new Vector3();
     if (parent != null) {
         f.Position = parent.Position;
         vel += parent.Velocity;
     } else {
         f.Position = new Vector3(0, 3.0f, 0);
     }
     vel += MathF.RandVector(MinVelocity, MaxVelocity);
     f.Velocity = vel;
     f.Mass = 1;
     f.Damping = Damping;
     f.Acceleration = Constants.Gravity;
     f.ClearAccumulator();
     return f;
 }
Ejemplo n.º 5
0
 private void Create(int type, int number, Firework parent) {
     for (var i = 0; i < number; i++) {
         Create(type, parent);
     }
 }
Ejemplo n.º 6
0
 private void Create(int type, Firework parent) {
     var rule = _rules[type - 1];
     _fireworks.Add(rule.CreateFirework(parent));
 }