There’s this point in Woo’s paper that confused me before, and it just confused me again now.
The paper says to always pick the largest t.
So the situations in red and pink confused me. It would seem at first glance that “further t” (in the pink diagram, the one intersecting min.y) would be the “greater t” but the _wrong one_ to pick.
But it turns out when you cull the back faces _based on ray direction_, the smaller t would be at the max.y plane, even though the ray starts AFTER the max.y plane.
Note Woo’s method as presented _doesn’t work for when the ray starts totally inside the box_.
If the ray starts inside the box, if you only need the boolean result then RETURN TRUE immediately. But if you need the intersection point, you need to turn around some of the rules of the test: