Collision Detection... Again...

Started by
0 comments, last by Motorherp 17 years, 8 months ago
Lets assume I have two arbitrary triangle meshes and they are colliding. I know exactly which of their triangles are intersecting. From here, is there a way to get the information needed for a collision response? (i.e. collision normals, penetration depth, contact points)
Advertisement
If two triangles are intersecting then at least an edge or more from one tri will always be intersecting the face of the other. So the simplest aproach would be to intersect all the edges from tri A with the face of tri B and then all the edges of tri B with the face of tri A. This can be done by first intersecting the each edge with the face plane and taking the resultant point and seeing if it falls inside the triangle or not. Do a google for some algorithms for this, there's plenty out there. This gives you your collision point and the normal will be that of the tri face.

Unfortunately as far as I know there is no nice way to determine the penetration axis and depth for minimum seperation displacement for arbitrary tri meshes. If absolute accuracy is a must then you'd be better using predictive collision routines so that penetration depth no longer becomes an issue. Else I'd put a restriction on your objects that they must be composed on convex hulls. You'll then be able to use techniques such as seperating axis theorem which will give you all the info you need and are much faster to perform also.
[size="1"] [size="4"]:: SHMUP-DEV ::

This topic is closed to new replies.

Advertisement