Keep shape radii, rim gradients, depth-fail looks, sweep cadence and step camera moves out of the renderer contract

Shapes take their radii in metres; the world annotation ring follows the
camera height itself (ringRadiusAt), resizing on preRender. The radial rim
preset and depthBias go: the launch pad zone draws a canvas image fill made
by the layer. Solid and dashed lines take one depthFail look (solid or
dash) in place of depthFailColor and depthFailDash. sonarCadenceHz goes from
the quality settings: nothing set it, and the sweep moves every 80 ms.

Camera move, look, rotateAround and zoom leave the camera port: the app's pans,
in-place turns, globe turns and zooms are setView views summed over the pose
(geo/eyeMoves), and the Cesium port places a view by direction and up
exactly rather than through heading, pitch and roll. The conformance driver
runs those script steps through setView; the lookAt script turns in place
where it turned about the frame-local axis, and its reference is recorded
again.
This commit is contained in:
Sameh Khamis committed 2026-11-10 04:08:41 -08:00
1 parent 7a376ebefc
commit c8346c9fda
44 files changed
+810 -799

No files matched your search

+22
View File
@@ -107,8 +107,16 @@ export function bindFakeCesiumCamera(viewer, ports = {}) {
return fly.apply(this, args);
};
const keepsFlight = '_currentFlight' in fake;
// The port places a view by direction and up on the camera's own vectors;
// a fake without them gets scratch ones, and the view is handed to its
// `setView` as Cesium's setView would have had it.
const placesOnSetView = !('position' in fake) && Boolean(fake.setView);
const placed = placesOnSetView
? { position: {}, direction: {}, up: {}, right: {} }
: null;
const camera = new Proxy(fake, {
get(target, key, receiver) {
if (placed && Object.hasOwn(placed, key)) return placed[key];
if ((key === 'moveStart' || key === 'moveEnd') && !target[key])
return noEvent;
if (!keepsFlight) {
@@ -175,6 +183,20 @@ export function bindFakeCesiumCamera(viewer, ports = {}) {
};
},
},
setView: {
value(spec) {
real.setView(spec);
const o = spec?.orientation;
if (placed && spec?.destination && o && 'direction' in o)
fake.setView({
destination: { ...placed.position },
orientation: {
direction: { ...placed.direction },
up: { ...placed.up },
},
});
},
},
// A fake that computes a view rectangle answers with it, as the
// renderer does; one that does not has none.
viewRectangle: {
+12 -9
View File
@@ -76,17 +76,20 @@ export function nativeIntegrationFixture(t) {
positionCartographic: { height: state.height },
moveEnd: { addEventListener() {} },
cancelFlight() {},
zoomIn(metres) {
position.x -= metres;
// Looking straight down at the surface along -x.
directionWC: { x: -1, y: 0, z: 0 },
upWC: { x: 0, y: 0, z: 1 },
rightWC: { x: 0, y: 1, z: 0 },
setView({ destination }) {
const metres = position.x - destination.x;
position.x = destination.x;
state.height -= metres;
this.positionCartographic.height = state.height;
state.zooms.push({ direction: 'in', metres });
},
zoomOut(metres) {
position.x += metres;
state.height += metres;
this.positionCartographic.height = state.height;
state.zooms.push({ direction: 'out', metres });
state.zooms.push(
metres < 0
? { direction: 'out', metres: -metres }
: { direction: 'in', metres },
);
},
},
scene: {