Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently developing a small 3D impulse-based physic engine for a CS project. It uses GJK for collision detection and is kind of stable at the moment. Nevertheless, I'm not satisfied with my collision response as rigid bodies appear to gain more and more momentum with each bounce, although only under some configurations.

I use Newton’s Law of Restitution (pictured immediately below) for instantaneous collisions with no friction. I checked this formula again and again, and I also checked if the magnitude of the contact normal is 1, and all seems fine. The direction of the bounce and the induced rotation are convincing but the impulse is just sometimes too strong. Newton’s law of restitution

I think my problem may lie within the impulse application part; in my mind, the impulse is the force necessary to separate two touching points of two bodies plus a certain magnitude depending on the coefficient of restitution (0.7 in my tests). I compute an impulse for each detected contact point and apply it at the contact position.

For example if a cube falls right to the floor, there will be 4 impulses, each one at a vertex of the bottom face of the cube. For each of the four contacts, I do something like this:

J = computeImpulse(contact)
A.applyImpulse(J, contact.pos)
B.applyImpulse(-J, contact.pos)

I'm a bit confused. Is this the correct approach, or should I apply half of the impulse to each body? Or, should I rather apply a fraction of the impulse depending of the mass of the bodies? Or, is the problem just somewhere else (e.g., in the formula)?

I don't know if someone has an easy answer for me, as it's a rather specific problem, but thank you for your help. :)

share|improve this question
Damn, I am so glad for my previous mechanics exam I only had to know that resitution = speed of separation/speed of approach :) – The Communist Duck Jun 18 '11 at 14:21
If something is incrementing or compounding unexpectedly, it could be related to a variable not being localized properly (e.g., its scope is a bit too global and it's not being reset at the right place in your code). It may be beneficial to check into this type of cause to at least rule this out. – Randolf Richardson Jun 18 '11 at 14:29
up vote 5 down vote accepted

As you already suggested, you have to take the mass of the objects into account to calculate the change of velocity caused by the impulse. Namely, divide the impulse by the mass for each object.

You can find this and much more information in this paper "Impulse-based Dynamic Simulation of Rigid Body Systems" from Brian Vincent Mirtich.

Page 60 shows it in detail:

p       -> impulse
delta_v -> change of velocity caused by the impulse
m       -> mass

     p(t)       = m * delta_v(t)
so:  delta_v(t) = p(t) / m

Here is another paper about it called "A Real-time Capable Impulse-based Collision Response Algorithm for Rigid Body Dynamics" from Florian Schornbaum. You can find that calculation at Page 23.

share|improve this answer
Thank you for those two resources :) – merwaaan Jun 19 '11 at 12:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.