mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Bound drillPick's work, pick before styles, and put changed thresholds behind a capability
The query contract now says picks answer against the scene as drawn before effects, and that a drillPick limit bounds the work as well as the answer: the renderer stops at `limit` hits and looks through at most max(limit, 16) things under the pointer. The Cesium query port passes that depth to Cesium's drill (a pick looking under something unpickable stays unbounded), a click's drill caches one pass per depth, and the stub counts unpickable items toward the depth. CameraPose says fovy and aspectRatio describe the nearest centred perspective frustum, the exact projection being in matrices(). A changed listener's own threshold is now the capability cameraChangeThreshold; without it every listener fires at 0.5. The Cesium and stub cameras have it, measured per listener without touching Cesium's shared percentageChanged. Conformance: draw.drillPick checks limit 0, never the surface, nothing over the bare globe, an unpickable cover, nearest first and a bounded prefix; query.pickBeforeStyles picks an icon under a mirroring style; the threshold trace is skipped without its capability.
This commit is contained in:
1 parent
481df0b093
commit
45302e9fbf
19 files changed
+260
-40
No files matched your search
Vendored
+16
-2
@@ -9,7 +9,9 @@
|
||||
* - `lookAt` orbits the target (the user can still rotate and zoom about it);
|
||||
* `release` returns to the world frame.
|
||||
* - `changed` fires when the view has moved by more than the listener's own
|
||||
* `threshold` (default 0.5) since it last fired, measured per listener:
|
||||
* `threshold` (`cameraChangeThreshold`; default 0.5, and 0.5 for every
|
||||
* listener without the capability) since it last fired, measured per
|
||||
* listener, without changing what any other listener is measured by:
|
||||
* heading and roll each by their change over π since they last fired; the
|
||||
* view by the larger of the direction's turn over half the vertical field
|
||||
* of view and the eye's travel over its height, since the view last
|
||||
@@ -45,7 +47,13 @@ export interface CameraPose {
|
||||
direction: Vec3;
|
||||
up: Vec3;
|
||||
right: Vec3;
|
||||
/** Vertical field of view, radians. */
|
||||
/**
|
||||
* Vertical field of view, radians. `fovy` and `aspectRatio` describe a
|
||||
* centred perspective frustum. Where the renderer's frustum is off-centre or
|
||||
* orthographic reports the nearest centred one here and its exact
|
||||
* projection only in `matrices()`; code that culls or projects exactly
|
||||
* reads `matrices()`.
|
||||
*/
|
||||
fovy: number;
|
||||
aspectRatio: number;
|
||||
near: number;
|
||||
@@ -259,6 +267,12 @@ export interface CameraPort {
|
||||
*/
|
||||
followFrame?(): Float64Array;
|
||||
readonly controls: CameraControls;
|
||||
/**
|
||||
* `threshold` (`cameraChangeThreshold`): the fraction of change, as the
|
||||
* header measures it, that fires this `changed` listener; ignored for the
|
||||
* other events, and without the capability (every listener then fires at
|
||||
* 0.5).
|
||||
*/
|
||||
on(event: CameraEvent, cb: () => void, options?: { threshold?: number }): Off;
|
||||
/** Runs before each camera command, so an owner can yield to another. */
|
||||
onCommand(cb: (command: CameraCommand) => void): Off;
|
||||
|
||||
Vendored
+2
@@ -210,5 +210,7 @@ export type Capability =
|
||||
| 'globeVisibility'
|
||||
/** Reading the frame the eye is placed in (`camera.followFrame`). */
|
||||
| 'followFrame'
|
||||
/** A `threshold` per `changed` listener (`camera.on`). */
|
||||
| 'cameraChangeThreshold'
|
||||
/** A built-in quality benchmark. */
|
||||
| 'benchmark';
|
||||
@@ -48,6 +48,7 @@ export const CAPABILITIES = Object.freeze([
|
||||
'followAutodetect',
|
||||
'globeVisibility',
|
||||
'followFrame',
|
||||
'cameraChangeThreshold',
|
||||
'benchmark',
|
||||
]);
|
||||
|
||||
|
||||
Vendored
+14
@@ -4,6 +4,10 @@
|
||||
* Picks, projection and rays are synchronous and answer against the last
|
||||
* presented frame. Heights have a synchronous cache-only form that may
|
||||
* return null, and asynchronous forms that load what they need.
|
||||
*
|
||||
* Picks, depth picks and rays answer against the scene as drawn before
|
||||
* effects: a style that moves pixels does not move what is picked, so the application
|
||||
* maps a pointer through its own style before it picks.
|
||||
*/
|
||||
import type { Ecef, LonLat, Meta, Ray, ScreenXY } from './common';
|
||||
|
||||
@@ -60,6 +64,16 @@ export interface HeightSample {
|
||||
|
||||
export interface QueryPort {
|
||||
pick(x: number, y: number, window?: PickWindow): Hit | null;
|
||||
/**
|
||||
* The pickable draw-set items under the pointer, nearest first, each once:
|
||||
* never the surface (`surface` is always false) and never anything that is
|
||||
* not a draw-set item. `limit`, a whole number of 0 or more, bounds the
|
||||
* work as well as the answer: the renderer stops at `limit` hits and
|
||||
* looks through at most `max(limit, 16)` things of any kind under the pointer that its picks
|
||||
* see (tiles, unpickable items it still picks, its own), so it may return
|
||||
* fewer than `limit` when more lie above them. Omitted: every item, at
|
||||
* whatever cost.
|
||||
*/
|
||||
drillPick(
|
||||
x: number,
|
||||
y: number,
|
||||
|
||||
Reference in new issue
Block a user