March 2017
Intermediate to advanced
480 pages
11h 3m
English
Like triangle to AABB, testing a triangle and an Oriented Bounding Box (OBB) is done using the SAT. In fact, the only difference in the actual test is the rotation frame of the bounding box.
We already have the GetInterval support function written for both the OBB and the Triangle. We just need to write the OverlapOnAxis support function and the actual SAT test.
Follow these steps to check if a triangle and an OBB intersect:
OverlapOnAxis and TriangleOBB in Geometry3D.h:bool OverlapOnAxis(const OBB& obb, const Triangle& triangle, const vec3& axis); bool TriangleOBB(const Triangle& t, const OBB& o);
Geometry3D.h:#define OBBTriangle(o, t) \ TriangleOBB(t, ...
Read now
Unlock full access