find Visible Point From Virtual Eye
fun findVisiblePointFromVirtualEye(virtualEyes: Vec3, box: AABB, rangeToTest: Double, visibilityPredicate: VisibilityPredicate = ArrowVisibilityPredicate): Vec3?
Finds a point that is visible from the virtual eyes.
Algorithm
Projects points on the box from the virtual eyes.
Sorts the points by distance to the box center.
For each point:
Creates a ray starting from the point, extending for twice the range.
Raycasts the ray against the box to find the intersection point.
Checks if the intersection point is within the range and satisfies the visibilityPredicate.
Returns the first visible point found, or null if no point is visible.
Return
the best visible spot found or null
Parameters
range To Test
The maximum distance to test for visibility.
visibility Predicate
An optional predicate to determine if a given point is visible