Exemplo n.º 1
0
        public void Update(float particleAge, double totalMilliseconds, double elapsedSeconds, Particle2D particle)
        {
            Vector2 distance = Vector2.Subtract(Position, particle.Position);

            if (distance.LengthSquared() < Radius * Radius)
            {
                Vector2 force = Vector2.Normalize(distance);
                force = Vector2.Multiply(force, Strength);
                force = Vector2.Multiply(force, (float) elapsedSeconds);

                particle.Affect(ref force);
            }
        }
Exemplo n.º 2
0
 public void Update(float particleAge, double totalMilliseconds, double elapsedSeconds,
     Particle2D particle)
 {
     var deltaGrav = Vector2.Multiply(Gravity, (float) elapsedSeconds);
     particle.Affect(ref deltaGrav);
 }