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); } }
public void Update(float particleAge, double totalMilliseconds, double elapsedSeconds, Particle2D particle) { var deltaGrav = Vector2.Multiply(Gravity, (float) elapsedSeconds); particle.Affect(ref deltaGrav); }