Follow aircraft and satellites through the camera port

Flights and military follow their tracked aircraft with an
entityFollowTarget: framed in ENU from viewFrom, never closer than
150 m, presentation read from the drawn entity's record. Satellites
follow in Cesium's autodetect frame. The layers' own framing
(applyTrackedCameraFrame) goes; the port's follow has the same
close-range rules, and trackedCamera.js no longer imports Cesium.

The port's helper entity draws nothing: its point's outline is
transparent too, and click and voice picks of it count as picks of
the target's drawn entity. The fake camera binder follows when the
fake has Cesium's entity tracking.
This commit is contained in:
Sameh Khamis committed 2026-11-06 16:10:48 -08:00
1 parent 99f9a701d9
commit e3a850bc9c
22 files changed
+291 -332

No files matched your search

+2 -25
View File
@@ -1,12 +1,8 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import * as Cesium from 'cesium';
import {
clampTrackedCameraPosition,
trackedDisplayPositionForCamera,
trackedModelScaleForPixelCap,
} from './trackedCamera.js';
import { withEntityRecord } from './entityRecords.js';
import { trackedModelScaleForPixelCap } from './trackedCamera.js';
import { clampFollowEye as clampTrackedCameraPosition } from '../render/cesium/follow.js';
test('tracked camera origin crossing returns to the prior side at the minimum range', () => {
const camera = {
@@ -71,22 +67,3 @@ test('tracked model shrinks smoothly when close enough to exceed the pixel cap',
assert.ok(scale < 24);
assert.ok(Math.abs(projectedDiameterPx - 104) < 1e-9);
});
test('tracked camera prefers the already-rendered display cache', () => {
let callbackReads = 0;
const cached = new Cesium.Cartesian3(1, 2, 3);
const entity = withEntityRecord({ position: {
getValue: () => {
callbackReads += 1;
return new Cesium.Cartesian3(4, 5, 6);
},
} }, { displayPosition: () => cached });
const result = trackedDisplayPositionForCamera(
entity,
Cesium.JulianDate.now(),
new Cesium.Cartesian3(),
);
assert.deepEqual(result, cached);
assert.notEqual(result, cached);
assert.equal(callbackReads, 0);
});