Jump to content
  • Advertisement
Sign in to follow this  
johnson56k

collisions with AABB and AA-right triangle

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

im trying to understand this but i think i have reached my mental limits. basically i am trying to understand how to implement separating axis theorem like in this example: http://www.harveycartel.org/metanet/tutorials/tutorialA.html#section2 If I am only testing axis aligned boxes with axis aligned right triangles then this must be easily computed no? There must be an easy way to do this besides calculating dot products etc and doing so many multiplies.

Share this post


Link to post
Share on other sites
Advertisement
I dont think you have to worry about efficiency, but yeah, there are optimisations you can perform.

for AABB vs axis aligned triangles, you'll have 3 axes of separation. (1, 0), (0, 1) and the direction perpendicular to your slope.

the first two axes are straight forward and you wont need dot products (simply consider the bounding box around your triangle).

The third axis, you can pre-compute some values (axis direction, min-max) for the triangle and store them as the triangle never changes. For the box, just apply the normal projection algo and you're set.

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!