边界框和矩形有什么区别?
这个问题专门针对 Unity 3D 的 Bounds和 Rect类,但我对一般答案更感兴趣。
具体来说:
最佳答案
Which is better on performance?
无关。它们在 2D 中是相同的,在 3D 中它们具有不同的含义/用途。
Is a Bounding Box just a 3D Rectangle?
没有 3D 矩形这样的东西。你说的是一个盒子。边界框是一个大到足以包含实体/模型的所有可碰撞部分的框。
When should I prefer one over the other?
无关紧要,见第一段。
Are they interchangeable terms, and if so, why does Unity 3D have separate classes for them?
再次,2D 与 3D。
Any other knowledge you can bestow would be greatly appreciated!
边界框的存在是为了提高碰撞检测的性能。如果两个物体的边界框不相交,则无需进一步处理它们的任何碰撞器或在 2D 中执行像素完美相交测试。边界框允许碰撞检测算法快速丢弃任何有保证的非碰撞体。
关于unity3d - 边界框与矩形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26958700/