Given:
- An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
- An axis-aligned box (defined by its minimum and maximum point)
- The box being completely inside the volume of the cylinder should also count as an intersection
To test if the cylinder and the box intersect.
Does such a test exist?
EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.
EDIT: I think I have realized there is a far, far simpler solution. (Though it still involves rotations)
1: Rotate the cylinder to the Z axis
2: Apply the same rotation to the axis-aligned bounding box vertices
3: Get the distance of every vertex (in x,y) from 0,0. If any of them report a distance less than the radius of the cylinder, part of the box must overlap with the cylinder.
I'm not positive, but I think that should work! If it does, I will put it into a full solution.