Example #1
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);
        }
Example #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;
 }