mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Read what the camera follows through one module
src/data/followed.js answers what the camera follows: the camera port's target, or the entity a layer still tracks itself, seen through the same fields. Ownership checks, render holds, guards, voice actions, the CCTV pacing and the navigation release paths read it instead of Cesium's trackedEntity, so they keep working when layers follow through the port. The release paths stop following, cancel the flight and release the camera through the port. The rotate refusal names the followed target by its name or label title.
This commit is contained in:
1 parent
6c215f93a9
commit
7eec2f828c
29 files changed
+404
-97
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { isFollowing, stopFollowing } from '../data/followed.js';
|
||||
import { interruptGlobeRotation } from '../cameraVerbs.js';
|
||||
import {
|
||||
layerSnapshot,
|
||||
@@ -396,7 +397,7 @@ export function createGevActionRunner({
|
||||
// Explicit navigation while TRACKING supersedes the follow camera —
|
||||
// otherwise the tracker drags the view back and "I flew there but can't
|
||||
// do anything" (field finding). track_entity manages its own handoff.
|
||||
if (name === 'zoom_to_globe' && viewer.trackedEntity) {
|
||||
if (name === 'zoom_to_globe' && isFollowing(viewer)) {
|
||||
stopAllTracking(viewer, dataManager);
|
||||
}
|
||||
|
||||
@@ -1130,7 +1131,7 @@ export function createGevActionRunner({
|
||||
return;
|
||||
}
|
||||
interruptCameraMotion('nav:fly_to_location');
|
||||
if (viewer.trackedEntity) stopAllTracking(viewer, dataManager);
|
||||
if (isFollowing(viewer)) stopAllTracking(viewer, dataManager);
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -2570,7 +2571,7 @@ function stopAllTracking(viewer, dataManager) {
|
||||
failed.add(layerId);
|
||||
}
|
||||
}
|
||||
if (viewer) viewer.trackedEntity = undefined;
|
||||
stopFollowing(viewer);
|
||||
if (failed.size) {
|
||||
const failedLayerIds = [...failed];
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user