# Tri-Tri collision

This topic is 2586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm trying to implement triangle-triangle collision, for arbitrary collisions.
I figured that if two triangles intersect, then one of the edges of one of the triangles MUST pass through the other triangle, so at the moment I test for 6 ray-triangle intersections, and return true once a collision is found, (so I thought that in the worst case, 6 checks are performed, in the best case 1 check is performed, so on average 3.5 ray-triangle checks per test is expected performance-wise).

My question is, are there any faster methods?

##### Share on other sites

I'm trying to implement triangle-triangle collision, for arbitrary collisions.
I figured that if two triangles intersect, then one of the edges of one of the triangles MUST pass through the other triangle, so at the moment I test for 6 ray-triangle intersections, and return true once a collision is found, (so I thought that in the worst case, 6 checks are performed, in the best case 1 check is performed, so on average 3.5 ray-triangle checks per test is expected performance-wise).

My question is, are there any faster methods?

What about the case where one triangle is entirely contained within the other and both have been projected onto a 2d plane?

##### Share on other sites
Oh, I forgot to consider the triangles being coplanar. I could add some ray-ray intersection tests, for the edges of the triangles, and a point-in-triangle for one vertex from each triangle

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 9
• ### Forum Statistics

• Total Topics
634085
• Total Posts
3015407
×