mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 18:22:25 +00:00
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:
1 parent
95aa7ae29e
commit
fdf7ed93ce
7 files changed
+408
-265
No files matched your search
@@ -9,7 +9,7 @@ import { poseSignature } from '../../render/camera/poseSignature.js';
|
||||
import { heightsOf } from '../../queries/heights.js';
|
||||
import { fromDegreesInto } from '../../geo/ellipsoid.js';
|
||||
import { Vec3 } from '../../geo/vector.js';
|
||||
import { frustumPlanes } from '../../geo/frustum.js';
|
||||
import { viewPlanes } from '../../geo/frustum.js';
|
||||
import { perspectiveCourseRotation } from '../../data/screenRotation.js';
|
||||
import {
|
||||
PLACED_WAKE_MS,
|
||||
@@ -1074,23 +1074,6 @@ export function createRendering({ state, services, parts }) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The planes of the frustum the camera looks through, as the default
|
||||
* renderer culls with them, or null when the pose does not describe one.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
function refreshVisibility() {
|
||||
if (!state._enabled) return 0;
|
||||
const now = Date.now();
|
||||
|
||||
Reference in new issue
Block a user