fix(annotations): sample arrow, route and area points outside the view (#1277)

A point of an arrow, route or area outside the view frustum was not
sampled and stood in at 0 m, so a partly visible arrow could hide, point
at the wrong place or vanish behind the eye. Such points are sampled again
within the 32-sample budget and the one-second retry, as on main; lone
points outside the view still skip sampling. The 0 m stand-in exceptions
are removed. Also from review: shared viewPlanes for transit and the
renderer, a −430..9000 m segment test against the view planes, tighter
tests and shorter docs.
This commit is contained in:
German Khokhlov committed 2026-11-20 03:39:09 +04:00
1 parent 95aa7ae29e
commit fdf7ed93ce
7 files changed
+408 -265

No files matched your search

+20
View File
@@ -47,6 +47,26 @@ export function frustumPlanes(pose) {
return [left, rightPlane, bottom, top, nearPlane, farPlane];
}
/**
* `frustumPlanes(pose)`, or null when the pose does not describe a
* perspective frustum: no position, direction or up, or no finite `fovy`,
* `aspectRatio` or `near` (an orthographic camera, no camera).
* @param {object|null|undefined} pose
* @returns {ReturnType<typeof frustumPlanes>|null}
*/
export function viewPlanes(pose) {
if (
!pose?.position ||
!pose.direction ||
!pose.up ||
!Number.isFinite(pose.fovy) ||
!Number.isFinite(pose.aspectRatio) ||
!Number.isFinite(pose.near)
)
return null;
return frustumPlanes(pose);
}
/**
* Whether a sphere is wholly outside `planes` (from `frustumPlanes`), as
* the default renderer's `CullingVolume.computeVisibility` reports