Jump to content
  • Advertisement

Archived

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

Lightrocker

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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.

So, start with the OBB-OBB test, then optimize it for
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!