# collisions with AABB and AA-right triangle

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

## 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 on other sites
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.

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

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

• Total Topics
633697
• Total Posts
3013406
×