[ODE] Collision Response -- Simple Math Problem

Mohammad Bilal prettyh8machine at mail.com
Mon May 5 09:45:02 2003


Ok this is what I have:

- A list of triangles the sphere (around the camera) is touching with,
- The direction camera is lookin towards,
- The center of the sphere (location of the camera)

Now this is what Im doing when Tri is a triangle:

- Normal = Tri.Normal()
- d = -Normal.dot(Tri[0])
- D = Normal.dot(SphereCenter) + d
- Offset = N * (D + RadiusOfSphere)		
- SphereCenter = SphereCenter - Offset

The above math/code I got from gametutorials.com since my Math is very weak. This seems to work perfectly fine, except that somehow the Source - Offset gives a little bounce effect i.e. you seem to bounce off the collided plane a little which is very annoying. It seems you get too close to the collision plane (never penetrates it though) and then you get pushed as a collision response -- a very little bounce) and if you're moving between a door/hole and somehow gets stuck with some edge of the hole and you keep pressing forward, there's a never ending forward and bounce motion. Same thing happens when your imaginary sphere somehow collides with two planes (like an edge of two walls) etc.

I double-checked that Im not rendering before checking the collision and this isnt happening.

I hope you guys get the problem but in short, if I have a list of triangles Im colliding with, how do I simulate a perfect collision response (no bounce).

Please help me.
Thanks,
Bilal

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup