mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 09:12:18 +00:00
Move geo import, voice capture, visual settings, scope mask and recent imagery onto the renderer ports
Geo import asks the frame port for renders, the camera port for moveEnd and the globe port's progress for the terrain queue running dry; its data sources are added, removed and shown by the listed geoImportPins module. Voice capture waits on the frame port's postRender. Visual settings toggle the infrared fog through the globe sky port, and the anime style dims the Milky Way through a sky getter it is given. The scope mask reads the camera height and listens on the frame and camera ports. Recent imagery picks the view centre, reads the view rectangle and the field of view through the query and camera ports. Installations claim camera sensitivity from their rendering module. The application shell loads the unbound globe factory.
This commit is contained in:
1 parent
b19fa56565
commit
81d8e3a4a7
20 files changed
+308
-119
No files matched your search
@@ -1,9 +1,5 @@
|
||||
import { cameraOf } from '../../render/rendererOf.js';
|
||||
import { CAMERA_CHANGED_THRESHOLD, LAYER_ID } from './policy.js';
|
||||
import {
|
||||
claimCameraSensitivity,
|
||||
releaseCameraSensitivity,
|
||||
} from '../../data/cameraSensitivity.js';
|
||||
|
||||
export function createLifecycle({
|
||||
state: layerState,
|
||||
@@ -52,11 +48,7 @@ export function createLifecycle({
|
||||
});
|
||||
parts.namedMarkers?.enable();
|
||||
parts.namedMarkers?.sync(layerState.records || []);
|
||||
claimCameraSensitivity(
|
||||
layerState.viewer.camera,
|
||||
LAYER_ID,
|
||||
CAMERA_CHANGED_THRESHOLD,
|
||||
);
|
||||
parts.rendering.claimCameraChanges?.();
|
||||
registerPickOwner(LAYER_ID, (id) => layerState.recordById.has(id));
|
||||
layerState.dataSource.show = true;
|
||||
// DataLayerManager invokes update() immediately after enable(), which owns
|
||||
@@ -67,7 +59,7 @@ export function createLifecycle({
|
||||
layerState.enabled = false;
|
||||
services.credits?.hideOsmCredit?.(layerState.viewer, LAYER_ID);
|
||||
parts.namedMarkers?.hide();
|
||||
releaseCameraSensitivity(layerState.viewer?.camera, LAYER_ID);
|
||||
parts.rendering.releaseCameraChanges?.();
|
||||
layerState.contextAnchor = null;
|
||||
layerState.contextPosition = null;
|
||||
layerState.coverage = { kind: 'viewport' };
|
||||
|
||||
@@ -4,7 +4,16 @@ import * as Cesium from 'cesium';
|
||||
// factory its other parts reach the renderer through.
|
||||
import '../../render/cesium/camera.js';
|
||||
import { t } from '../../i18n/index.js';
|
||||
import { LAYER_ID, MAX_RENDERED, COLOR_BY_CLASS } from './policy.js';
|
||||
import {
|
||||
CAMERA_CHANGED_THRESHOLD,
|
||||
LAYER_ID,
|
||||
MAX_RENDERED,
|
||||
COLOR_BY_CLASS,
|
||||
} from './policy.js';
|
||||
import {
|
||||
claimCameraSensitivity,
|
||||
releaseCameraSensitivity,
|
||||
} from '../../data/cameraSensitivity.js';
|
||||
import { entityRecord } from '../../data/entityRecords.js';
|
||||
import { installationMarkers } from './markerState.js';
|
||||
|
||||
@@ -382,9 +391,26 @@ export function createRendering({
|
||||
renderRecords();
|
||||
});
|
||||
}
|
||||
/**
|
||||
* While the layer is on, the Cesium camera reports changes at the layer's
|
||||
* threshold to its own `changed` listeners too (the camera port measures
|
||||
* each listener's threshold itself).
|
||||
*/
|
||||
function claimCameraChanges() {
|
||||
claimCameraSensitivity(
|
||||
layerState.viewer.camera,
|
||||
LAYER_ID,
|
||||
CAMERA_CHANGED_THRESHOLD,
|
||||
);
|
||||
}
|
||||
function releaseCameraChanges() {
|
||||
releaseCameraSensitivity(layerState.viewer?.camera, LAYER_ID);
|
||||
}
|
||||
return {
|
||||
attach,
|
||||
detach,
|
||||
claimCameraChanges,
|
||||
releaseCameraChanges,
|
||||
installationSurfaceHeightM,
|
||||
clearSelectionFill,
|
||||
syncSelectionFill,
|
||||
|
||||
Reference in new issue
Block a user