I need to be able to determine whether the straight line between two points (segment), crosses the space inside a frustum (intersects the frustum). I've looked into the APIs offered by THREE.js and haven't been able to find it.
What I've tried
- use containsPoint api for the two points of the line. Obviously not good enough, as this requires the entire segment to be contained in the frustum
- use intersectsBox, with a 1 dimensional box which mimics a segment. The limitation is that
Box3is axis-aligned by default and it would only work with axis-aligned segments.
Adding a method like this frustum could work:
There may be floating point precision issues, but I think this approach works(?)