Test whether an axis-aligned bounding box intersects a triangle, via the
separating-axis theorem over 13 axes: the 3 box face normals, the triangle
face normal, and the 9 box-axis × triangle-edge cross products.
Fully inlined with local scalars — no scratch arrays or per-call allocations.
Axes are tested cheapest-first (box faces, i.e. the triangle-vs-box AABB
reject) so the common non-overlapping case exits before any edge or cross
product is computed. On each edge-cross axis two of the three vertices project
to the same value (the axis is perpendicular to that edge), so only two
projections are needed. An all-zero cross axis (edge parallel to a box axis)
collapses every projection and the radius to 0, passing automatically.
Test whether an axis-aligned bounding box intersects a triangle, via the separating-axis theorem over 13 axes: the 3 box face normals, the triangle face normal, and the 9 box-axis × triangle-edge cross products.
Fully inlined with local scalars — no scratch arrays or per-call allocations. Axes are tested cheapest-first (box faces, i.e. the triangle-vs-box AABB reject) so the common non-overlapping case exits before any edge or cross product is computed. On each edge-cross axis two of the three vertices project to the same value (the axis is perpendicular to that edge), so only two projections are needed. An all-zero cross axis (edge parallel to a box axis) collapses every projection and the radius to 0, passing automatically.