Add pointer-driven camera scripts with Cesium goldens, and count wheel lines as Cesium does

Five new camera conformance scripts move the camera by user input: a
left drag that coasts, thirty pixel-mode and thirty line-mode wheel
notches from 5 km, a middle-drag tilt, and Shift and Ctrl drags held too
long to coast. The runner turns input steps into pointer events for a
driver: a move starts where the pointer last pressed or moved and carries
the held button. The golden recorder now drives Cesium's own screen-space
camera controller on a stand-in canvas, with Date on the virtual clock so
inertia is deterministic. The existing goldens are unchanged.

A harness that answers pointer input sets cameraInput and a pointer hook.
Harnesses without it, such as the stub, skip the input scripts.

The input port reported a line-mode wheel at 33 1/3 pixels a line. It now
counts lines as the reference does, 40 pixels a line and 3 lines a page,
so a pixel or line wheel converts back to the same pixels.
This commit is contained in:
Sameh Khamis committed 2026-11-08 20:08:56 -08:00
1 parent ef616b7905
commit 90499762f5
16 files changed
+1055 -38

No files matched your search

+19 -2
View File
@@ -207,8 +207,9 @@ renderer under test:
- `tolerance` and `flightPaths`.
Optional members widen what is checked: `pointer` for synthetic input,
`scriptHeights`, `assets.model`, and `assets.missingModel` (a model url
that fails to load, for the `loadFailed` check).
`cameraInput` (the camera answers that input: the drag and wheel traces
run), `scriptHeights`, `assets.model`, and `assets.missingModel` (a model
url that fails to load, for the `loadFailed` check).
There are two layers of checks.
@@ -232,6 +233,22 @@ match each recorded pose:
screen;
- with every flight ending within one frame of the recording.
Some scripts move the camera by user input: left, middle, Shift and Ctrl
drags, and wheels in pixel and line mode. The recorder runs those on
Cesium's own `ScreenSpaceCameraController`, fed the DOM events the script
describes, with `Date` on the virtual clock too (its coasting reads it). A
renderer under test gets them through its harness's `pointer`, a wheel as
the input port's lines. Only a harness with `cameraInput` runs them: the
stub's camera takes no gestures, so it skips them; a camera controller
over the stub would run them. `cameraPort.test.mjs` runs them on Cesium's
controls under the Cesium camera port, each wheel sent back as lines.
A wheel's `delta` is lines as Cesium counts them: a pixel-mode wheel at
40 px a line and a page at 3 lines (`src/render/input/wheel.js`). Turning
lines back into pixels at 40 px a line gives Cesium's own wheel in every
mode, so a controller that does that zooms as Cesium does in Chrome (pixel
mode) and Firefox (line mode) alike.
`src/render/cesium/cameraGoldens.test.mjs` fails when the installed Cesium
no longer records the committed traces. After a Cesium upgrade or a script
change, run `node scripts/record-camera-goldens.mjs` and review the diff.