我怎样才能在旋转矩形进行碰撞检测?矩形

2023-09-10 23:18:52 作者:作业你个小婊砸

好吧,我想编写一个程序,能告诉我,如果在一个30×矩形的任何点旋转到140度旋转到200度另一个30×矩形内。

Okay, I'm trying to write a program that could tell me if any points in a 30x100 rectangle rotated to 140 degrees are inside another 30x100 rectangle rotated to 200 degrees.

说实话,我甚至不知道从哪里开始。我想过做正常的计算,然后再重新转动他们,但比他们仍然不会匹配。

Honestly, I don't even know where to start. I thought about re-rotating them before doing normal calculations, but than they still wouldn't match up.

我怎样才能做到这一点?

How can I do this?

推荐答案

谷歌提供的 2D旋转矩形碰撞在GameDev.net 。