Fly the remaining flights through the camera port, on any viewer

The embed view, the celestial-ring focus, the ground-guard lift, the
Bhote Koshi approach and orbit, launch selection and replay flights, and
the cockpit's view and takeover now drive the renderer's camera port.
The contract gains a sineInOut easing, pinned by a conformance trace.

A viewer with no renderer bound, such as one a caller of a public
export brings, now gets a camera port too, as it already got an input
port: cameraOf builds one over the viewer's own Cesium camera and keeps
it for the viewer's life, until a renderer is bound. The Cesium adapter
provides the factory as it loads; code that reaches Cesium takes cameraOf
from the adapter so the factory comes with it, and findCamera answers
null where a missing camera is not an error (HUD, share link, world
focus, Recent Imagery's ZOOM IN). A test walks every package export and
fails one that can reach the bridge without loading the factory.

A destroyed viewer gets no camera and lets go of a built one, and the
application renderer stays bound until its viewer is destroyed.
This commit is contained in:
Sameh Khamis committed 2026-11-06 08:21:57 -08:00
1 parent c5b716b107
commit 1d4e4ebe90
44 files changed
+1167 -344

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ import {
} from './cyberSonarControls.js';
import * as Cesium from 'cesium';
import { cameraOf } from '../render/rendererOf.js';
import { cameraOf } from '../render/cesium/camera.js';
import { aircraftTrackingTarget } from '../cockpitTracking.js';
+2 -1
View File
@@ -1,5 +1,6 @@
/** Camera placement, ground acquisition and motion correction for the Cockpit controller. */
import * as Cesium from 'cesium';
import { cameraOf } from '../render/cesium/camera.js';
import {
cockpitAnchorCorrectionStep,
cockpitGroundSafeHeight,
@@ -349,7 +350,7 @@ export function update() {
}
}
this.viewer.camera.setView({
cameraOf(this.viewer).setView({
destination: this.scratchCamera,
orientation: { direction: this.scratchForward, up: this.scratchUp },
});
+2
View File
@@ -10,6 +10,7 @@ import { CockpitViewController } from './cockpitController.js';
import { useCockpitStore } from './stores/cockpit.js';
import CockpitView from './views/CockpitView.vue';
import ContextView from './views/ContextView.vue';
import { bindFakeCesiumCamera } from '../testSupport/fakeCameraPort.mjs';
const INFO = Object.freeze({
icao24: 'abc123',
@@ -51,6 +52,7 @@ function fixture(t) {
},
trackedEntityChanged: listeners(),
};
bindFakeCesiumCamera(viewer);
const cockpit = new CockpitViewController(viewer, {
services: {
flightsLayer: { getTrackedInfo: () => INFO, refreshTr3b() {} },
+2 -1
View File
@@ -1,5 +1,6 @@
/** Tracking identity, entry, exit and contact navigation for the Cockpit controller. */
import { t } from '../i18n/index.js';
import { cameraOf } from '../render/rendererOf.js';
import {
formatHeadingReadout,
normalizeHeading,
@@ -150,7 +151,7 @@ export function enter() {
: null;
// Retire deferred navigation before cancelFlight can run its callbacks.
this.onCameraTakeover?.();
this.viewer.camera.cancelFlight();
cameraOf(this.viewer).cancelFlight();
this.trackedEntity = entity;
this.trackedEntityWasShown = entity.show;
entity.show = false;