fix(cockpit): the orbital view gives the field of view back on exit

Cesium's fov was saved and put back when the orbital view closed, so a
later resize or rotation kept Cesium's own behaviour. The exit held the
saved vertical angle through setFov instead, which the camera port kept
for the rest of the session: rotated to portrait, the view stayed
zoomed in. setFov(null) gives the field of view back: Cesium's fov as it
was before the first hold, the stub's own angle.
This commit is contained in:
Sameh Khamis committed 2026-11-14 01:45:27 -08:00
1 parent 03a7d8827a
commit 4a781f0480
6 files changed
+52 -12

No files matched your search

+4 -1
View File
@@ -917,9 +917,10 @@ export function cameraChecks() {
{
id: 'camera.fov',
port: 'camera',
title: 'setFov sets the vertical field of view',
title: 'setFov sets the vertical field of view; null gives it back',
async run(h) {
const r = await fresh(h);
const own = r.camera.pose().fovy;
r.camera.setFov({ vertical: 0.5 });
near(r.camera.pose().fovy, 0.5, 1e-12, 'fovy');
near(
@@ -928,6 +929,8 @@ export function cameraChecks() {
1e-9,
'aspect',
);
r.camera.setFov(null);
near(r.camera.pose().fovy, own, 1e-9, 'the renderer’s own again');
r.destroy();
},
},