Jump to content
  • Advertisement
Sign in to follow this  

bouncing balls of love

This topic is 5062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys. Suppose you have two circles, with radius R1, R2 Position (x1,y1),(x2,y2) velocity (xv1,yv1),(xv2,yv2) ...and they collide. What will happen to their velocities after the collision?

Share this post

Link to post
Share on other sites
ok, dodgy puns aside, here is the process to calculate the change of momentum between two colliding objects.

Assuming the objects do not undergo rotational movement (infinite inertia), the equation for calculating the collision impulse is

j = (-(1 + e) Vab.Nab) / (1/ma + 1/mb);

the change of momentum induced by the impulse will be

Va -= (j * (1 / ma)) * Nab;
Vb += (j * (1 / mb)) * Nab;

va and vb are the velocities on objects A and B at the point of contact. Because there is no rotational movement, the va and vb are ust the linear velocities of objects A and B.

Vab is the relative velocity at the point of collision. vab = Vb - Va.
Nab is the contact normal, going from object A towards object B.

note that if (j < 0), equivalent to (Vab.Nab < 0) then the objects are separating, and no collision impulse should be applied.

for the demonstration of the coalculation of the collision impulse, refer to Chris Hecker's physics Docs.

I've got some sample code too somewhere.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!