Jump to content
  • Advertisement
Sign in to follow this  
tiago dagostini

Rectangle vs AABB intersection

This topic is 3389 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

Hi. I am working on a problem where I have a grid of AABB (in fact CUBES, all same size on all axis) and quads that can be on any orientation. Those quads are not necessarily quads, in fact are rectangles. Those rectangles are at most same size as of the size of the cube, never larger, but sometimes smaller. I have the option of divide the quad in 3 triangles then use the separation axis theorem. But I am hoping I can find a solution that is faster for this situation (since the quads with limited size constrains might help simplify the solution). I've been trying for a while. Tried working with the projection of the quad on each of the 3 axis aligned planes, but it didn't worked. I don need to know WHERE they intersect, only if they DO intersect. Now I come here for help. Has anyone seen any algorithm suited for this task? Thanks for any help you can offer.

Share this post


Link to post
Share on other sites
Advertisement
You can use the separating axis theorem for rectangles too, where the axes you'll need to use are the two axes of the quad, the three axes of the box, and the cross products of all combinations of one axis from the rect, and one axis from the box.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!