mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
refactor(overlays): hand the shell's overlay host the engine, not the viewer
The controls pass the scene engine to the shell, which initializes the world overlay on it; initWorldOverlay takes only a globe engine (a viewer or null is refused), so the shell no longer needs a viewer for its overlay. engineFromViewer only returns the engine registered for a viewer (the scene engine until teardown) and never builds one, so no engine can outlive its viewer without a destroy path. Overlay and detection tests and the allocation worker build a Cesium engine on their mock viewers and destroy it with them; frame allocation is unchanged.
This commit is contained in:
1 parent
3e3aa0bd9f
commit
12c9651a67
10 files changed
+145
-105
No files matched your search
@@ -61,11 +61,18 @@ import { runCctvLayerEnableTransition } from '../cctvFocusPolicy.js';
|
||||
export class StyleManager extends ShellFacade {
|
||||
/**
|
||||
* @param {Cesium.Viewer} viewer - The CesiumJS viewer instance.
|
||||
* @param {object} [options]
|
||||
* @param {object} [options] `engine`: the page's globe engine (the world
|
||||
* overlay host runs on it).
|
||||
*/
|
||||
constructor(
|
||||
viewer,
|
||||
{ mapStackController = null, placeSearch, services, requestServices } = {},
|
||||
{
|
||||
engine = null,
|
||||
mapStackController = null,
|
||||
placeSearch,
|
||||
services,
|
||||
requestServices,
|
||||
} = {},
|
||||
) {
|
||||
super();
|
||||
const {
|
||||
@@ -460,7 +467,7 @@ export class StyleManager extends ShellFacade {
|
||||
// The shared world-overlay host must own its one postRender lane before
|
||||
// detection and tracked-readout initialize. It stays transparent until a
|
||||
// production source explicitly registers entries.
|
||||
initWorldOverlay(viewer);
|
||||
initWorldOverlay(engine);
|
||||
|
||||
// Initialize detection overlay BEFORE style stages so the composite
|
||||
// stage is first in the post-process pipeline
|
||||
|
||||
Reference in new issue
Block a user