Page 1 of 1

How to enable permanent collision detection?

Posted: Fri May 04, 2012 7:47 am
by Ichigo
Hello there,

As you all may know, the chipmunk doesn't detect all the time the collisions. In my case, i have bodys with great velocity. And what happens sometimes is that a non-static body passes through a static body.

How can i solve this? Is there a right way to do it? Or do i need to change game physics because of that?

Regards,
ichigo.

Re: How to enable permanent collision detection?

Posted: Fri May 04, 2012 9:28 am
by slembcke
What you are looking for is often called swept collisions, continuous collision detection or just CCD. Chipmunk doesn't support that currently, and it's not terribly high on my todo list as most games don't really seem to need CCD.

If your fast moving objects are small, such as bullets you can use raycasts instead of objects. Box2D supports CCD if it's a must have feature.

Re: How to enable permanent collision detection?

Posted: Fri May 04, 2012 10:19 am
by Ichigo
Unfortunatelly my objects are bigger than bullets. Anyway, i will see what i can do.

Thanks for you answer.

Re: How to enable permanent collision detection?

Posted: Fri May 04, 2012 10:56 am
by slembcke
Your other option is to use smaller time steps, although it uses more CPU time.

Re: How to enable permanent collision detection?

Posted: Fri May 04, 2012 11:11 am
by Ichigo
Well, if i do that, the update loop would be wrong. I would not see the bodys update at the right time, i believe.

Re: How to enable permanent collision detection?

Posted: Fri May 04, 2012 11:34 am
by slembcke
Actually I would recommend keeping your updates and rendering separate anyway. This is a pretty good article on how to do that:
http://gafferongames.com/game-physics/f ... -timestep/

Re: How to enable permanent collision detection?

Posted: Fri May 04, 2012 11:58 am
by Ichigo
Thank you! =)