You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the overlaps function relies on the volume of the intersection of the two AABBs, which is 0 in this case, the assert fails.
This can happen in practice, if you have an axis aligned triangle, create its AABB and use it to "early out" of an intersection test.
One solution could be to only check if the intersection AABB is valid.
/// Returns true if the two AABBs have any overlap.booloverlaps(AABB b)
{
b.intersection(*this);
return b.valid();
}
However, this would return true for "touching" AABBs. Depending on the definition of "overlaps", this might be a problem.
Would love to hear your thoughts on that.
The text was updated successfully, but these errors were encountered:
The AABB::overlaps function misses overlaps when one of the AABBs is 0 in one dimension.
Example:
Since the
overlaps
function relies on the volume of the intersection of the two AABBs, which is 0 in this case, the assert fails.This can happen in practice, if you have an axis aligned triangle, create its AABB and use it to "early out" of an intersection test.
One solution could be to only check if the intersection AABB is valid.
However, this would return true for "touching" AABBs. Depending on the definition of "overlaps", this might be a problem.
Would love to hear your thoughts on that.
The text was updated successfully, but these errors were encountered: