mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +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
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* @module styles/styleStages
|
||||
* @description The app's record of each visual style on a scene: its
|
||||
* @description The app's record of each visual style on a scene object (the
|
||||
* viewer the application's visual effects are made for): its
|
||||
* intensity, parameter values and whether it draws, as the application set
|
||||
* them. Code that must follow a style's picture (sensor picks) reads it here
|
||||
* rather than asking the renderer.
|
||||
@@ -9,7 +10,22 @@
|
||||
const records = new WeakMap();
|
||||
|
||||
/**
|
||||
* @param {object} scene
|
||||
* Another object a scene object's styles may be recorded on, for test
|
||||
* doubles whose tests record them on the engine's own scene.
|
||||
*/
|
||||
let aliasOf = null;
|
||||
|
||||
/**
|
||||
* Let `styleStagesOf` also find records made on `alias(host)`; a later call
|
||||
* replaces it. For test doubles (src/input/testDoubles.mjs).
|
||||
* @param {((host: object) => object|null|undefined) | null} alias
|
||||
*/
|
||||
export function provideStyleStageAlias(alias) {
|
||||
aliasOf = alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} scene The scene object.
|
||||
* @param {Record<string, {enabled: boolean, uniforms: Record<string, number>}>} stages
|
||||
* @returns {() => void} Forgets them, if they are still the scene's.
|
||||
*/
|
||||
@@ -25,5 +41,10 @@ export function registerStyleStages(scene, stages) {
|
||||
* @param {object} scene
|
||||
* @returns {Record<string, {enabled: boolean, uniforms: Record<string, number>}> | null}
|
||||
*/
|
||||
export const styleStagesOf = (scene) =>
|
||||
(scene && typeof scene === 'object' && records.get(scene)) || null;
|
||||
export function styleStagesOf(scene) {
|
||||
if (!scene || typeof scene !== 'object') return null;
|
||||
const own = records.get(scene);
|
||||
if (own) return own;
|
||||
const alias = aliasOf?.(scene);
|
||||
return (alias && typeof alias === 'object' && records.get(alias)) || null;
|
||||
}
|
||||
Reference in new issue
Block a user