mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Merge main through #1532 into the renderer seam
Brings in voice camera tilt (#1520) and free look with globe-in-view recovery (#1532). The tilt and look maths in cameraVerbs.js and globeInView.js run on camera poses and the geo helpers instead of Cesium. The free-look height limit lives in the Cesium adapter (render/cesium/freeLookLimit.js), installed through the application viewer hooks; the globe-in-view recovery that main added to app/viewer.js runs on the camera port in app/globeInViewRecovery.js. The scene-mode checks are gone with the 2D and Columbus modes the seam does not draw.
This commit is contained in:
commit
96764f85ca
28 files changed
+4764
-145
No files matched your search
@@ -6,7 +6,7 @@
|
||||
export class ShellFacade {
|
||||
/** Observe camera ownership transfers through the navigation owner. */
|
||||
subscribeCameraHandoff(listener) {
|
||||
return this._navigation.subscribeCameraHandoff(listener);
|
||||
return this._navigation?.subscribeCameraHandoff(listener);
|
||||
}
|
||||
|
||||
get _models3dEnabled() {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { ShellFacade } from './shellFacade.js';
|
||||
|
||||
// A shell assembled without its navigation owner (as unit tests build one
|
||||
// from the prototype) has no handoffs to report, like the facade's other
|
||||
// optional owners; the voice runner subscribes as it is created.
|
||||
test('camera handoffs without a navigation owner subscribe to nothing', () => {
|
||||
const shell = Object.create(ShellFacade.prototype);
|
||||
assert.equal(
|
||||
shell.subscribeCameraHandoff(() => {}),
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
|
||||
test('camera handoffs reach listeners through the navigation owner', () => {
|
||||
const listeners = new Set();
|
||||
const shell = Object.create(ShellFacade.prototype);
|
||||
shell._navigation = {
|
||||
subscribeCameraHandoff(listener) {
|
||||
listeners.add(listener);
|
||||
return () => listeners.delete(listener);
|
||||
},
|
||||
};
|
||||
let handoffs = 0;
|
||||
const unsubscribe = shell.subscribeCameraHandoff(() => {
|
||||
handoffs += 1;
|
||||
});
|
||||
for (const listener of listeners) listener();
|
||||
assert.equal(handoffs, 1);
|
||||
unsubscribe();
|
||||
assert.equal(listeners.size, 0);
|
||||
});
|
||||
Reference in new issue
Block a user