feat(cctv): show how many cameras a thinned marker stands for

Zoomed out, the layer keeps one camera per ground cell and drew it as an
ordinary icon, so nothing showed that dozens or hundreds of other cameras
sat behind it. A cell with two or more cameras is now one round marker
with the count inside, at the centre of its cameras. Single cameras and
the active camera keep their icons.

The count covers the whole cell, so it does not change while the cell
crosses the screen edge. Markers that would overlap on screen merge into
one carrying their sum. Counts above 999 use the compact form of the UI
language and widen the marker into a pill. Clicking a marker zooms to
its group and does not choose a camera.

Ambient cards and coverage attach only to cameras drawn as icons; the
camera picker keeps one representative per visible cell as before.
This commit is contained in:
German Khokhlov committed 2026-11-18 14:26:37 +04:00
1 parent c08bd1103d
commit 607796737c
20 files changed
+965 -77

No files matched your search

+7 -1
View File
@@ -41,6 +41,12 @@ export function createSelection({
function bindCctvWorldClickGesture(input, onClick) {
return input.onClick((event) => {
if (!isTrackingClickGesture(event.gesture)) return;
const cell =
layerState._enabled && layerState._counts?.pickedCell(event.drawHit);
if (cell) {
parts.navigation.zoomToCell(cell);
return;
}
onClick(event);
});
}
@@ -139,11 +145,11 @@ export function createSelection({
// is looking at ever asks.
void parts.ground.resolveFootprintGround(record);
record.activationDone = true;
parts.rendering.refreshCoverageStyles();
// The active camera's icon always shows; the previously active one
// competes for its cell again. Its coverage neighbours join the working
// set and are queued for grounding.
parts.rendering.refreshHorizonCulling();
parts.rendering.refreshCoverageStyles();
parts.geometryQueue.enqueueViewGeometry();
// The newly active camera leaves the ambient ring (its monitor plane takes
// over); the freed slot re-fills on this same pass.