Couple of things with classifySphere
yonatan opened this issue · comments
(and probably classifyRadius as well)
First, it returns INTERSECT immediately when it detects an intersection with any of the frustum planes, which seems wrong when the sphere is completely on the outside of some other frustum plane.
Second, there is a (literal) corner case, when a sphere intersects 3 of the frustum planes and is on the inside of the other 3, while still being completely outside the frustum volume. I have no idea how to fix that one.
Demo with a frustum extracted from the identity matrix (which I guess spans -1 and 1 on all axes):
http://wonderfl.net/c/eNu4
Click the buttons for values demonstrating both issues.