开发者

Help with Triangle collision detection in Obj-C

开发者 https://www.devze.com 2023-01-05 15:43 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消