PDA

View Full Version : constant sliding plane headache


typer
2004.01.07, 12:34 AM
:mad: I'm now working with ellipsoids, a step up from bounding spheres, and i keep running into my old problem:

ill slide along my wall just fine for a time peroid for about 1 to 5 seconds, inluding around corners, and then ill slip through the wall.

When I implement the very basics of collision detection, being just stopping when too close, that allways works always, 100%, even with my ellipsoid radius.

Then, to slide, i push back my position(my position with the velocity vector added to it)i push back my position by the amount of space needed to keep my radius clear of the wall in the direction of my collision normal.

and then i always seep into the wall at some point.

any ideas?

has this happened to you?

codemattic
2004.01.07, 02:08 AM
has this happened to you?
All the time and it drove me nuts. When you push back, you cant move the object back to where its just touching the wall - you have to add a little extra fudge factor - floating point isnt exact you know and eventually little rounding errors add up and all of a sudden you are through the wall. Also, in your collision detection before you check if your object (taking into account its velocity) is going to intersect a wall at some point in the next frame - first check to see if it is *already* intersecting a wall and if so first move it back and register a collision.

I have it working almost perfectly with bounding spheres (havent gotten to ellipsoids yet). The rub is when you get into an acute corner where your object is touching two walls at once - it can get stuck since the object being pushed back from one wall gets it stuck in the other. So I have a limit on how many wall collisions can happen per frame. But getting stuck in an acute corner is still a bit wobbly.

hth,
Codemattic

AnotherJake
2004.01.07, 02:15 AM
That sounds real tough to reply to without knowing more about what you're doing. The only two things that I can take a wild shot at are: I don't usually do collision calcs based on the original collision position (if I read that right), I do it every frame once detected. The other thing that sticks out is: If your collision method is correct, there might be a math error and I'd guess maybe you're pushing floating point limits too quickly or overflowing some fixed point variable when it should be a float or something. But then again, pure guess. Need more info.