mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Merge main through #1319 into the renderer seam
Brings in range ring visibility and sonar pulses (#1518, #1519), the drone airspace layer (#1086), the Houston CCTV pack (#1125), typed chat (#1507, #1545), in-view ground sampling for infrastructure (#1464) and the CCTV model specs refresh (#1319). What main added that reached Cesium or the viewer: - Drone airspace draws its zones as clamped fills and draped boundary lines in draw sets and takes clicks from the input dispatcher, as fire perimeters does. - Infrastructure ground sampling tests the view frustum and the horizon from the camera port's pose (geo/frustum, geo/horizon) and reads loaded terrain through the height queries. - The awareness lifecycle reads the canvas, frames and whether the camera controls take input through the ports. The sonar echo field measures with the geo helpers. - The range ring's pulses need a disc whose fill is computed per pixel from values set each frame, and an outlined line whose opacity changes without a rebuild. The draw port has neither, so that code keeps to one module, src/layers/awareness/rangeRingCesium.js, which is on the Cesium allow-list until the draw port can draw them. It draws only on a viewer with a Cesium primitive collection, and takes its primitives out of the collection it drew them in. On the stub the layer draws the ring without pulses as a haloed line through the draw port. Also from review of the previous merge: tests that the scene's viewer hooks install the zoom-out guard, and that an ambiguous area name is settled by the ground at mid-screen, else where the camera stands.
This commit is contained in:
commit
b9f8ac1ff0
141 files changed
+16192
-412
No files matched your search
@@ -9,6 +9,8 @@ import { createVoiceAreas, spokenArea } from './areaActions.js';
|
||||
import { pointInPreparedArea } from '../data/areaGeometry.js';
|
||||
import { presentResult } from './resultDisplay.js';
|
||||
import { findAdminCandidates as findBundledAdminCandidates } from '../data/adminBoundaries.js';
|
||||
import { bindRenderer } from '../render/rendererOf.js';
|
||||
import { fakeCameraPort } from '../testSupport/fakeCameraPort.mjs';
|
||||
|
||||
const square = (w, s, e, n) => [
|
||||
[w, s],
|
||||
@@ -314,6 +316,41 @@ test('an ambiguous name returns candidates for the model to ask about', async ()
|
||||
assert.equal(picked.display.source, 'Natural Earth');
|
||||
});
|
||||
|
||||
test('an ambiguous name is settled by the view: the ground at mid-screen, else where the camera stands', async () => {
|
||||
// Nothing under mid-screen (open sky, no pick): the camera's own position
|
||||
// over the Indian Punjab chooses it.
|
||||
const viewer = {};
|
||||
const camera = fakeCameraPort({ pose: { lon: 75.5, lat: 31 } });
|
||||
bindRenderer(viewer, { camera: camera.port });
|
||||
const { areas } = makeAreas({ viewer });
|
||||
const byCamera = await areas.resolveAreaAction({ query: 'Punjab' });
|
||||
assert.equal(byCamera.ok, true);
|
||||
assert.equal(byCamera.country, 'India');
|
||||
|
||||
// A camera that cannot say where it is settles nothing: the model asks.
|
||||
camera.setPose({ lon: NaN, lat: NaN });
|
||||
const unknown = await areas.resolveAreaAction({ query: 'Punjab' });
|
||||
assert.equal(unknown.needsClarification, true);
|
||||
|
||||
// The ground at mid-screen wins over the camera's position.
|
||||
const pakistan = PUNJABS[1].polygons[0][0];
|
||||
const lon = (pakistan[0][0] + pakistan[1][0]) / 2;
|
||||
const lat = (pakistan[0][1] + pakistan[2][1]) / 2;
|
||||
camera.setPose({ lon: 75.5, lat: 31 });
|
||||
const ladder = fakeLadder();
|
||||
const { areas: picking } = makeAreas({
|
||||
viewer,
|
||||
annotationResolver: {
|
||||
...ladder,
|
||||
pickWorldFromScreen: (v, x, y) =>
|
||||
v === viewer && x === 0.5 && y === 0.5 ? { lat, lon } : null,
|
||||
},
|
||||
});
|
||||
const byGround = await picking.resolveAreaAction({ query: 'Punjab' });
|
||||
assert.equal(byGround.ok, true);
|
||||
assert.equal(byGround.country, 'Pakistan');
|
||||
});
|
||||
|
||||
test('names reach the annotation outline ladder with the level as entity kind', async () => {
|
||||
const ladder = fakeLadder();
|
||||
const { areas } = makeAreas({ annotationResolver: ladder });
|
||||
|
||||
Reference in new issue
Block a user