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
@@ -26,6 +26,7 @@ import { presentResult } from './resultDisplay.js';
|
||||
import { attachVoiceResult } from './speech.js';
|
||||
import { withEntityRecord } from '../data/entityRecords.js';
|
||||
import { bindFakeCesiumCamera } from '../testSupport/fakeCameraPort.mjs';
|
||||
import { cameraOf } from '../render/rendererOf.js';
|
||||
|
||||
test('every live basemap is reachable by its own id — no enum value without a voice alias', () => {
|
||||
// B1 regression: a stack added to MAP_STACKS (and the set_map_stack enum)
|
||||
@@ -581,7 +582,9 @@ test('a chained orbit preserves its current destination flight while still stamp
|
||||
globalThis.window = globalThis.window || { clearTimeout, setTimeout, requestIdleCallback: null };
|
||||
const { order, viewer, styleManager } = createVoiceNavigationHarness();
|
||||
viewer.trackedEntity = undefined;
|
||||
viewer.scene.tweens.push({ id: 'destination-flight' });
|
||||
// The destination flight, still in progress.
|
||||
cameraOf(viewer).flyToBounds({ center: { x: 0, y: 0, z: 0 }, radius: 10 });
|
||||
order.length = 0;
|
||||
const runner = createGevActionRunner({
|
||||
viewer,
|
||||
styleManager,
|
||||
@@ -591,7 +594,7 @@ test('a chained orbit preserves its current destination flight while still stamp
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.armed, 'waiting-for-arrival');
|
||||
assert.deepEqual(order, ['stamp:camera', 'release']);
|
||||
assert.equal(viewer.scene.tweens.length, 1);
|
||||
assert.equal(cameraOf(viewer).flying, true);
|
||||
interruptCameraMotion('test-cleanup');
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user