I haven't taken any advanced math courses or anything (I'm still in high schoo开发者_JAVA技巧l) and I just don't really understand all the triangle collision systems online.
I have two triangular objects in a 2D space. How should I write Obj-C code so that a collision/intersection between the two can be detected? I'm stumped.
Perhaps one of these techniques will help:
http://www.blackpawn.com/texts/pointinpoly/default.html
Basically, to simplify things you could start by just trying to figure out if each of the three points of a triangle is inside the other one - since having a corner from one or the other enter the other one is the only way they can be overlapping.
精彩评论