Sliding collision theory

BlitzMax Forums/BlitzMax Programming/Sliding collision theory

JoshK(Posted 2006) [#1]
I wasn't sure where to create this topic, but I have a question about sliding collision.

I have a pretty good sliding collision routine for convex hulls, but I run into problems when an object gets "wedged into a corner" between multiple objects.

It seems that no matter what you do, the individual object collisions will keep bouncing the object back and forth, creating an infinite collision calculation. If you limit the number of iterations, then the objects can pass through each other, or they get very jittery.

Any ideas?


Beaker(Posted 2006) [#2]
What about cacheing the last few collisions and averaging the normal to move the object away?


JoshK(Posted 2006) [#3]
Doesn't solve it. This is a difficult problem, because the first collision result can cause a collision with another object, the result of which collides back with the first object. If I let it run, I have an infinite loop. If I cut it short, the objects jerks or passes through the solid.


Gabriel(Posted 2006) [#4]
Couldn't you "predict" such double collisions? Each collision update, you update the object one frame ahead of where you actually render it. Then if you see the double-bounce coming, call a collision on the frame you're rendering, not permitting the double-bounce to ever occur.


JoshK(Posted 2006) [#5]
I'm not sure what you're talking about, but the problem seems to come down to multiple objects causing an infinite loop of "micro" collisions. The routine can't figure out the final position, because the collision results keep moving into other objects.


Dreamora(Posted 2006) [#6]
Don't think that in the rare case where it really gets locked in between (which should be really rare as it needs to hit all surfaces at the same time in swept collision test), there is anything "normal" you could do.

One thing that comes up to my mind is that you "pulse" the object ie extend its collision polygons from the center and calculate penetration forces (forces of the material that push the now "beeing in" object out of the surfa) basing on that, that could help.