二维多边形碰撞检测 [英] 2D Polygon Collision Detection

查看:73
本文介绍了二维多边形碰撞检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道简单方法来检查两个多边形,尤其是矩形是否碰撞?我发现了一种简单的方法,只需检查两个矩形上的任何线条是否发生碰撞,即可查看两个对象是否接触,但是如果一个多边形位于另一个多边形中,则该方法将无效。有谁知道一种更有效的方法或者只是一种有效的方法?

Does anyone know a simple way to check if two polygons, especially rectangles, are colliding? I found a simple way to see if two are touching by just checking if any lines on the two rectangles are colliding, but this will not work if one polygon is in another. Does anyone know a more efficient way to do this or just a way that works?

另外,有人可以给我一个公式或类似的方法,而不仅仅是您对这个问题的想法。

Also, can someone please give me a formula for it or something like that and not just your thoughts on the subject.

谢谢

推荐答案

分离轴定理。 此处

它快速,优雅,健壮,不太难并且有很多资源。

It's quick, elegant, robust, not too hard, and has lots of resources.

这篇关于二维多边形碰撞检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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