Collision Resolution

Posted by CiscoIPPhone on Game Development See other posts from Game Development or by CiscoIPPhone
Published on 2010-11-24T15:22:44Z Indexed on 2011/01/08 7:59 UTC
Read the original article Hit count: 315

Filed under:

I know quite well how to check for collisions, but I don't know how to handle the collision in a good way.

Simplified, if two objects collide I use some calculations to change the velocity direction. If I don't move the two objects they will still overlap and if the velocity is not big enough they will still collide after next update. This can cause objects to get stuck in each other.

But what if I try to move the two objects so they do not overlap. This sounds like a good idea but I have realised that if there is more than two objects this becomes very complicated. What if I move the two objects and one of them collides with other objects so I have to move them too and they may collide with walls etc.

I have a top down 2D game in mind but I don't think that has much to do with it. How are collisions usually handled?

This question is asked on behalf of Wooh

© Game Development or respective owner

Related posts about collision-detection