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 e5f8e5753a
commit c6f043d3fd
22 files changed
+291 -332

No files matched your search

+5 -2
View File
@@ -3,6 +3,8 @@
// Pure function — no viewer/DOM needed; imported directly.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { followedOf } from './followed.js';
import { bindFakeCesiumCamera } from '../testSupport/fakeCameraPort.mjs';
import * as Cesium from 'cesium';
import flightsLayer, {
_addFlightTrackingCandidateForTest,
@@ -439,6 +441,7 @@ test('real civil track path creates no native label and publishes every cached h
},
});
viewer.scene.camera = viewer.camera;
bindFakeCesiumCamera(viewer);
const billboard = {
position,
rotation: 0.3,
@@ -512,7 +515,7 @@ test('real civil track path creates no native label and publishes every cached h
flightsLayer.trackById(icao24, { origin: 'programmatic' }),
true,
);
const entity = viewer.trackedEntity;
const entity = followedOf(viewer)?.entity;
assert.ok(
entity instanceof Cesium.Entity,
'trackById must create the real Cesium entity',
@@ -554,7 +557,7 @@ test('real civil track path creates no native label and publishes every cached h
assert.equal(flightsLayer.refocusTrackedById(icao24), true);
viewer.scene.preUpdate.raiseEvent();
assert.equal(
viewer.trackedEntity,
followedOf(viewer)?.entity,
entity,
'refocus must retain the exact tracked entity',
);