mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(app): run gev on Navara behind ?engine=navara
The page's engine is ?engine=cesium|navara, else localStorage gev.engine, else Cesium (src/app/engineChoice.js). Cesium mode is unchanged. In Navara mode (src/app/navaraMode.js, loaded with import() only then, and loading the Navara globe the same way) the scene builds the Navara globe on the app container with no viewer; map stacks go through engine.maps (Google 3D from the browser key, else Esri imagery); only the shell's own data credits are registered. The layer catalog is empty and the controls get empty layer stand-ins. The shell does not create its viewer-bound parts (cockpit view, celestial ring, detection, tracked readout, post-process stages); the tools install the render governor on the engine, skip the director, annotations, drawing, imagery box, scope mask, voice and embedded views, skip the first-run welcome, and show "Experimental Navara engine: layers, cockpit, director and voice are unavailable". window.__godsEyeView.viewer is null. Navara's attribution card is kept clear of the location tray. A few shell paths became null-safe for the missing viewer, layers or stages without changing Cesium behaviour. scripts/qa-engine-shell.mjs checks both modes headless: boot, viewer, console errors, map drawn, search and fly, north/tilt/zoom/reset, orbit, HUD, share link restore and map stacks.
This commit is contained in:
1 parent
306e3e9467
commit
4ded3fbf15
21 files changed
+776
-49
No files matched your search
+32
-26
@@ -414,14 +414,18 @@ export class StyleManager extends ShellFacade {
|
||||
|
||||
// Full-globe sun/moon ring. It is a crisp screen-space overlay above the
|
||||
// Cesium canvas but below the HUD/detection/readout z ladder.
|
||||
this.celestialRing = new CelestialRing(viewer, {
|
||||
enabled: false,
|
||||
onAutoDisable: () =>
|
||||
this.setCelestialRingEnabled(false, {
|
||||
syncShare: !!this.shareLinkManager,
|
||||
focus: false,
|
||||
}),
|
||||
});
|
||||
// Viewer-bound modules (the ring, detection, tracked readout, cockpit)
|
||||
// are not created without a viewer (the experimental Navara engine).
|
||||
this.celestialRing = viewer
|
||||
? new CelestialRing(viewer, {
|
||||
enabled: false,
|
||||
onAutoDisable: () =>
|
||||
this.setCelestialRingEnabled(false, {
|
||||
syncShare: !!this.shareLinkManager,
|
||||
focus: false,
|
||||
}),
|
||||
})
|
||||
: null;
|
||||
|
||||
// Share Link Manager
|
||||
this.shareLinkManager = new ShareLinkManager(engine, {
|
||||
@@ -478,24 +482,26 @@ export class StyleManager extends ShellFacade {
|
||||
|
||||
// Initialize detection overlay BEFORE style stages so the composite
|
||||
// stage is first in the post-process pipeline
|
||||
initDetection(
|
||||
viewer,
|
||||
[
|
||||
trafficLayer,
|
||||
flightsLayer,
|
||||
militaryFlightsLayer,
|
||||
localAdsbLayer,
|
||||
satellitesLayer,
|
||||
cctvLayer,
|
||||
bikeshareLayer,
|
||||
transitLayer,
|
||||
aisLiveVesselsLayer,
|
||||
].filter(Boolean),
|
||||
(modeLabel) => {
|
||||
this._updateDetectionButton(modeLabel);
|
||||
},
|
||||
);
|
||||
initTrackedReadout(viewer);
|
||||
if (viewer) {
|
||||
initDetection(
|
||||
viewer,
|
||||
[
|
||||
trafficLayer,
|
||||
flightsLayer,
|
||||
militaryFlightsLayer,
|
||||
localAdsbLayer,
|
||||
satellitesLayer,
|
||||
cctvLayer,
|
||||
bikeshareLayer,
|
||||
transitLayer,
|
||||
aisLiveVesselsLayer,
|
||||
].filter(Boolean),
|
||||
(modeLabel) => {
|
||||
this._updateDetectionButton(modeLabel);
|
||||
},
|
||||
);
|
||||
initTrackedReadout(viewer);
|
||||
}
|
||||
setDetectionStyle(this.activeStyle);
|
||||
this._applyDetectionDensityFromUi();
|
||||
|
||||
|
||||
@@ -31,6 +31,15 @@ export class CockpitCoordinator {
|
||||
elements,
|
||||
operations,
|
||||
);
|
||||
this._cockpitDisplayPortal = null;
|
||||
// The cockpit flies the Cesium camera after tracked aircraft; without a
|
||||
// viewer (the Navara engine) there is no cockpit and controlCockpit
|
||||
// reports it unavailable.
|
||||
this.cockpitView = viewer
|
||||
? this._createCockpitView(viewer, services)
|
||||
: null;
|
||||
}
|
||||
_createCockpitView(viewer, services) {
|
||||
const {
|
||||
flightsLayer,
|
||||
militaryFlightsLayer,
|
||||
@@ -49,8 +58,7 @@ export class CockpitCoordinator {
|
||||
regionalDistanceM,
|
||||
weatherCodeLabel,
|
||||
} = services;
|
||||
this._cockpitDisplayPortal = null;
|
||||
this.cockpitView = new CockpitViewController(viewer, {
|
||||
return new CockpitViewController(viewer, {
|
||||
services: {
|
||||
flightsLayer,
|
||||
militaryFlightsLayer,
|
||||
@@ -112,7 +120,7 @@ export class CockpitCoordinator {
|
||||
}
|
||||
getCockpitState() {
|
||||
const { militaryAwarenessLayer } = this.services;
|
||||
const snapshot = militaryAwarenessLayer.getContextSnapshot?.();
|
||||
const snapshot = militaryAwarenessLayer?.getContextSnapshot?.();
|
||||
const info = this.cockpitView?.readAircraftInfo?.();
|
||||
const active = Boolean(this.cockpitView?.active);
|
||||
const gateOpen = Boolean(this.cockpitView?.isEntryAllowed?.());
|
||||
|
||||
@@ -77,11 +77,13 @@ export class LayerBindings {
|
||||
window,
|
||||
this._worldRequestFocusHandler,
|
||||
);
|
||||
this._navigationOwnerChangedRemover =
|
||||
this.viewer.trackedEntityChanged.addEventListener((entity) => {
|
||||
if (entity && !this._disposed)
|
||||
this._stampNavigation({ cancelPendingSelection: false });
|
||||
});
|
||||
// Entity tracking is the viewer's (no viewer on the Navara engine).
|
||||
if (this.viewer)
|
||||
this._navigationOwnerChangedRemover =
|
||||
this.viewer.trackedEntityChanged.addEventListener((entity) => {
|
||||
if (entity && !this._disposed)
|
||||
this._stampNavigation({ cancelPendingSelection: false });
|
||||
});
|
||||
// Vessel/installation focus flies without ever assigning a tracked entity,
|
||||
// so it cannot reach the listener above. It announces instead.
|
||||
this._removeNavigationAuthorityListener =
|
||||
|
||||
@@ -230,6 +230,7 @@ export class RadioControls {
|
||||
document
|
||||
.getElementById('title-bar')
|
||||
?.classList.remove('radio-broadcasting');
|
||||
this.radio.endTuning();
|
||||
// The Navara engine's stand-in radio layer has no tuner.
|
||||
this.radio.endTuning?.();
|
||||
}
|
||||
}
|
||||
@@ -415,3 +415,17 @@
|
||||
visibility: visible;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
/* The experimental Navara engine (?engine=navara) shows its attributions in
|
||||
its own card, fixed bottom-right over the location tray. Keep it on the
|
||||
left, above the HUD's coordinate lines and below the left panel rail. */
|
||||
body .navara-attr-dock {
|
||||
right: auto;
|
||||
left: 16px;
|
||||
bottom: 176px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
body .navara-attr-card {
|
||||
max-height: 290px;
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -52,8 +52,10 @@ export class VisualEffects {
|
||||
this.previousBloom = null;
|
||||
}
|
||||
|
||||
// Post-process stages are Cesium's: without a viewer (the Navara engine)
|
||||
// there are none, and the style, bloom and sharpen controls change nothing.
|
||||
initStyles() {
|
||||
if (this.stopped || this.stageEntries.length) return;
|
||||
if (!this.viewer || this.stopped || this.stageEntries.length) return;
|
||||
for (const [name, shader] of Object.entries(STYLES)) {
|
||||
const uniforms = { intensity: 0.0 };
|
||||
if (shader.fragmentShader.includes('uniform float time'))
|
||||
@@ -73,7 +75,7 @@ export class VisualEffects {
|
||||
}
|
||||
|
||||
initPostProcess(sharpenIntensity = this.sharpenIntensity) {
|
||||
if (this.stopped || this.sharpenStage) return;
|
||||
if (!this.viewer || this.stopped || this.sharpenStage) return;
|
||||
this.bloomStage = this.viewer.scene.postProcessStages.bloom;
|
||||
const names = [
|
||||
'glowOnly',
|
||||
@@ -224,6 +226,7 @@ export class VisualEffects {
|
||||
if (this.destroyed) return;
|
||||
this.stop();
|
||||
this.destroyed = true;
|
||||
if (!this.viewer) return;
|
||||
const stages = this.viewer.scene.postProcessStages;
|
||||
for (const [, stage] of this.stageEntries) stages.remove(stage);
|
||||
if (this.sharpenStage) stages.remove(this.sharpenStage);
|
||||
|
||||
@@ -544,7 +544,7 @@ export class VisualSettings {
|
||||
fadeRatio: fadePct / 100,
|
||||
outsideOpacity: outsideOpacityPct / 100,
|
||||
});
|
||||
this.viewer.scene.requestRender?.();
|
||||
this.viewer?.scene.requestRender?.();
|
||||
}
|
||||
|
||||
_setDetectionAllocation(strategy, { syncShare = true, persist = true } = {}) {
|
||||
@@ -1486,7 +1486,13 @@ export class VisualSettings {
|
||||
this._styleParameters.clear();
|
||||
const shader = STYLES[styleName];
|
||||
|
||||
if (!shader || !shader.uniforms || styleName === 'normal') {
|
||||
// No stage without a viewer (the Navara engine): nothing to adjust.
|
||||
if (
|
||||
!shader ||
|
||||
!shader.uniforms ||
|
||||
styleName === 'normal' ||
|
||||
!this.stages[styleName]
|
||||
) {
|
||||
this._sliderPanel.classList.remove('active');
|
||||
this._scheduleRightPanelLayout();
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user