mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
feat(render): the Cesium renderer passes every conformance check a page can run
- Cesium's own tweens (its flights) step on the renderer's clock, so the flight traces compare frame by frame; dispose gives the scene its own clock back. - moveStart and moveEnd are measured each tick on that clock, by the shared move detection, a change of the field of view or aspect included; Cesium's own events timed them by the system clock. - A follow of a drawn item tracks where the draw port draws it. - Pick rays are summed from the eye's axes: Cesium's lose about 1e-9 of direction at a near plane of 0.1 m. Ellipsoid picks and the view rectangle use them; a canvas with no size has none, as in Cesium. - The harness always runs the virtual clock and claims 120 checks: 119 pass on the page and query.heights skips. The five pointer traces need a camera controller there, and are recorded from Cesium's own controller in Node. - The package boundaries list the cesium plugin export and the modules its groups now import.
This commit is contained in:
1 parent
720932e1f9
commit
e9085e8df3
13 files changed
+545
-95
No files matched your search
@@ -132,6 +132,13 @@ export function createCesiumPorts(
|
||||
) {
|
||||
const scene = widget.scene;
|
||||
const camera = scene.camera;
|
||||
// Cesium's own tweens (its flights) step on the same clock as the ticks:
|
||||
// a scene's tweens read the system clock unless given a time.
|
||||
const tweens = scene.tweens;
|
||||
const updateTweens = tweens?.update;
|
||||
const clockedTweens = (time) =>
|
||||
updateTweens.call(tweens, time ?? clockNow() / 1000);
|
||||
if (updateTweens) tweens.update = clockedTweens;
|
||||
|
||||
// An error listener's own throw is uncaught, never reported again.
|
||||
const rendererListeners = {
|
||||
@@ -421,6 +428,13 @@ export function createCesiumPorts(
|
||||
report,
|
||||
widget,
|
||||
capabilities,
|
||||
now: clockNow,
|
||||
...(capabilities.has('motionSegments')
|
||||
? {
|
||||
itemPosition: (item, time) =>
|
||||
drawPart.drawnPosition(item, 0, time),
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
const cameraPort = cameraPart.port;
|
||||
const effectsPart = createCesiumEffects(scene, {
|
||||
@@ -736,6 +750,9 @@ export function createCesiumPorts(
|
||||
settleTick(false);
|
||||
for (const off of removers) off();
|
||||
scene.canvas?.removeEventListener?.('webglcontextlost', contextLost);
|
||||
// Cesium's own tween clock back, unless another set wrapped it since.
|
||||
if (updateTweens && tweens.update === clockedTweens)
|
||||
tweens.update = updateTweens;
|
||||
// A listener that disposes the renderer stops the rest of its event.
|
||||
for (const list of Object.values(rendererListeners)) list.clear();
|
||||
for (const list of Object.values(frameListeners)) list.clear();
|
||||
|
||||
Reference in new issue
Block a user