更快的相交测试(AABB-AABB 或 AABB-三角形)

发布于 2025-01-08 10:23:50 字数 81 浏览 4 评论 0原文

哪种交叉测试通常更快?一个与另一个轴对齐的边界框?或者带有三角形的轴对齐边界框。

我假设 AABB-AABB 但我听到了不同的意见。

Which intersection test is generally faster? An axis-aligned bounding box with another? Or an axis-aligned bounding box with a triangle.

I assumed AABB-AABB but I have heard mixed opinions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风柔一江水 2025-01-15 10:23:50

AABB-AABB 测试可以在任何标准 CPU 上使用(最多)六次比较和六次条件跳转来执行。你能用三角形和 AABB 做到这一点吗?请参阅此问题以了解问题的复杂性。

当然,如果您的硬件针对三角形碰撞测试进行了优化,则情况可能会有所不同。但在一般情况下,测试边界框总是比其他任何事情都要快。

An AABB-AABB test can be carried out using (at most) six compares and six conditional jumps on any standard CPU. Can you do that with a triangle and an AABB? See this question to get an idea of the problem's complexity.

Of course, if your hardware is optimized for collision-testing of triangles, this might be different. But in the general case, testing bounding boxes is always faster than about anything else.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文