mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-22 03:02:20 +00:00
Keep CCTV playback and calibration while replacing globe projection surfaces
This commit is contained in:
1 parent
24190a3e35
commit
133ca14119
9 files changed
+378
-135
No files matched your search
@@ -103,7 +103,7 @@ export function createProjection({
|
||||
function setPlaneVisible(runtime, visible) {
|
||||
if (!runtime) return;
|
||||
runtime.planeVisible = !!visible;
|
||||
parts.renderer.setPlaneVisible(runtime, !!visible);
|
||||
if (runtime.planeEntity) parts.renderer?.setPlaneVisible(runtime, !!visible);
|
||||
if (visible && runtime.overlayEntry && runtime.cameraId) {
|
||||
if (layerState._projectionOverlayOwnerId !== runtime.cameraId) {
|
||||
layerState._cctvOverlayHost.setEntries(
|
||||
@@ -256,7 +256,7 @@ export function createProjection({
|
||||
runtime.imageLoading = false;
|
||||
runtime.imageReady = false;
|
||||
};
|
||||
parts.renderer.setPlaneImage(runtime, runtime.canvas);
|
||||
if (runtime.planeMaterial) parts.renderer?.setPlaneImage(runtime, runtime.canvas);
|
||||
parts.frames.refreshProjectionImage(record, true);
|
||||
parts.presentation.notifyListeners();
|
||||
},
|
||||
@@ -311,8 +311,19 @@ export function createProjection({
|
||||
|
||||
function ensureProjectionRuntime(record) {
|
||||
if (!record) return null;
|
||||
if (record.projection && !record.projection.disposed)
|
||||
return record.projection;
|
||||
if (record.projection && !record.projection.disposed) {
|
||||
const runtime = record.projection;
|
||||
if (runtime.needsPlane && parts.renderer?.ready) {
|
||||
const geometry = record.frustumGeometry || parts.geometry.computeFrustumGeometry(record.camera, parts.ground.groundAltFor(record), record.probeClampRangeM);
|
||||
const positions = record.frustumPositions || parts.geometry.frustumCartesians(geometry);
|
||||
runtime.planeMaterial = parts.renderer.createPlaneMaterial(runtime.canvas);
|
||||
createProjectionPlane(record, runtime, geometry, positions);
|
||||
if (runtime.video?.videoWidth) parts.renderer.setPlaneImage(runtime, runtime.video);
|
||||
runtime.needsPlane = false;
|
||||
runtime.lastSwappedCanvasStamp = -1;
|
||||
}
|
||||
return runtime;
|
||||
}
|
||||
const runtime = createProjectionRuntime(record);
|
||||
record.projection = runtime;
|
||||
if (runtime) {
|
||||
|
||||
Reference in new issue
Block a user