I am trying to figure out how to do mesh to mesh collisions. Is there a way to do it though panda3d? It does not matter how slow but i need to do it. It looks like i would have to peel the geom readers and check each tri vs each tri. Its good that the collision models are so low poly and i only have to do this kind of collision only when i build building which is rare i can afford to spend some time on this. The buildings are lowpoly so it should not be that many checks.
afaik panda doesnt feature mesh2mesh collision. but i think ODE can.
in case you manually write it. can brute-force test each triangle against all others, but thats slow like i dont know what. you might want to use octree’s to eliminate most unneccessary checks
If everything else fails and you have to code it yourself then here are two pointers to algorithms (I hope you don’t need to go this way):
-
GJK (Gilbert-Johnson-Keerthi) is a popular algorithm for collision detection of convex objects. Popular means there are lots of implementations on the web (with varying robustness).
-
If it is pure triangle-triangle collision you are looking then perhaps this paper will help:
http://knight.cis.temple.edu/~lakaemper/courses/cis350_2004/etc/moeller_triangle.pdf
Both will be very slow, since these algorithms are only for narrow-phase collision detection.
enn0x