mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 02:02:21 +00:00
Take the input dispatcher off Cesium: pointer input from the renderer's input port, picks from the query port
The dispatcher now builds on renderer.input and the query port, with
positions as plain {x, y}. Its viewer access count is zero and it leaves
the Cesium allow-list. Layers that read the raw engine pick read the Hit,
drawHit or event.native instead, and pickRegistry's resolvePickId and
pickContact take a Hit, with the raw versions kept in the Cesium adapter.
rendererOf gains findInput, provideUnboundInput and provideNativeClick.
event.native carries the engine's pick, drill and pickWindow, and picks
through the follow helper happen inside it. An unbound input port
survives the viewer being bound until it is released.
The query port's pick memo is now per task rather than per frame,
because Cesium's own picks advance the frame number. A click on the sky
skips the depth pass when nothing is on the ray. Touch contact search
keeps its eight-deep drill in a 14x14 window.
This commit is contained in:
1 parent
6eb9ceef46
commit
8bcaced6ad
52 files changed
+1836
-484
No files matched your search
@@ -12,17 +12,18 @@ const SENSOR_STYLES = ['thermal', 'surveillance'];
|
||||
|
||||
/**
|
||||
* The pick-buffer position for a screen click.
|
||||
* @param {object} scene The scene object the styles are recorded on.
|
||||
* @param {object} host The scene object the styles are recorded on (the
|
||||
* viewer the application's visual effects are made for).
|
||||
* @param {{x: number, y: number}} position CSS pixels on the canvas.
|
||||
* @param {{width: number, height: number, clientWidth: number,
|
||||
* clientHeight: number}} canvas The canvas the scene draws in.
|
||||
* @returns {{x: number, y: number}} A new position; the click's own is left
|
||||
* alone.
|
||||
*/
|
||||
export function sensorPickPosition(scene, position, canvas) {
|
||||
export function sensorPickPosition(host, position, canvas) {
|
||||
const out = { x: position.x, y: position.y };
|
||||
const stages = styleStagesOf(scene);
|
||||
if (!stages) return out;
|
||||
const stages = styleStagesOf(host);
|
||||
if (!stages || !canvas) return out;
|
||||
for (const style of SENSOR_STYLES) {
|
||||
const stage = stages[style];
|
||||
if (!stage?.enabled) continue;
|
||||
|
||||
Reference in new issue
Block a user