There are plenty of well-known algorithms for determining if a ray hit an Axis-Aligned Bounding Box (AABB), like Andrew Woo's covered in a response here.
Using exit = origin + (dir * tMax)
will give you the exact position of exit using distance through the ray. (and same for tMin and the entry)
However, I need a way to not only do that, but also get if we hit the left, right, top, bottom, front, or rear face of the AABB.
The naive approach would be to do some kind of floating-point comparison given the minpoint/maxpoint and try to see what side (if any) the point exactly equals in each dimension, or exactly equals within a tolerance. That seems error-prone, I was wondering if there was a better way.
Is there an algorithm for this?