public void TestCalculateSeparatingVelocityWithOneObject() { var p = new Particle { Position = new Vector2D(0, 0), Velocity = new Vector2D(1, 0), Mass = 1 }; var contact = new ParticleContact(p, null, 0.5, 1, new Vector2D(-1, 0)); Assert.AreEqual(-1, contact.CalculateSeparatingVelocity()); }
public void TestCalculateSeparatingVelocityWithTwoObject() { var p = new List <Particle> { new Particle { Position = new Vector2D(0, 0), Velocity = new Vector2D(1, 0), Mass = 1 }, new Particle { Position = new Vector2D(2, 0), Velocity = new Vector2D(0, 0), Mass = 1 } }; var contact = new ParticleContact(p[0], p[1], 0.5, 1, new Vector2D(-1, 0)); Assert.AreEqual(-1, contact.CalculateSeparatingVelocity()); }