mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Drive the camera verbs through the camera and frame ports and take them off the Cesium list
The verbs' motions run on the frame port's preUpdate, which Cesium raises right after the clock tick they used to run on; a renderer bound after the verbs started is picked up when the next motion starts. They read the camera from its port's pose, wait for a flight through its `flying`, and frame an orbit from the pose with the geo maths. Globe rotation tests the keyhole fit from the pose and the port's projection matrix (a centred perspective one) instead of Cesium's frustum, and checks the Globe View preset by computing its pose rather than cloning a Cesium camera. The contract's renderer is a 3D WGS84 globe, so the scene-mode and non-WGS84 refusals go with their tests. At the start the captured pose is written back through setView only when the camera handoff changed it (a route's bank levelled), instead of copying the basis into Cesium's camera. The verbs still read the viewer's canvas for its size and listen on it for the user's input.
This commit is contained in:
1 parent
2c7f882bd2
commit
491c58cdc6
6 files changed
+227
-264
No files matched your search
@@ -71,7 +71,7 @@ export function fakeCameraPort({ pose = {}, viewRectangle = null } = {}) {
|
||||
* port's commands reach the fake camera as the renderer maps them
|
||||
* (`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
|
||||
* `roll`, the frustum's `fovy`, `aspectRatio`, `near` and `far`) and events come from the fake's own `changed`, `moveStart` and
|
||||
* `moveEnd`. A fake with `trackedEntityChanged` and `entities` follows
|
||||
* through the port, as the renderer does. Its credits are the renderer's
|
||||
* credits port over the fake's `creditDisplay`, if it has one; `ports`
|
||||
@@ -159,6 +159,12 @@ export function bindFakeCesiumCamera(viewer, ports = {}) {
|
||||
...(Number.isFinite(fake.frustum?.aspectRatio)
|
||||
? { aspectRatio: fake.frustum.aspectRatio }
|
||||
: {}),
|
||||
...(typeof fake.frustum?.near === 'number'
|
||||
? { near: fake.frustum.near }
|
||||
: {}),
|
||||
...(typeof fake.frustum?.far === 'number'
|
||||
? { far: fake.frustum.far }
|
||||
: {}),
|
||||
lon: c ? toDegrees(c.longitude) : NaN,
|
||||
lat: c ? toDegrees(c.latitude) : NaN,
|
||||
height: c ? c.height : NaN,
|
||||
|
||||
Reference in new issue
Block a user