I hope someone here can help me.
I couldn't find any information on how to do 3D collision detection
with google. I hope someone here can figure out how to do a cylinder
(or sphere, if easier) collision detection with a triangle mesh.
I've organized the world using a special space partitioning tree so
it is very quick (order of N) to find triangles near objects (within
bounds3D) or a line segment. I am able to check if a ray (or line
segment) hits the world mesh. I can get the point of intersection and
the closest triangle that the ray intersects.
My algorithm worked on paper, but fails miserably in the game. Here
is my algorithm:
http://www.rpghorror.com/collision.jpg
It tests three rays going in the direction of the object's
direction. If the left side hits a plane, it moves to the new
position along the wall. It then checks the middle ray with the new
position from the original start position, then adjusts the new
position accordingly. Lastly, it checks the right side with the new
position, then adjusts accordingly. It doesn't work. I hit the wall,
but I slide along the wall way too quickly, and I bounce all over the
place until I'm outside of the wall.
Does anyone know of a good algorithm to handle collision? I need the
objects to be able to slide along walls, walk up or down stairs, and
can move at great speeds without going through walls.
Thanks for any help you can offer.
Regards,
Lo Saeteurn
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|