mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Give the Cesium renderer the contract's input port
src/render/cesium/input.js feeds the shared router from one ScreenSpaceEventHandler: every button's press, release and click, double clicks, moves and pinches, under any one modifier. The DOM event being dispatched gives the full modifiers and pointer type; an action Cesium raises on a timer takes its own modifier. Wheel comes from the canvas in lines and is never cancelled. Clicks are picked once, lazily, through the query port. Cesium ends every held button on any release; those presses end there, but only the button released clicks. The viewer's stock select and follow move off its handler and run first, as they did, but only for a press no lease took and while not suppressed. Camera holds go through the scene's shared holds, ctrlWheelZoom through ctrlWheelZoom.js. The router gains a before-hook and dispose, which stops delivery mid-event. The conformance renderer exposes the port and the harness feeds it; input.lease, input.lease.grab, input.lease.press, input.clickPick and input.behaviours join the Cesium checks.
This commit is contained in:
1 parent
6921e075d0
commit
1c29a54dc9
8 files changed
+870
-12
No files matched your search
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
import { DEFAULT_TOLERANCE } from '../conformance/index.js';
|
||||
import { toEcef } from '../stub/math.js';
|
||||
import { createCesiumSceneRenderer } from './sceneRenderer.js';
|
||||
import { createCesiumSceneRenderer, pointerFeedOf } from './sceneRenderer.js';
|
||||
|
||||
/** @type {ReadonlySet<string>} */
|
||||
export const CESIUM_CHECKS = new Set([
|
||||
@@ -26,6 +26,11 @@ export const CESIUM_CHECKS = new Set([
|
||||
'frame.suspend',
|
||||
'frame.time',
|
||||
'globe.sky',
|
||||
'input.behaviours',
|
||||
'input.clickPick',
|
||||
'input.lease',
|
||||
'input.lease.grab',
|
||||
'input.lease.press',
|
||||
'query.heights',
|
||||
'query.heights.sets',
|
||||
'query.projectMany',
|
||||
@@ -94,6 +99,9 @@ export function createCesiumHarness({ name = 'cesium', model } = {}) {
|
||||
return renderer;
|
||||
},
|
||||
frame: nextFrame,
|
||||
// Events as the renderer's handler delivers them: the checks send ones
|
||||
// no real pointer can (a click with no press), so not DOM events.
|
||||
pointer: (r, type, x, y, extra) => pointerFeedOf(r)(type, x, y, extra),
|
||||
now: () => performance.now(),
|
||||
toEcef,
|
||||
tolerance: DEFAULT_TOLERANCE,
|
||||
|
||||
Reference in new issue
Block a user