mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-22 03:02:20 +00:00
Draw the aircraft family, Wildlife Sightings and the Cockpit through the contract
The layers that still had one Cesium and one Navara implementation, or
drew on Cesium only, now draw through engine.movers, engine.lines and
engine.camera on both engines, and application code holds the engine
instead of guessing it from a viewer.
- Aircraft family: flights, military and local ADS-B share one display
(src/layers/aircraft/render/display.js). The Cesium and Navara
renderers are gone. Where they differed, the display follows Cesium:
- attach and visibility tracking, live disableDepthTestDistance
changes, the tracked glyph's distance scale, model ids that change,
local ADS-B markers hidden until shown and its UAT ring as a point;
- the trail head's hidden alpha is 0.45, the contract's
depthFailAlpha scaled by the head's 0.9.
The tracked glyph stays over the fleet, as on Navara. The movers
contract reports readiness per model and reads model axes as the
glTF's own on every engine. Cesium's follow takes any native target
through a proxy entity in the ENU frame and mirrors its readout fields.
- Wildlife Sightings draws badges and the density glow as sprite sets
and its privacy cells as line outlines (no fill yet). It takes clicks
from engine.input and its card anchors to the engine's canvas and
camera, so the layer is in both engines' catalogs again and a switch
keeps the session's layer set.
- Cockpit: cockpitHost takes the engine only. The ridden aircraft is the
engine follow's target, hidden through its sprite; only the Cesium
Viewer's stock double-click is still routed around.
- About forty camera, navigation, share-link, HUD, voice, detection and
layer-lifecycle callers take the engine. isGlobeEngine and
engineFromViewer calls outside src/globe fall from 51 to 14.
The coupling baseline drops accordingly: layer renderer lines from
5239/12331 to 4546/11106 (Cesium/Navara), `viewer` lines from 2424 to
2209, Cesium-importing files from 69 to 66.
This commit is contained in:
1 parent
48988015f1
commit
35e70ec280
145 files changed
+4716
-4212
No files matched your search
+6
-10
@@ -54,7 +54,6 @@ import {
|
||||
} from '../cameraVerbs.js';
|
||||
import * as defaultFloorServices from '../data/groundFloor.js';
|
||||
import { isPickedWorldPosition } from '../data/scenePick.js';
|
||||
import { engineFromViewer } from '../globe/cesium/engineFromViewer.js';
|
||||
import { engineCapabilities } from '../globe/contract.js';
|
||||
import { unavailablePlaceSearch } from '../search/placeSearch.js';
|
||||
import * as defaultAnnotationResolver from '../annotations/annotationResolver.js';
|
||||
@@ -319,13 +318,13 @@ const cameraCartographic = (engine) =>
|
||||
|
||||
/**
|
||||
* Create application actions over the supplied scene and services. The
|
||||
* actions drive the globe `engine` (by default the one registered for the
|
||||
* viewer). Each action checks its scene services and render/camera capabilities;
|
||||
* a missing capability returns UNAVAILABLE_ON_ENGINE on either engine.
|
||||
* actions drive the globe `engine`. Each action checks its scene services and
|
||||
* render/camera capabilities; a missing capability returns
|
||||
* UNAVAILABLE_ON_ENGINE on either engine.
|
||||
*/
|
||||
export function createGevActionRunner({
|
||||
viewer,
|
||||
engine: givenEngine = null,
|
||||
engine = null,
|
||||
styleManager,
|
||||
dataManager,
|
||||
sceneDirector = null,
|
||||
@@ -348,7 +347,6 @@ export function createGevActionRunner({
|
||||
const builders = speechBuilders
|
||||
? { ...SPEECH_BUILDERS, ...speechBuilders }
|
||||
: SPEECH_BUILDERS;
|
||||
const engine = givenEngine ?? engineFromViewer(viewer);
|
||||
// A host that replaces this runner when the globe engine changes passes
|
||||
// the analyst's follow-up memory and the layer enable times, so the next
|
||||
// runner keeps them.
|
||||
@@ -3337,15 +3335,13 @@ function runManagedVoiceNavigation(
|
||||
/** Gathers tracked/selected entities across layer families for read-back. */
|
||||
|
||||
/**
|
||||
* @param {object} target The globe engine, or a Cesium viewer with a
|
||||
* registered engine (the HUD).
|
||||
* @param {import('../globe/contract.js').GlobeEngine | null} engine
|
||||
*/
|
||||
export async function getBasemapLabelContext(
|
||||
target,
|
||||
engine,
|
||||
service = defaultGeospatial,
|
||||
{ cachedOnly = false, previous = null } = {},
|
||||
) {
|
||||
const engine = engineFromViewer(target);
|
||||
const { reverseGeocodeCache, nearbyPlacesCache } = cachesFor(service);
|
||||
const viewTarget = engine ? getViewTargetCartographic(engine) : null;
|
||||
if (!viewTarget) {
|
||||
|
||||
@@ -34,10 +34,6 @@ import { MAP_STACKS } from '../mapStackController.js';
|
||||
import { GEV_REALTIME_TOOLS } from '../../server/providers/openai/tools.js';
|
||||
import { presentResult } from './resultDisplay.js';
|
||||
import { createCesiumEngine } from '../globe/cesium/createCesiumEngine.js';
|
||||
import {
|
||||
engineFromViewer,
|
||||
registerViewerEngine,
|
||||
} from '../globe/cesium/engineFromViewer.js';
|
||||
import { createFakeEngine } from '../globe/testing/fakeEngine.js';
|
||||
|
||||
test('every live basemap is reachable by its own id — no enum value without a voice alias', () => {
|
||||
@@ -196,9 +192,9 @@ function createVoiceNavigationHarness({ cockpitActive = false } = {}) {
|
||||
};
|
||||
// A Viewer's canvas is its scene's.
|
||||
viewer.canvas = viewer.scene.canvas;
|
||||
// Location flights run on the globe engine registered for the viewer, as
|
||||
// the app's scene engine is (src/app/globeEngine.js).
|
||||
registerViewerEngine(viewer, createCesiumEngine(viewer));
|
||||
// Location flights run on the Cesium engine over the viewer, as the app's
|
||||
// scene engine does (src/app/globeEngine.js).
|
||||
testEngines.set(viewer, createCesiumEngine(viewer));
|
||||
const styleManager = {
|
||||
runImmediateNavigation(noun, navigate, releaseOptions = undefined) {
|
||||
return runExplicitNavigation({
|
||||
@@ -5277,32 +5273,38 @@ const testPlaceSearch = () =>
|
||||
resolveApiKey: () => globalThis.window?.__GOOGLE_MAPS_API_KEY__,
|
||||
});
|
||||
function createGevActionRunner(options) {
|
||||
registerTestEngine(options.viewer);
|
||||
return createActionRunner({ placeSearch: testPlaceSearch(), ...options });
|
||||
return createActionRunner({
|
||||
placeSearch: testPlaceSearch(),
|
||||
...options,
|
||||
engine: options.engine ?? testEngineFor(options.viewer),
|
||||
});
|
||||
}
|
||||
/**
|
||||
* The runner drives the globe engine registered for its viewer, as the app's
|
||||
* scene engine is (src/app/globeEngine.js): a test viewer gets the Cesium
|
||||
* engine over it or, when its camera only states where it is
|
||||
* (positionCartographic), a fake engine at that place.
|
||||
* The runner drives the globe engine of its viewer, as the app's runner
|
||||
* drives the scene engine (src/app/globeEngine.js): a test viewer gets the
|
||||
* Cesium engine over it or, when its camera only states where it is
|
||||
* (positionCartographic), a fake engine at that place. One engine per viewer.
|
||||
*/
|
||||
function registerTestEngine(viewer) {
|
||||
if (!viewer || engineFromViewer(viewer)) return;
|
||||
const testEngines = new WeakMap();
|
||||
function testEngineFor(viewer) {
|
||||
if (!viewer) return null;
|
||||
let engine = testEngines.get(viewer);
|
||||
if (engine) return engine;
|
||||
const camera = viewer.camera ?? {};
|
||||
const place = Object.getOwnPropertyDescriptor(
|
||||
camera,
|
||||
'positionCartographic',
|
||||
)?.value;
|
||||
registerViewerEngine(
|
||||
viewer,
|
||||
engine =
|
||||
!camera.positionWC && place
|
||||
? createFakeEngine({
|
||||
longitude: place.longitude,
|
||||
latitude: place.latitude,
|
||||
altitude: place.height,
|
||||
})
|
||||
: createCesiumEngine(viewer),
|
||||
);
|
||||
: createCesiumEngine(viewer);
|
||||
testEngines.set(viewer, engine);
|
||||
return engine;
|
||||
}
|
||||
function controlRadio(viewer, manager, args, options) {
|
||||
return runControlRadio(viewer, manager, args, {
|
||||
|
||||
@@ -6,7 +6,6 @@ import { cameraPoseKey, createPointerTracker } from './pointerContext.js';
|
||||
import { createPointerPicker } from './pointerPick.js';
|
||||
import { createReferentRegistry } from './referents.js';
|
||||
import { createSceneRunner } from './sceneRunner.js';
|
||||
import { engineFromViewer } from '../globe/cesium/engineFromViewer.js';
|
||||
export * from './realtimeController.js';
|
||||
|
||||
const ACTION_NAMES = new Set(GEV_ACTION_SCHEMAS.map((schema) => schema.name));
|
||||
@@ -141,7 +140,7 @@ export function createSceneVoice(options) {
|
||||
attachScene(attached) {
|
||||
if (lifetime?.aborted) return;
|
||||
detachScene();
|
||||
const engine = attached.engine ?? engineFromViewer(attached.viewer);
|
||||
const engine = attached.engine ?? null;
|
||||
scene.engine = engine;
|
||||
shell = attached.styleManager ?? null;
|
||||
pick = createPointerPicker({
|
||||
|
||||
Reference in new issue
Block a user