mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +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
@@ -71,7 +71,9 @@ export function fakeCameraPort({ pose = {}, viewRectangle = null } = {}) {
|
||||
* (`flyTo({destination: Cartesian3, ...})`), while poses are read leniently
|
||||
* from what the fake has (`positionCartographic`, `heading`, `pitch`,
|
||||
* `roll`) and events come from the fake's own `changed`, `moveStart` and
|
||||
* `moveEnd`. Binding a viewer twice keeps the first. Returns the viewer.
|
||||
* `moveEnd`. A fake with `trackedEntityChanged` and `entities` follows
|
||||
* through the port, as the renderer does. Binding a viewer twice keeps the
|
||||
* first. Returns the viewer.
|
||||
* @template {{camera: object}} V
|
||||
* @param {V} viewer
|
||||
* @returns {V}
|
||||
@@ -119,11 +121,18 @@ export function bindFakeCesiumCamera(viewer) {
|
||||
});
|
||||
const scene = {
|
||||
postUpdate: noEvent,
|
||||
preUpdate: viewer.scene?.preUpdate ?? noEvent,
|
||||
get screenSpaceCameraController() {
|
||||
return viewer.scene?.screenSpaceCameraController ?? undefined;
|
||||
},
|
||||
requestRender: () => viewer.scene?.requestRender?.(),
|
||||
};
|
||||
// A fake with Cesium's entity tracking follows as the renderer does.
|
||||
const tracks = Boolean(viewer.trackedEntityChanged && viewer.entities);
|
||||
const real = createCesiumCamera({
|
||||
scene,
|
||||
camera,
|
||||
...(tracks ? { widget: viewer } : {}),
|
||||
report: (error) => {
|
||||
throw error;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user