OBB-OBB detected 'intersected' but It's not

Started by
11 comments, last by Zakwayda 4 years, 6 months ago

Yeah you are right! Anyway they don't describe properly how to calculate that, they say cross each edge of A and B but then what?

Advertisement
47 minutes ago, _WeirdCat_ said:

...they say cross each edge of A and B but then what?

There are different ways to perform the per-axis test once you've computed the axis. For boxes, for example (both oriented and axis-aligned) there are shortcuts for computing the projection of the box onto an axis that don't require processing each vertex individually. You can compute the full projections and test those for intersection, or in some cases you can compute the projected radii and test the sum of the radii against the projected distance between the object centers.

In the code you posted, perhaps the most straightforward (although perhaps not most efficient) way to test against arbitrary axes might be to compute the projection of each shape by projecting all vertices of each shape onto the axis, and then testing the projections for intersection.

This topic is closed to new replies.

Advertisement