我怎样才能在旋转矩形进行碰撞检测? [英] How can I perform Collision Detection on rotated rectangles?

查看:177
本文介绍了我怎样才能在旋转矩形进行碰撞检测?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我想编写一个程序,能告诉我,如果在一个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?

推荐答案

谷歌提供的<一个href="http://www.gamedev.net/page/resources/_/technical/game-programming/2d-rotated-rectangle-collision-r2604"相对=nofollow> 2D旋转矩形碰撞在GameDev.net 。

这篇关于我怎样才能在旋转矩形进行碰撞检测?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆