mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Orbit, move, look and zoom through the camera port
The Cesium camera port gains move, look, rotateAround and zoom, and the browser conformance run now checks them, the lookAt-frame commands, the changed thresholds and moveEnd (timed by the clock, not a frame count). Orbit, the Bhote Koshi focus and cinematic, the launch zoom anchor and replay chase, the camera verbs' motion tick and roll levelling, and voice zoom write through the port.
This commit is contained in:
1 parent
c722593791
commit
21d23034ec
19 files changed
+174
-112
No files matched your search
+23
-18
@@ -29,6 +29,8 @@ import { formatDate, t, tn, msg, onLocaleChange } from '../i18n/index.js';
|
||||
import { useBhoteKoshiPanelStore } from '../ui/stores/bhoteKoshiPanel.js';
|
||||
import { applicationPinia } from '../ui/vueRuntime.js';
|
||||
import { heightsFor } from '../queries/heights.js';
|
||||
import { cameraOf } from '../render/cesium/camera.js';
|
||||
import { findCamera } from '../render/rendererOf.js';
|
||||
|
||||
export const BHOTE_KOSHI_LAYER_ID = 'bhote-koshi-2026';
|
||||
export const BHOTE_KOSHI_OVERLAY_SOURCE_ID = 'bhote-koshi-witnesses';
|
||||
@@ -888,20 +890,24 @@ function focusView(viewer, viewpoint) {
|
||||
viewpoint.lat,
|
||||
viewpoint.targetElevationM,
|
||||
);
|
||||
const offset = new Cesium.HeadingPitchRange(
|
||||
Cesium.Math.toRadians(viewpoint.headingDeg),
|
||||
Cesium.Math.toRadians(viewpoint.pitchDeg),
|
||||
viewpoint.rangeM,
|
||||
);
|
||||
viewer.camera.cancelFlight?.();
|
||||
viewer.camera.flyToBoundingSphere(new Cesium.BoundingSphere(target, 80), {
|
||||
offset,
|
||||
duration: 2.2,
|
||||
complete: () => {
|
||||
viewer.camera.lookAt(target, offset);
|
||||
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
|
||||
const offset = {
|
||||
heading: Cesium.Math.toRadians(viewpoint.headingDeg),
|
||||
pitch: Cesium.Math.toRadians(viewpoint.pitchDeg),
|
||||
range: viewpoint.rangeM,
|
||||
};
|
||||
const camera = cameraOf(viewer);
|
||||
camera.cancelFlight();
|
||||
camera.flyToBounds(
|
||||
{ center: target, radius: 80 },
|
||||
{
|
||||
offset,
|
||||
durationS: 2.2,
|
||||
onComplete: () => {
|
||||
camera.lookAt(target, offset);
|
||||
camera.release();
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
function setElementProperty(element, property, value) {
|
||||
@@ -1045,7 +1051,7 @@ export function createBhoteKoshiEventLayer({
|
||||
let _cinematicActive = false;
|
||||
let _cinematicReplayArmed = false;
|
||||
let _cinematicPose = { target: new Cesium.Cartesian3() };
|
||||
let _cinematicOffset = new Cesium.HeadingPitchRange();
|
||||
const _cinematicOffset = { heading: 0, pitch: 0, range: 0 };
|
||||
let _lastCinematicProgress = null;
|
||||
let _cameraInputTarget = null;
|
||||
let _evidenceClickTarget = null;
|
||||
@@ -2626,7 +2632,7 @@ export function createBhoteKoshiEventLayer({
|
||||
_cinematicOffset.heading = Cesium.Math.toRadians(pose.headingDeg);
|
||||
_cinematicOffset.pitch = Cesium.Math.toRadians(pose.pitchDeg);
|
||||
_cinematicOffset.range = pose.rangeM;
|
||||
_viewer.camera.lookAt(pose.target, _cinematicOffset);
|
||||
findCamera(_viewer)?.lookAt(pose.target, _cinematicOffset);
|
||||
_lastCinematicProgress = _progress;
|
||||
}
|
||||
|
||||
@@ -2696,7 +2702,7 @@ export function createBhoteKoshiEventLayer({
|
||||
_cinematicActive = true;
|
||||
_lastCinematicProgress = null;
|
||||
announceNavigationAuthority('bhote-koshi-cinematic');
|
||||
_viewer?.camera?.cancelFlight?.();
|
||||
findCamera(_viewer)?.cancelFlight();
|
||||
}
|
||||
syncCinematicButton();
|
||||
return true;
|
||||
@@ -2713,8 +2719,7 @@ export function createBhoteKoshiEventLayer({
|
||||
}
|
||||
_cinematicActive = false;
|
||||
_lastCinematicProgress = null;
|
||||
if (releaseCamera)
|
||||
_viewer?.camera?.lookAtTransform?.(Cesium.Matrix4.IDENTITY);
|
||||
if (releaseCamera) findCamera(_viewer)?.release();
|
||||
syncCinematicButton();
|
||||
renderHost.request('bhote-koshi-cinematic-stop');
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { bindFakeCesiumCamera } from '../testSupport/fakeCameraPort.mjs';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import test from 'node:test';
|
||||
@@ -239,7 +240,7 @@ function eventViewer(splitPosition = 0.37) {
|
||||
const canvas = new FakeElement('canvas');
|
||||
const cameraLooks = [];
|
||||
const cameraTransforms = [];
|
||||
return {
|
||||
return bindFakeCesiumCamera({
|
||||
scene: { splitPosition, canvas },
|
||||
camera: {
|
||||
cancelFlight() {},
|
||||
@@ -272,7 +273,7 @@ function eventViewer(splitPosition = 0.37) {
|
||||
cameraLooks,
|
||||
cameraTransforms,
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
test('public lifecycle restores Nepal scene ownership without forwarding origin to enable', async () => {
|
||||
|
||||
Reference in new issue
Block a user