mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Answer earthquake, CCTV pick and tracked sprite reads from the app
Earthquake analyst records come from the events the layer drew, gated on its own enabled flag, instead of reading each entity's position and property bag back; the discs no longer carry the bag. CCTV coverage rays and projection planes record their camera id in a layer pick store instead of a cctvCameraId entity property, with the same ownership checks. The tracked flight, military and local ADS-B billboards record their size and distance scaling as the entity record's sprite, which the close-range camera guard and the screen annotations' tracked footprint now read in place of the billboard's property getters.
This commit is contained in:
1 parent
05904edfc9
commit
0889cd0cb7
16 files changed
+160
-96
No files matched your search
+10
-4
@@ -80,6 +80,7 @@ import {
|
||||
LIVE_CAMERA_COLOR,
|
||||
} from '../layers/cctv/policy.js';
|
||||
import { mirrorBillboard } from './billboardMirror.js';
|
||||
import { cctvPicks } from '../layers/cctv/pickState.js';
|
||||
|
||||
const ASPECT = 16 / 9;
|
||||
const toRad = (deg) => (deg * Math.PI) / 180;
|
||||
@@ -1130,10 +1131,10 @@ test('CCTV empty-click gate excludes every identified scene object, ADJUST, and
|
||||
|
||||
test('CCTV camera extraction requires layer ownership, not a colliding sibling ID', () => {
|
||||
const billboard = { id: 'shared-id' };
|
||||
const ownedCoverageEntity = {
|
||||
id: 'cctv-shared-id-cap',
|
||||
properties: { cctvCameraId: 'shared-id' },
|
||||
};
|
||||
const ownedCoverageEntity = { id: 'cctv-shared-id-cap' };
|
||||
cctvPicks.write(ownedCoverageEntity).cameraId = 'shared-id';
|
||||
const strayEntity = { id: 'cctv-shared-id-stray' };
|
||||
cctvPicks.write(strayEntity).cameraId = 'shared-id';
|
||||
const record = {
|
||||
...makeDeselectRecord('shared-id'),
|
||||
billboard,
|
||||
@@ -1176,6 +1177,11 @@ test('CCTV camera extraction requires layer ownership, not a colliding sibling I
|
||||
null,
|
||||
'a sibling cannot impersonate CCTV by copying its property shape',
|
||||
);
|
||||
assert.equal(
|
||||
_extractPickedCameraIdForTest({ id: strayEntity }),
|
||||
null,
|
||||
'a camera id alone is not ownership: the record must hold the entity',
|
||||
);
|
||||
} finally {
|
||||
_setCctvCoverageStateForTest({ enabled: false });
|
||||
}
|
||||
|
||||
@@ -118,8 +118,8 @@ export function signedAngleDelta(fromRad, toRad) {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/** Entity id prefix for every gizmo part — the layer's pick-owner regex and
|
||||
* click-to-select guard key off this. Gizmo entities NEVER carry a
|
||||
* `cctvCameraId` property, so the layer's selection path ignores them. */
|
||||
* click-to-select guard key off this. Gizmo entities NEVER get a camera id in
|
||||
* the layer's pick store, so the layer's selection path ignores them. */
|
||||
export const GIZMO_ID_PREFIX = 'cctv-gizmo-';
|
||||
|
||||
const RING_SEGMENTS = 96;
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
* - `visualPosition()`: where a 3D model is actually drawn, for the tracked card.
|
||||
* - `labelModel`: the tracked card's `{ title, details, accent, … }`.
|
||||
* - `selectionOrigin`: what started the selection (`'user'`, …).
|
||||
* - `sprite`: a tracked billboard's pushed `{ width, height, scale, scaleByDistance }`, for
|
||||
* the close-range camera guard and the screen annotations' tracked footprint.
|
||||
*
|
||||
* A layer's private per-entity state goes in its own store ({@link createEntityStore}).
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user