Archived

This topic is now archived and is closed to further replies.

normalme

constant sliding plane pitfall (common pitfall?)

Recommended Posts

I''m now working with ellipsoids, a step up from bounding spheres, and i keep running into my old problem: ill slide 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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think if you set your ellipsoid back by _just_ the amount required, you''ll eventually fall through like you explained.
You should try adding an additional offset to keep this from happening, something like 0.0002f.

Share this post


Link to post
Share on other sites
realy? thanks
ok ill try that, but to others, feel free to post additional solutions, i write back in like 15 minutes er less, on if this helped er not

Share this post


Link to post
Share on other sites
you can also add a small impulse towards the plane normal (add a positive velocity component towards the plane normal), so the ellipsoid bounces just a little upwards instead of just sliding. If you force the ellipsoid to offset above the plane, the ellpsoid might end up intersecting another triangle, so the coll det can possibly fail with that triangle. Try with sharp concave angles (like a pitfall). Changing the velocity should be safer.

Personnaly, I catch the case when the ellipsoid intersects the triangle (that's when the swept test col det fails), just to be on the safe side. When it intersects, I return a negative distance, and use that in the response to move the ellipsoid/sphere away from the plane.

I'm still working on that to make it totally stable.

I'm also using another method, by not moving the ellipsoid onto the plane, but slightly before (like 99% of the distance it should move to be on the exact plane). This or another equivalent method where you would recompute the time of collision with a plane slightly offset from the collision plane. Using an offset plane, then it does not depend of the sphere/ellipsoid velocity but rather, it fattens the world with a constant offset value.

I use all the methods together, and I'll probably try to have a system when there should never be any overlaps between triangles and ellipsoids/circles, until the minimum amount of fudges is reached.

I also use a limited number of collision iterations per frame (10), so when the number of max iterations is reached, I set the velocity to 0 and don't move the sphere, so it is not forced inside triangles when I cut the collision loop short.

[edited by - oliii on January 6, 2004 7:11:09 AM]

Share this post


Link to post
Share on other sites
ye, oliii i was going to try expanding on my code that catches an embedded ellipsoid in the plane, and then move it backwards some, i thought i was doing that, but i could add more code to deal with overlapping at the instance of it happening, instead of waiting until the end of my iteration(i think something gets lost in the middle of the mix)

and but anyways Anonymous Poster''s resolve only half works. when you hit the wall at like a 90 degree angle(prettymuch head on) you slide like it should but it still "pulses" into the wall about every 1.5 seconds, but it corrects itself(thats where i first got the idea to deal with an embedded ellipsoid on the spot)

and when you hit the wall at like a 30 degree angle(150 degree angle) you bounce some,
i need more help

Share this post


Link to post
Share on other sites
trying to deal with an embeded ellipsoid on the spot made it worse. next up, adding a slight impulse before running the body of my collision routine(for the triangle)

[edited by - normalme on January 6, 2004 8:32:41 AM]

Share this post


Link to post
Share on other sites
sure did, and since your such a help to just about everyone on this here board ill give you the code if you want, it works nice

[edited by - normalme on January 7, 2004 10:02:27 AM]

Share this post


Link to post
Share on other sites
when i got home today, i went to bed, i just got up, ill have it in your email by early tommorow morning,

but ive found a bug that im not sure if its the ellipsoid's function's fault, or my gathering potential colliding polygon's routine's fault.

on the larger terrains that i make in 3ds max 5(heightfield terrains) it acts like its not finding anY colliding polygons and just goes strait through the floor.

but on small terreains it finds the floor just fine.

but i made a large file of large boxes(mock buildings) i had like 50 or so around like an 8th of a mile radius, it worked fine,

i think its my polygon gathering processing thats the fault.






oh, and i dont incorporate gravity yet, i think if i did i'd be sliding downhill when standing on slopes, ill have to find a way around that yet.

[edited by - normalme on January 7, 2004 12:32:55 AM]

Share this post


Link to post
Share on other sites
im taking a while to debug this problem,

but so far i think that its not the ellipsoid function''s fault,

if i sent you just the ellipsoid function and relating functions would you be able to decipher it?

Share this post


Link to post
Share on other sites