Move Cockpit onto the camera and frame ports

Cockpit now places its eye with the geo maths and moves the camera
through the camera port on the frame port's preUpdate, so cockpitCamera.js
and cockpitController.js no longer load Cesium and leave the allow-list.
Whether the aircraft still draws comes from a trackedEntityDrawn service,
which the application shell answers from the viewer's entities. The mesh
floor probe accepts the viewer as well as its scene.
This commit is contained in:
Sameh Khamis committed 2026-11-07 16:12:43 -08:00
1 parent b47aa5f3de
commit 2a9a2d5be8
11 files changed
+433 -159

No files matched your search

+6 -2
View File
@@ -33,8 +33,9 @@ import {
import { toDegrees, toRadians } from '../geo/index.js';
import { cameraOf, findCamera } from '../render/cesium/camera.js';
// Loads the effects factory, so visual settings on a viewer with no renderer
// bound still get an effects port. Loading the camera and effects factories
// is all that keeps this module on the Cesium allow-list.
// bound still get an effects port. Loading the camera and effects factories,
// and asking the viewer's entities whether Cockpit's aircraft still draws,
// keep this module on the Cesium allow-list.
import '../render/cesium/effects.js';
import { aircraftTrackingTarget } from '../cockpitTracking.js';
@@ -376,6 +377,9 @@ export class StyleManager extends ShellFacade {
meshFloorPreferred: services.meshFloorPreferred,
warmGroundFloor: services.warmGroundFloor,
sampleMeshFloorCells: services.sampleMeshFloorCells,
// Whether the aircraft entity Cockpit flies still draws: the flight
// layers draw it as an entity of the viewer's own.
trackedEntityDrawn: (entity) => viewer.entities.contains(entity),
holdContinuousRender: services.holdContinuousRender,
releaseContinuousRender: services.releaseContinuousRender,
fetchRegionalBrief: services.fetchRegionalBrief,