Page 1 of 1

Swept collisions

Posted: Tue Aug 06, 2013 6:03 am
by 66speeder66
I am working on my own project, a platformer game with Chipmunk physics library. I have added fast moving objects like boollets on scene which are bouncing. Because these objects are moving so fast, they often pass other objects on scene. I really like your library, but I came to the point when I need system which allows tunneling to detect collission.
So my quastion is, do you have in plan something like that in near feature?

Re: Swept collisions

Posted: Tue Aug 06, 2013 7:15 am
by OandO
If it's just small things like bullets that are a problem, try doing a segment query ahead of the bullet for the frame. It won't perfectly detect anything that the full area of the bullet will collide with, but it will tell you (With reasonable accuracy from my point of view) what the bullet flew straight into.

Re: Swept collisions

Posted: Tue Aug 06, 2013 8:23 am
by slembcke
So bullets are definitely problematic without swept collisions. On the other hand, I almost always implement them purely using segment queries anyway.

Swept collisions add a *lot* of complexity to the physics and that generally also means a pretty big performance hit. I also haven't been able to figure out a way around a lot of the thresholds everybody seems to do when doing swept collisions. I've yet to find a swept collision solution that I'm terribly happy with the tradeoffs.