mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Follow aircraft and satellites through the camera port
Flights and military follow their tracked aircraft with an entityFollowTarget: framed in ENU from viewFrom, never closer than 150 m, presentation read from the drawn entity's record. Satellites follow in Cesium's autodetect frame. The layers' own framing (applyTrackedCameraFrame) goes; the port's follow has the same close-range rules, and trackedCamera.js no longer imports Cesium. The port's helper entity draws nothing: its point's outline is transparent too, and click and voice picks of it count as picks of the target's drawn entity. The fake camera binder follows when the fake has Cesium's entity tracking.
This commit is contained in:
1 parent
99f9a701d9
commit
e3a850bc9c
22 files changed
+291
-332
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { cameraOf } from '../../render/cesium/camera.js';
|
||||
import { followedOf } from '../../data/followed.js';
|
||||
import { approxDistanceKm as _approxDistanceKm } from './recordPolicy.js';
|
||||
import { displayedKinematics } from '../../data/motionModel.js';
|
||||
import * as Cesium from 'cesium';
|
||||
@@ -28,7 +30,6 @@ export function createQueries({
|
||||
const { tr3bTypeLabel, tr3bAircraftClass } = services.aircraftPresentation;
|
||||
const { formatFlightLevel } = services.labels;
|
||||
const { isMilitaryIcao } = services.militaryRegistry;
|
||||
const { applyTrackedCameraFrame } = services.camera;
|
||||
const {
|
||||
setFocusDeemphasisParams,
|
||||
getFocusDeemphasisParams,
|
||||
@@ -828,18 +829,13 @@ export function createQueries({
|
||||
if (
|
||||
id !== flightState._trackedIcao ||
|
||||
!flightState._viewer.entities?.contains?.(flightState._trackedEntity) ||
|
||||
flightState._viewer.trackedEntity !== flightState._trackedEntity
|
||||
followedOf(flightState._viewer) !== flightState._followTarget
|
||||
)
|
||||
return false;
|
||||
flightState._trackedCameraFrameStop?.();
|
||||
flightState._viewer.camera.cancelFlight();
|
||||
flightState._viewer.trackedEntity = flightState._trackedEntity;
|
||||
flightState._trackedCameraFrameStop =
|
||||
applyTrackedCameraFrame(
|
||||
flightState._viewer,
|
||||
flightState._trackedEntity,
|
||||
flightState._trackedEntity.viewFrom,
|
||||
) || null;
|
||||
// Following the same target again frames it afresh.
|
||||
const camera = cameraOf(flightState._viewer);
|
||||
camera.cancelFlight();
|
||||
camera.follow(flightState._followTarget);
|
||||
parts.tracking._publishTrackedSelection(id, origin);
|
||||
return true;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user