mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
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:
1 parent
ef616b7905
commit
90499762f5
16 files changed
+1055
-38
No files matched your search
@@ -5,6 +5,14 @@
|
||||
* either a renderer through the contract ({@link contractDriver}) or the
|
||||
* reference recorder's own.
|
||||
*/
|
||||
import { wheelLines } from '../input/wheel.js';
|
||||
|
||||
const NO_MODIFIERS = Object.freeze({
|
||||
shift: false,
|
||||
ctrl: false,
|
||||
alt: false,
|
||||
meta: false,
|
||||
});
|
||||
|
||||
/**
|
||||
* @typedef {object} CameraDriver
|
||||
@@ -18,6 +26,20 @@
|
||||
* @property {(position: object) => boolean} occluded
|
||||
* @property {() => boolean} flying
|
||||
* @property {(position: object) => object} toEcef
|
||||
* @property {(ev: ScriptPointer) => void|Promise<void>} [pointer] For scripts with `input` steps.
|
||||
*/
|
||||
|
||||
/**
|
||||
* A script's pointer event: `position` is where it happened (for a move,
|
||||
* where the pointer was) and `endPosition` where a move went; a wheel has
|
||||
* the DOM's `deltaY` and `deltaMode`.
|
||||
* @typedef {object} ScriptPointer
|
||||
* @property {'down'|'move'|'up'|'wheel'} type
|
||||
* @property {{x: number, y: number}} position
|
||||
* @property {{x: number, y: number}} [endPosition]
|
||||
* @property {0|1|2} button
|
||||
* @property {{shift: boolean, ctrl: boolean, alt: boolean, meta: boolean}} modifiers
|
||||
* @property {{deltaY: number, deltaMode: number}} [wheel]
|
||||
*/
|
||||
|
||||
/** The parts of a pose a trace keeps. */
|
||||
@@ -47,8 +69,33 @@ export async function runCameraScript(driver, script) {
|
||||
const flights = [];
|
||||
const listeners = [];
|
||||
let frame = 0;
|
||||
// Where the pointer is, for the next move's start, and the button held
|
||||
// since the last press (a move carries it, as an input port reports it).
|
||||
// Only a press or a move puts the pointer somewhere, as in the reference:
|
||||
// a wheel or a release elsewhere leaves the next move starting where the
|
||||
// pointer last went.
|
||||
let pointerAt = null;
|
||||
let held = null;
|
||||
for (const [index, step] of script.steps.entries()) {
|
||||
if (step.do === 'frames') {
|
||||
if (step.input) {
|
||||
const at = { x: step.x, y: step.y };
|
||||
const ev = {
|
||||
type: step.input,
|
||||
position: step.input === 'move' ? (pointerAt ?? at) : at,
|
||||
...(step.input === 'move' ? { endPosition: at } : {}),
|
||||
button: step.button ?? (step.input === 'move' ? held : null) ?? 0,
|
||||
modifiers: { ...NO_MODIFIERS, ...(step.modifiers ?? {}) },
|
||||
...(step.input === 'wheel'
|
||||
? { wheel: { deltaY: step.deltaY, deltaMode: step.deltaMode ?? 0 } }
|
||||
: {}),
|
||||
};
|
||||
if (step.input === 'down' || step.input === 'move') pointerAt = at;
|
||||
if (step.input === 'down') held = ev.button;
|
||||
else if (step.input === 'up') held = null;
|
||||
if (!driver.pointer)
|
||||
throw new Error('this driver takes no pointer input');
|
||||
await driver.pointer(ev);
|
||||
} else if (step.do === 'frames') {
|
||||
for (let i = 0; i < step.count; i++) {
|
||||
frame += 1;
|
||||
await driver.frame();
|
||||
@@ -143,7 +190,10 @@ function resolveArgs(driver, name, args) {
|
||||
/**
|
||||
* A driver over a renderer, through the contract only.
|
||||
* @param {import('../contract/renderer').Renderer} renderer
|
||||
* @param {{frame: () => void|Promise<void>, toEcef: (p: object) => object}} hooks
|
||||
* `hooks.pointer(type, x, y, extra)` sends a pointer event the way a
|
||||
* harness's `pointer` does; a wheel goes as the input port's lines.
|
||||
* @param {{frame: () => void|Promise<void>, toEcef: (p: object) => object,
|
||||
* pointer?: (type: string, x: number, y: number, extra: object) => void|Promise<void>}} hooks
|
||||
* @returns {CameraDriver}
|
||||
*/
|
||||
export function contractDriver(renderer, hooks) {
|
||||
@@ -167,5 +217,16 @@ export function contractDriver(renderer, hooks) {
|
||||
matrices: () => camera.matrices(),
|
||||
viewRectangle: () => camera.viewRectangle(),
|
||||
toEcef: hooks.toEcef,
|
||||
...(hooks.pointer
|
||||
? {
|
||||
pointer: (ev) =>
|
||||
hooks.pointer(ev.type, ev.position.x, ev.position.y, {
|
||||
button: ev.button,
|
||||
modifiers: ev.modifiers,
|
||||
...(ev.endPosition ? { endPosition: ev.endPosition } : {}),
|
||||
...(ev.wheel ? { delta: wheelLines(ev.wheel) } : {}),
|
||||
}),
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { runCameraScript } from './cameraRunner.js';
|
||||
|
||||
/** A driver that only keeps the pointer events the runner sends. */
|
||||
const pointerDriver = () => {
|
||||
const events = [];
|
||||
return {
|
||||
events,
|
||||
driver: {
|
||||
pointer: async (ev) => {
|
||||
events.push(ev);
|
||||
},
|
||||
frame: async () => {},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
test('a move starts where the pointer last pressed or moved, not at a wheel or release', async () => {
|
||||
const { events, driver } = pointerDriver();
|
||||
await runCameraScript(driver, {
|
||||
name: 'origins',
|
||||
steps: [
|
||||
{ input: 'down', x: 10, y: 10, button: 1 },
|
||||
{ input: 'wheel', x: 20, y: 20, deltaY: -100 },
|
||||
{ input: 'move', x: 30, y: 30 },
|
||||
{ input: 'up', x: 40, y: 40 },
|
||||
{ input: 'move', x: 50, y: 50 },
|
||||
],
|
||||
});
|
||||
const [, wheel, held, up, free] = events;
|
||||
assert.deepEqual(wheel.wheel, { deltaY: -100, deltaMode: 0 });
|
||||
assert.deepEqual(held.position, { x: 10, y: 10 });
|
||||
assert.deepEqual(held.endPosition, { x: 30, y: 30 });
|
||||
assert.equal(held.button, 1, 'a move carries the held button');
|
||||
assert.equal(up.button, 0);
|
||||
assert.deepEqual(free.position, { x: 30, y: 30 });
|
||||
assert.equal(free.button, 0, 'nothing is held after the release');
|
||||
});
|
||||
|
||||
test('a first move with no earlier pointer starts where it ends', async () => {
|
||||
const { events, driver } = pointerDriver();
|
||||
await runCameraScript(driver, {
|
||||
name: 'first',
|
||||
steps: [{ input: 'move', x: 5, y: 6 }],
|
||||
});
|
||||
assert.deepEqual(events[0].position, { x: 5, y: 6 });
|
||||
assert.deepEqual(events[0].endPosition, { x: 5, y: 6 });
|
||||
});
|
||||
@@ -19,6 +19,16 @@
|
||||
* `{ record: 'pickEllipsoid', screen }`, `{ record: 'pickRay', screen }`,
|
||||
* `{ record: 'occluded', points }`, `{ record: 'changed' }`,
|
||||
* `{ record: 'flying' }`, `{ record: 'matrices' }`, `{ record: 'viewRectangle' }`.
|
||||
* - `{ input: 'down' | 'move' | 'up', x, y, button?, modifiers? }`: the
|
||||
* pointer, in CSS pixels; a move goes from where the pointer last was.
|
||||
* - `{ input: 'wheel', x, y, deltaY, deltaMode?, modifiers? }`: a wheel as
|
||||
* the DOM gives it (`deltaMode` 0 pixels, 1 lines, 2 pages); a renderer
|
||||
* under test gets it as the input port's lines (`render/input/wheel.js`).
|
||||
*
|
||||
* A script with `input` steps moves the camera by user input, so it runs
|
||||
* only where the renderer's camera answers pointer input (a harness with
|
||||
* `pointer` and `cameraInput`). It starts with a frame, as a pointer event
|
||||
* on the reference's clock at 0 would be dropped.
|
||||
*/
|
||||
|
||||
/** Where the scripts, scenes and checks look: downtown Austin, degrees. */
|
||||
@@ -60,9 +70,52 @@ const SCREEN_GRID = [
|
||||
{ x: 320, y: 540 },
|
||||
];
|
||||
|
||||
/** A drag from `from` to `to` in `moves` moves, a frame after each. */
|
||||
const drag = ({
|
||||
from,
|
||||
to,
|
||||
moves = 10,
|
||||
button = 0,
|
||||
modifiers,
|
||||
holdFrames = 0,
|
||||
}) => {
|
||||
const mods = modifiers ? { modifiers } : {};
|
||||
const steps = [{ input: 'down', ...from, button, ...mods }];
|
||||
for (let i = 1; i <= moves; i++)
|
||||
steps.push(
|
||||
{
|
||||
input: 'move',
|
||||
x: from.x + ((to.x - from.x) * i) / moves,
|
||||
y: from.y + ((to.y - from.y) * i) / moves,
|
||||
...mods,
|
||||
},
|
||||
{ do: 'frames', count: 1 },
|
||||
);
|
||||
if (holdFrames) steps.push({ do: 'frames', count: holdFrames });
|
||||
steps.push({ input: 'up', ...to, button, ...mods });
|
||||
return steps;
|
||||
};
|
||||
|
||||
/**
|
||||
* `count` wheel notches at the centre, `frames` frames after each. The
|
||||
* reference zooms towards where the pointer last moved, not where the wheel
|
||||
* says it is, so a script moves the pointer to the centre first (`hover`).
|
||||
*/
|
||||
const notches = (count, deltaY, deltaMode, frames = 2) =>
|
||||
Array.from({ length: count }, () => [
|
||||
{ input: 'wheel', x: 640, y: 360, deltaY, deltaMode },
|
||||
{ do: 'frames', count: frames },
|
||||
]).flat();
|
||||
|
||||
/** The pointer moves to the centre with nothing held. */
|
||||
const hover = { input: 'move', x: 640, y: 360 };
|
||||
|
||||
/** The viewport every script runs in, CSS pixels. */
|
||||
export const SCRIPT_VIEWPORT = Object.freeze({ width: 1280, height: 720 });
|
||||
|
||||
/** Whether a script moves the camera by user input (`input` steps). */
|
||||
export const usesInput = (script) => script.steps.some((step) => step.input);
|
||||
|
||||
/** @type {ReadonlyArray<{name: string, steps: object[]}>} */
|
||||
export const CAMERA_SCRIPTS = Object.freeze([
|
||||
{
|
||||
@@ -442,6 +495,90 @@ export const CAMERA_SCRIPTS = Object.freeze([
|
||||
{ record: 'changed' },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'a left drag turns the globe under the pointer, then coasts',
|
||||
steps: [
|
||||
city(5000, 0.2, -1.2),
|
||||
{ do: 'frames', count: 1 },
|
||||
...drag({ from: { x: 640, y: 360 }, to: { x: 760, y: 420 } }),
|
||||
{ record: 'pose' },
|
||||
{ do: 'frames', count: 20 },
|
||||
{ record: 'pose' },
|
||||
{ do: 'frames', count: 60 },
|
||||
{ record: 'pose' },
|
||||
START,
|
||||
{ do: 'frames', count: 1 },
|
||||
...drag({ from: { x: 600, y: 300 }, to: { x: 500, y: 360 } }),
|
||||
{ do: 'frames', count: 60 },
|
||||
{ record: 'pose' },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'thirty pixel-mode wheel notches from 5 km, then out again',
|
||||
steps: [
|
||||
city(5000, 0.2, -1.2),
|
||||
{ do: 'frames', count: 1 },
|
||||
hover,
|
||||
...notches(10, -100, 0),
|
||||
{ record: 'pose' },
|
||||
...notches(10, -100, 0),
|
||||
{ record: 'pose' },
|
||||
...notches(10, -100, 0),
|
||||
{ record: 'pose' },
|
||||
{ do: 'frames', count: 60 },
|
||||
{ record: 'pose' },
|
||||
...notches(5, 100, 0),
|
||||
{ do: 'frames', count: 60 },
|
||||
{ record: 'pose' },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'thirty line-mode wheel notches from 5 km',
|
||||
steps: [
|
||||
city(5000, 0.2, -1.2),
|
||||
{ do: 'frames', count: 1 },
|
||||
hover,
|
||||
...notches(10, -3, 1),
|
||||
{ record: 'pose' },
|
||||
...notches(20, -3, 1),
|
||||
{ do: 'frames', count: 60 },
|
||||
{ record: 'pose' },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'a middle drag tilts about the centre, then coasts',
|
||||
steps: [
|
||||
city(2000, 0.3, -1.0),
|
||||
{ do: 'frames', count: 1 },
|
||||
...drag({ from: { x: 640, y: 360 }, to: { x: 640, y: 300 }, button: 1 }),
|
||||
{ record: 'pose' },
|
||||
{ do: 'frames', count: 60 },
|
||||
{ record: 'pose' },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'modified drags: Shift looks, Ctrl tilts, held too long to coast',
|
||||
steps: [
|
||||
city(2000, 0.3, -0.5),
|
||||
{ do: 'frames', count: 1 },
|
||||
...drag({
|
||||
from: { x: 640, y: 360 },
|
||||
to: { x: 700, y: 330 },
|
||||
modifiers: { shift: true },
|
||||
holdFrames: 30,
|
||||
}),
|
||||
{ do: 'frames', count: 10 },
|
||||
{ record: 'pose' },
|
||||
...drag({
|
||||
from: { x: 640, y: 360 },
|
||||
to: { x: 640, y: 320 },
|
||||
modifiers: { ctrl: true },
|
||||
holdFrames: 30,
|
||||
}),
|
||||
{ do: 'frames', count: 10 },
|
||||
{ record: 'pose' },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'projection, picks and the horizon',
|
||||
steps: [
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
* view rules the traces cannot show.
|
||||
*/
|
||||
import goldens from '../goldens/camera.json' with { type: 'json' };
|
||||
import { CAMERA_SCRIPTS, SCRIPT_VIEWPORT } from '../cameraScripts.js';
|
||||
import {
|
||||
CAMERA_SCRIPTS,
|
||||
SCRIPT_VIEWPORT,
|
||||
usesInput,
|
||||
} from '../cameraScripts.js';
|
||||
import { contractDriver, runCameraScript } from '../cameraRunner.js';
|
||||
import { deepEqual, equal, near, nearAngle, nearVec, ok } from '../expect.js';
|
||||
|
||||
@@ -136,6 +140,11 @@ export function cameraChecks() {
|
||||
async run(h) {
|
||||
const expected = goldens.scripts[script.name];
|
||||
ok(expected, `no reference trace for ${script.name}`);
|
||||
const input = usesInput(script);
|
||||
if (input && h.cameraInput && !h.pointer)
|
||||
throw new Error('a harness with cameraInput needs pointer');
|
||||
if (input && !h.cameraInput)
|
||||
return { skip: 'the harness has no camera that answers pointer input' };
|
||||
const r = await fresh(h);
|
||||
try {
|
||||
if (script.capability && !r.capabilities.has(script.capability))
|
||||
@@ -144,6 +153,12 @@ export function cameraChecks() {
|
||||
contractDriver(r, {
|
||||
frame: () => h.frame(r),
|
||||
toEcef: lonLatToEcef(h),
|
||||
...(input
|
||||
? {
|
||||
pointer: (type, x, y, extra) =>
|
||||
h.pointer(r, type, x, y, extra),
|
||||
}
|
||||
: {}),
|
||||
}),
|
||||
script,
|
||||
);
|
||||
|
||||
@@ -2312,6 +2312,496 @@
|
||||
],
|
||||
"flights": []
|
||||
},
|
||||
"a left drag turns the globe under the pointer, then coasts": {
|
||||
"records": [
|
||||
{
|
||||
"step": 24,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -743874.2827583898,
|
||||
"y": -5467123.5663921,
|
||||
"z": 3198867.771901153
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.20397712796409123,
|
||||
"y": 0.9652906415976404,
|
||||
"z": -0.1631174684438692
|
||||
},
|
||||
"up": {
|
||||
"x": 0.2033249113752558,
|
||||
"y": 0.12121518562266298,
|
||||
"z": 0.9715790545234638
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9576284831195057,
|
||||
"y": -0.2313457499468691,
|
||||
"z": -0.17154250872525903
|
||||
},
|
||||
"heading": 0.19995498090715547,
|
||||
"pitch": -1.1999997631348354,
|
||||
"roll": 6.283185067768231,
|
||||
"height": 5001.202022602089,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 26,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -744179.2414489042,
|
||||
"y": -5466945.298349385,
|
||||
"z": 3199101.5023454726
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.2040230499283474,
|
||||
"y": 0.9652742041266187,
|
||||
"z": -0.1631573042975954
|
||||
},
|
||||
"up": {
|
||||
"x": 0.20331111154933998,
|
||||
"y": 0.12125033636499621,
|
||||
"z": 0.971577556272245
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9576216304044657,
|
||||
"y": -0.231395909166732,
|
||||
"z": -0.1715131079608628
|
||||
},
|
||||
"heading": 0.199925453927559,
|
||||
"pitch": -1.199999607856077,
|
||||
"roll": 6.2831849106714515,
|
||||
"height": 5001.990172385319,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 28,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -744372.9914909918,
|
||||
"y": -5466832.025336116,
|
||||
"z": 3199249.992913194
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.20405222591363384,
|
||||
"y": 0.9652637587817955,
|
||||
"z": -0.1631826126832485
|
||||
},
|
||||
"up": {
|
||||
"x": 0.20330234482603304,
|
||||
"y": 0.1212726692625212,
|
||||
"z": 0.9715766034020066
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9576172751616003,
|
||||
"y": -0.23142777636313006,
|
||||
"z": -0.171494427430424
|
||||
},
|
||||
"heading": 0.19990669247367698,
|
||||
"pitch": -1.19999950921419,
|
||||
"roll": 6.283184810827273,
|
||||
"height": 5002.490919151834,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 54,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": 7805906.904869736,
|
||||
"y": -14670498.917206015,
|
||||
"z": 13440141.433819043
|
||||
},
|
||||
"direction": {
|
||||
"x": -0.3655537074410778,
|
||||
"y": 0.6843524703919436,
|
||||
"z": -0.6308979182439318
|
||||
},
|
||||
"up": {
|
||||
"x": 0.110917768366866,
|
||||
"y": 0.7050070428413021,
|
||||
"z": 0.7004729246763767
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9241578521208361,
|
||||
"y": 0.18608268541862594,
|
||||
"z": -0.3336247870749348
|
||||
},
|
||||
"heading": 0.443475027365972,
|
||||
"pitch": -1.5693855130982848,
|
||||
"roll": 0,
|
||||
"height": 15003040.278641503,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"flights": []
|
||||
},
|
||||
"thirty pixel-mode wheel notches from 5 km, then out again": {
|
||||
"records": [
|
||||
{
|
||||
"step": 23,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -742628.7924789503,
|
||||
"y": -5463700.648822847,
|
||||
"z": 3197887.172893453
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.20390710151866062,
|
||||
"y": 0.9653157014443385,
|
||||
"z": -0.1630567094457735
|
||||
},
|
||||
"up": {
|
||||
"x": 0.2033459565896657,
|
||||
"y": 0.12116157542641381,
|
||||
"z": 0.971581337088575
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9576389277221831,
|
||||
"y": -0.23126925689597005,
|
||||
"z": -0.17158733906058854
|
||||
},
|
||||
"heading": 0.20002548249494634,
|
||||
"pitch": -1.1997833418598227,
|
||||
"roll": 6.283184995415831,
|
||||
"height": 1432.7693523452285,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 44,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -742405.2309695639,
|
||||
"y": -5462642.287276622,
|
||||
"z": 3197708.399305835
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.20390710151866057,
|
||||
"y": 0.9653157014443385,
|
||||
"z": -0.1630567094457731
|
||||
},
|
||||
"up": {
|
||||
"x": 0.20334595658966526,
|
||||
"y": 0.12116157542641454,
|
||||
"z": 0.9715813370885751
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9576389277221832,
|
||||
"y": -0.2312692568959699,
|
||||
"z": -0.17158733906058796
|
||||
},
|
||||
"heading": 0.20003278999578278,
|
||||
"pitch": -1.1997212353912805,
|
||||
"roll": 6.283184906110748,
|
||||
"height": 410.9902001027421,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 65,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -742341.2056470874,
|
||||
"y": -5462339.185282548,
|
||||
"z": 3197657.2007044787
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.20390710151866076,
|
||||
"y": 0.9653157014443386,
|
||||
"z": -0.16305670944577244
|
||||
},
|
||||
"up": {
|
||||
"x": 0.20334595658966534,
|
||||
"y": 0.121161575426415,
|
||||
"z": 0.971581337088575
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9576389277221832,
|
||||
"y": -0.23126925689596994,
|
||||
"z": -0.17158733906058796
|
||||
},
|
||||
"heading": 0.20003488343521703,
|
||||
"pitch": -1.199703445182633,
|
||||
"roll": 6.28318488053483,
|
||||
"height": 118.36954505315934,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 67,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -742333.1507133974,
|
||||
"y": -5462301.052456831,
|
||||
"z": 3197650.759482114
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.20390710151866143,
|
||||
"y": 0.9653157014443386,
|
||||
"z": -0.16305670944577194
|
||||
},
|
||||
"up": {
|
||||
"x": 0.20334595658966512,
|
||||
"y": 0.12116157542641479,
|
||||
"z": 0.9715813370885751
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9576389277221832,
|
||||
"y": -0.23126925689597047,
|
||||
"z": -0.1715873390605877
|
||||
},
|
||||
"heading": 0.20003514682861567,
|
||||
"pitch": -1.199701206906512,
|
||||
"roll": 6.283184877317159,
|
||||
"height": 81.55550603363947,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 79,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -742361.5559644367,
|
||||
"y": -5462435.52562931,
|
||||
"z": 3197673.474074843
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.2039071015186621,
|
||||
"y": 0.9653157014443386,
|
||||
"z": -0.1630567094457709
|
||||
},
|
||||
"up": {
|
||||
"x": 0.2033459565896656,
|
||||
"y": 0.12116157542641448,
|
||||
"z": 0.971581337088575
|
||||
},
|
||||
"right": {
|
||||
"x": 0.957638927722183,
|
||||
"y": -0.23126925689597097,
|
||||
"z": -0.17158733906058815
|
||||
},
|
||||
"heading": 0.2000342180079615,
|
||||
"pitch": -1.199709099940855,
|
||||
"roll": 6.283184888664081,
|
||||
"height": 211.37819848930863,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"flights": []
|
||||
},
|
||||
"thirty line-mode wheel notches from 5 km": {
|
||||
"records": [
|
||||
{
|
||||
"step": 23,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -742556.7099509701,
|
||||
"y": -5463359.40324807,
|
||||
"z": 3197829.5312530524
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.20390710151866023,
|
||||
"y": 0.9653157014443386,
|
||||
"z": -0.1630567094457732
|
||||
},
|
||||
"up": {
|
||||
"x": 0.203345956589666,
|
||||
"y": 0.12116157542641305,
|
||||
"z": 0.9715813370885751
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9576389277221831,
|
||||
"y": -0.2312692568959697,
|
||||
"z": -0.17158733906058904
|
||||
},
|
||||
"heading": 0.20002783824820192,
|
||||
"pitch": -1.1997633191576402,
|
||||
"roll": 6.283184966621368,
|
||||
"height": 1103.3162549917931,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 65,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -742322.8917203792,
|
||||
"y": -5462252.485403653,
|
||||
"z": 3197642.555757815
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.20390710151865987,
|
||||
"y": 0.9653157014443383,
|
||||
"z": -0.16305670944577555
|
||||
},
|
||||
"up": {
|
||||
"x": 0.20334595658966786,
|
||||
"y": 0.12116157542641243,
|
||||
"z": 0.9715813370885749
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9576389277221826,
|
||||
"y": -0.23126925689597005,
|
||||
"z": -0.17158733906059095
|
||||
},
|
||||
"heading": 0.20003548230067558,
|
||||
"pitch": -1.1996983561368815,
|
||||
"roll": 6.2831848732190485,
|
||||
"height": 34.668143935951555,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"flights": []
|
||||
},
|
||||
"a middle drag tilts about the centre, then coasts": {
|
||||
"records": [
|
||||
{
|
||||
"step": 24,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -743241.7317811222,
|
||||
"y": -5464487.455673964,
|
||||
"z": 3195978.047404553
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.3675783291212823,
|
||||
"y": 0.81316539817522,
|
||||
"z": 0.4512739823776041
|
||||
},
|
||||
"up": {
|
||||
"x": 0.08270178763465089,
|
||||
"y": -0.5119037171950899,
|
||||
"z": 0.8550526291661131
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9263080407091582,
|
||||
"y": -0.27697765168400346,
|
||||
"z": -0.2554149451092779
|
||||
},
|
||||
"heading": 0.3008134433902425,
|
||||
"pitch": -0.5367351449364697,
|
||||
"roll": 6.282589696577563,
|
||||
"height": 1215.0821198795002,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 26,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -743241.80671276,
|
||||
"y": -5463765.475245942,
|
||||
"z": 3195201.3342659683
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.36760985348731867,
|
||||
"y": 0.5094221457939676,
|
||||
"z": 0.7780437474806298
|
||||
},
|
||||
"up": {
|
||||
"x": -0.0855345107763599,
|
||||
"y": -0.8145571574843389,
|
||||
"z": 0.5737425247071049
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9260382514158263,
|
||||
"y": -0.2774629967503845,
|
||||
"z": -0.2558660633007341
|
||||
},
|
||||
"heading": 0.3012445916881008,
|
||||
"pitch": -0.08686439532730006,
|
||||
"roll": 6.282451156320272,
|
||||
"height": 205.77116965382524,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"flights": []
|
||||
},
|
||||
"modified drags: Shift looks, Ctrl tilts, held too long to coast": {
|
||||
"records": [
|
||||
{
|
||||
"step": 26,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -743060.1500720647,
|
||||
"y": -5464827.966102482,
|
||||
"z": 3196999.1724985815
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.3198554534385449,
|
||||
"y": 0.8196936321897058,
|
||||
"z": 0.4751787434779361
|
||||
},
|
||||
"up": {
|
||||
"x": 0.07739593213172483,
|
||||
"y": -0.5224541754567694,
|
||||
"z": 0.8491475161815223
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9442999304220479,
|
||||
"y": -0.2348275620437983,
|
||||
"z": -0.23055076991734758
|
||||
},
|
||||
"heading": 0.2406372218166659,
|
||||
"pitch": -0.5226924574159404,
|
||||
"roll": 0.028997148507913906,
|
||||
"height": 2000.0000000013995,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 51,
|
||||
"kind": "pose",
|
||||
"value": {
|
||||
"position": {
|
||||
"x": -743061.3004932855,
|
||||
"y": -5464044.082279529,
|
||||
"z": 3196047.0359984883
|
||||
},
|
||||
"direction": {
|
||||
"x": 0.3201424713636519,
|
||||
"y": 0.6241229075555551,
|
||||
"z": 0.712726731849994
|
||||
},
|
||||
"up": {
|
||||
"x": -0.02221334720207947,
|
||||
"y": -0.7471697869219248,
|
||||
"z": 0.66426190370751
|
||||
},
|
||||
"right": {
|
||||
"x": 0.9471089510902393,
|
||||
"y": -0.22849049384043377,
|
||||
"z": -0.22533692327113536
|
||||
},
|
||||
"heading": 0.2408776874059173,
|
||||
"pitch": -0.21383964601254024,
|
||||
"roll": 0.028905924656936755,
|
||||
"height": 849.3858537714274,
|
||||
"frameIsIdentity": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"flights": []
|
||||
},
|
||||
"projection, picks and the horizon": {
|
||||
"records": [
|
||||
{
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
* ```
|
||||
*
|
||||
* Optional harness members widen what is checked: `pointer(r, type, x, y)`
|
||||
* (synthetic input), `scriptHeights(r, fn)` (heights from a function),
|
||||
* (synthetic input; with `cameraInput`, the camera scripts' drags and
|
||||
* wheels too), `scriptHeights(r, fn)` (heights from a function),
|
||||
* `wallTime(r)` (the wall clock a `live` motion clock reads),
|
||||
* `assets.model` (a glTF URL). `create` may return null when it cannot
|
||||
* make a renderer with fewer capabilities; those checks are then skipped.
|
||||
@@ -46,6 +47,10 @@ import { portChecks } from './checks/ports.js';
|
||||
* @property {ConformanceTolerance} tolerance
|
||||
* @property {'trace'|'endpoints'} flightPaths Whether flight paths are compared frame by frame, or only where flights end.
|
||||
* @property {(r: object, type: string, x: number, y: number, extra?: object) => void|Promise<void>} [pointer]
|
||||
* A move's `x, y` is where it started and `extra.endPosition` where it
|
||||
* went; `extra` also has `button` (a move's the one held), `modifiers`
|
||||
* and, for a wheel, `delta` in the input port's lines.
|
||||
* @property {boolean} [cameraInput] The renderer's camera moves on pointer input sent through `pointer` (its own gestures, or a camera controller's): the camera scripts with `input` steps run.
|
||||
* @property {(r: object, fn: (point: {lon: number, lat: number}, against?: string) => number|null) => void} [scriptHeights]
|
||||
* @property {(r: object) => number} [wallTime] Epoch ms the renderer's `live` motion clock reads.
|
||||
* @property {{model?: string}} [assets]
|
||||
@@ -111,7 +116,7 @@ export async function runConformance(harness, options = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
export { CAMERA_SCRIPTS, SCRIPT_VIEWPORT } from './cameraScripts.js';
|
||||
export { CAMERA_SCRIPTS, SCRIPT_VIEWPORT, usesInput } from './cameraScripts.js';
|
||||
export { CALIBRATION_PATH, REFERENCE_SCENES, sceneSupport } from './scenes.js';
|
||||
export {
|
||||
VISUAL_TOLERANCE,
|
||||
|
||||
Reference in new issue
Block a user