mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Follow, drape and read the camera through the ports, not the viewer
- What the camera follows is the camera port's target only: no layer tracks an entity of its own any more, so followed.js stops reading and writing viewer.trackedEntity and the viewer's clock. - Draped imagery's host is the globe port's imagery while the globe is shown (isGlobeVisible, or no shown base tileset where a renderer cannot say), else the shown base tileset; weather uses the same resolver. - The World Packet reads the eye from the camera port's pose, and vessels ask again for the view on the camera port's moveEnd. - The stub's canvas takes event listeners, and in a page is a real canvas filling the container it is given; createStubRendererPlugin makes it a renderer plugin. The viewer access record is now empty.
This commit is contained in:
1 parent
ebbe006924
commit
a72d4c3b1f
11 files changed
+230
-213
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { toLonLatH } from '../geo/index.js';
|
||||
import { findCamera } from '../render/rendererOf.js';
|
||||
import {
|
||||
feedProvenanceEnvelope,
|
||||
layerSnapshot,
|
||||
@@ -104,12 +104,12 @@ export function getWorldPacket(options = {}) {
|
||||
// A default parameter only covers undefined; null or NaN would age every
|
||||
// feed against the epoch and report stale data as "just now".
|
||||
const now = Number.isFinite(requestedNow) ? requestedNow : Date.now();
|
||||
if (!viewer?.camera?.positionWC)
|
||||
throw new TypeError('World Packet requires a viewer camera');
|
||||
const pose = findCamera(viewer)?.pose();
|
||||
if (!pose) throw new TypeError('World Packet requires a viewer camera');
|
||||
if (!dataManager || typeof dataManager.getAll !== 'function')
|
||||
throw new TypeError('World Packet requires a data manager');
|
||||
|
||||
const eye = toLonLatH(viewer.camera.positionWC);
|
||||
const eye = { lon: pose.lon, lat: pose.lat, height: pose.height };
|
||||
// Read the roster once. Voice must not rewalk disabled layers: preserving the
|
||||
// current enabled-only view keeps the model's context budget bounded.
|
||||
const rows = dataManager.getAll();
|
||||
|
||||
Reference in new issue
Block a user