#### Archived

This topic is now archived and is closed to further replies.

# AABB / OBB intersection

This topic is 5736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I want to test for intersection between an zero-centered, axis-aligned and a normal oriented box. Is there a link to good code for doing this? With google.com I only found routines for intersection tests between OBBs and I do not want to use those, because I think, to use one zero-centered AABB is faster than to test between two OBBs. Thanks!

##### Share on other sites
An AABB-OBB test is identical to an OBB-OBB test, in the
sense that you have to test exactly the same number of
separating axes.

the AABB-OBB test. In this case, the optimization
consists of hard-coding the tests to take into account
that the orientation axes for the AABB are known, i.e.
you have (1,0,0), (0,1,0) and (0,0,1) as the axes for
the AABB.

In the various dot and cross products you do with these
axes, two of the terms can be removed as they are
multiplications with zero. For the remaining term,
you don''t have to multiply (as it''s a multiplication
with ''1'').

It''s not very difficult to do this optimization, it''s
just a little tedious. Try it.

Christer Ericson
Sony Computer Entertainment, Santa Monica

##### Share on other sites
Hello Christer,

thank you for the advice, but I have already found another way.
Now I am testing where the planes of the OBB are situated. If the parallele planes are on the opposite sides or if one of these two planes intersects the AABB, then both boxes are intersecting.

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633701
• Total Posts
3013431
×