5

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.

Rob Hruska
  • 118,520
  • 32
  • 167
  • 192

1 Answers1

3

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.

Community
  • 1
  • 1
krlmlr
  • 25,056
  • 14
  • 120
  • 217