Archived

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

Eleventy

Polygon-level Collision Detection

Recommended Posts

Does anyone know a FAST method of polygon-level collision detection between a sphere and a mesh? I need to know if the two objects collide, along with the directional hit on the two objects so that they both realistically bounce off (or slide past) each other, such as the normal of the velocity of the sphere traveling vs. the normal of the plane of which it hits. (Picture a ball bouncing off the side of a pyramid in a realistic fassion.) Currently, I have a work-in-progress collision detection method that actually works, but goes VERY SLOW. Most of the slowdown is due to having to test the edges and the verticies for collision as well as all the faces of a mesh, since Direct3D only includes a function that checks if a ray intersects with the face of a triangle, leaving me to implement the collision tests for each edge and vertex on my own. For each edge in a mesh, the function currently uses about 10 square root operations, and that''s just for one edge! Multiply that by 3 and by the number of faces in the mesh, these operations quickly pile up! I already know that I could optimize everything by adding BSP trees, but I still think 10 square root operations per edge is a little much. Any ideas, articles anyone can post? I''ve already looked in the articles section and I don''t see anything in regard to polygon accurate collision detection (everything uses sphere-sphere).

Share this post


Link to post
Share on other sites
Wow... thanks for the link! It really helps! No wonder my method was so much slower; instead of doing the method his way, I was doing everything in trigonometry in the places of his much simpler methods! Once again, thanks!

Share this post


Link to post
Share on other sites