1
\$\begingroup\$

By "going full AABB" I mean using only AABBs for all of your objects (both dynamic and static), with dynamic objects colliding both with each other and static objects. In what specific ways does this simplify physics calculations? Are there any special techniques that require a world made entirely of AABBs? Some way to, say, remove the need for TOI-ordering (or similar) by taking advantage of that fact that all objects are AABBs?

In particular I'm looking for specific large-scale benefits, not just small things like collision detection being slightly faster. There seem to be quite a few games that use only AABBs, like Minecraft for example, so there must be a significant benefit to it or they wouldn't be doing it. Only thing I can think of is getting to do position/velocity corrections per-axis, though I'm not sure how one would exploit that to its full potential.

\$\endgroup\$
  • \$\begingroup\$ Quake 3 uses these. They're faster and easier to calculate. But you get weird artifacts, like characters are effectively wider and easier to hit when shooting diagonally across the grid. Also, Q3 characters can stand on top of one another. \$\endgroup\$ – Almo Jun 7 '18 at 19:22
  • \$\begingroup\$ I would think that sphere collisions would be the easiest to check for exclusion, then switch to some better method once you know the objects are at least close, would be the way to go. The problem AABB is that they can be a really bad approximation to an object's geometry for certain shapes (like long skinny objects that are "diagonal" to your axes) so you're often not better off over spheres. \$\endgroup\$ – markspace Jun 8 '18 at 5:04
2
\$\begingroup\$

The main advantage is speed.

Testing whether 2 AABB collide with each other requires 2 compares per axis. The test itself is really simple (box1.maxX >= box2.minX && box2.maxX >= box1.minX) however it's likely that a copy-paste-edit error gets made there.

Testing against a ray is also rather simple.

However it doesn't solve the O(n²) problem of testing each object to every other object by itself. But having fast collision check alleviates that issue somewhat, letting you some more objects being collision checked at the cost of having less precise collision.

There are ways to fix these shortcomings, the O(n²) ness can be fixed by a broadphase collision that eliminates large swaths of objects that will never collide with each other and the precision of the collision can be fixed by using a more precise collision system after testing the AABB.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.