Commit Graph
10 Commits
Author SHA1 Message Date
German Khokhlov f6982dc934 fix(cctv): a count click yields to what is on top and keeps its group in frame
- A count click stands aside when an overlay label or another layer's card
  already took the click, and CCTV now claims a count click in the shared
  pick registry, so the flights layer no longer reads it as an empty-map
  click and keeps tracking its aircraft.
- The flight to a group halves the distance only while the group stays in
  frame; otherwise it flies to the nearest ground cell of the group, so a
  tilted click no longer ends with no camera on screen.
- Counts hidden under the HUD no longer push the active icon aside, and a
  lone camera that would move a merged count under the HUD leaves the
  original count and its icon as they were.
- Cameras on one mount are spread before counts merge, so a spread icon no
  longer slides under a neighbouring count.
- The ground module comment says how a camera without a batch height takes
  the drawn terrain.
2026-11-19 17:52:50 +04:00
German Khokhlov 81fe7f88cc fix(cctv): settle the review of the count markers
Bugs:
- Cameras on one mount stay side by side after their geometry is built,
  so a click or a settled view no longer folds them back into one icon.
- A count click yields to a card drawn over the marker and to another
  layer's object under it, waits while the cockpit or tracking holds the
  view, and flies at most halfway, so a long chain of cameras still splits.
- The active camera's icon is never covered by a count, transparent
  corners of the marker no longer catch clicks, and a count hidden under
  the HUD keeps its lone cameras.
- A lone camera joins only its nearest count and never bridges two; cameras
  close enough to draw as icons take part too, at their drawn icon size.
- Groups across the antimeridian keep their longitude; the flight frames
  the highest mount; markers on ground below the ellipsoid stay visible;
  counts fade outside the Scope circle.
- Mounts less than a metre apart count as one mount.
- A drawn-terrain height survives a late fallback answer, is read for an
  unresolved camera and for one projected off the window, is re-read when
  the terrain under it finishes loading or the terrain source changes, and
  the read budget no longer goes to the same misses each pass.

Cleanup: the glyph draws from one green SVG sprite instead of recolouring
pixels, marker-only constants move next to their use, layout tests check
behaviour rather than formulas, and docs and comments match the code.
docs/I18N.md names the one fixed notation of count badges as an exception.
2026-11-19 03:07:04 +04:00
German Khokhlov 2e18673df8 fix(cctv): stand cameras and count markers on the drawn terrain
When the terrain height batch loses a chunk to the rate limit, the cameras
in it keep a sea-level fallback height. In the mountains that put them far
under the surface, so the view pass judged them by a point that was not
where they are drawn: a tilted view dropped the count marker, a click on
the marker framed empty ground, and icons drifted on tilt and pan.

- A camera with no real ground height takes the height of the terrain the
  globe draws once it is near the screen (up to 300 reads a pass, through
  the height service), and a later answer from the batch replaces it.
- A count marker is anchored to the drawn terrain under its centre, and a
  click frames that ground.
- Cameras on one mount draw side by side, 30 px apart, each with its own
  callout, instead of as one icon with several callouts.

The photoreal map stack is not covered: terrain is not the surface there.
2026-11-19 00:03:34 +04:00
Sameh Khamis 2e91579f8f Add a globe visibility getter to the renderer contract
The globe port could show or hide the globe surface but not say whether it
is shown. It now has an optional isGlobeVisible(), gated by a new
globeVisibility capability, in the Cesium adapter, the stub and a
conformance check. A Cesium scene without a globe does not offer it, so
callers keep their own default for an unknown surface.

The OSM overlays, the CCTV ground regime and the submarine cable drape now
read the getter instead of the scene's globe. cableClassificationTypeForScene
takes the viewer rather than its scene.
2026-11-07 19:44:15 -08:00
Sameh Khamis 7d760d32fc Take the camera layer's policy, state, model and ground off Cesium
The layer's colours are renderer colours; the parts that still draw with
Cesium (icons, coverage lines, the monitor plane) turn them into Cesium
colours with the adapter's own conversion. The screen and matrix scratches
are plain objects, which is all the projections that fill them write.

The model part converts angles with geo/vector, reads where the eye is
from the camera port's pose, and builds the monitor plane's orientation
with geo/quaternion from the same axes; the projection part hands the
entity a Cesium quaternion of it. The photoreal tileset readiness check,
which looks through the scene's primitives, moves to the geometry part.
The ground pass moves a camera icon by writing geo/ellipsoid's position
into the record's own position object. The test plane's plain material
comes from the projection part, and the selection part only lost an
unused import.

All give the same numbers as the Cesium calls they replace. Policy,
state, selection, testing, model and ground leave the allow-list.
2026-11-06 23:47:08 -08:00
Sameh Khamis 8aaf5564d7 Draw CCTV cameras from a GPU icon set 2026-11-03 21:47:16 -08:00
Sameh Khamis 6639c4bb80 Read vessel, CCTV and FIRMS billboard state from the app's mirror
The three layers now add their billboards through addBillboard and write
the mirrored fields through setBillboard, so selection, cards, queries,
focus, view thinning and the FIRMS horizon cull read what was pushed from
the app instead of from Cesium. Vessels and FIRMS state their sprites' own
sizes (32 px ship artwork, the glow canvas at twice the core size), which
the mirror needs. A vessel helper, iconPosition, replaces the repeated
mirror-or-visual position lookups, and the vessel visibility pass writes
show only when it changes, as CCTV and FIRMS already did.

A billboard never given a position now has none in the mirror rather than
the origin.
2026-11-03 11:14:33 -08:00
Sameh Khamis 93942d0dbe Show only the CCTV cameras in view, thinned to one per ground cell when zoomed out
The CCTV layer kept every loaded camera live: each view change touched every
icon, every notification rebuilt every camera's state, and the picker listed
the whole catalog. With the default 4,000 cameras, a continental drag ran at
152-179 fps with 18-24 frames over 30 ms (worst 112 ms). It now runs at
235 fps with none. The layer now:

- shows icons only on or near the screen, and when zoomed out keeps one camera
  per world-anchored cell (healthy feeds first), so panning keeps the same
  cameras;
- grounds and draws coverage only for the cameras in view, the active camera
  and its coverage neighbours, retrying a camera at most twice per view regime;
- reruns the view pass while the camera moves, paced by its own cost, and
  projects with one matrix per pass instead of a Cesium call per camera;
- keeps the billboard buffer-usage hint fixed, so showing or hiding a few
  icons no longer rewrites the vertex data of every billboard;
- lists the cameras in view (active camera first) in the picker, closing with
  the count of cameras outside the view, and builds the full camera list in
  the UI state only when it is read.
2026-10-29 21:31:59 -07:00
12790b36c6 feat(cctv): seven camera packs, semantic labels, terrain-clear monitor planes (#433)
Seven contributed CCTV camera packs (Ontario 511, Fintraffic Finland, DriveBC, TxDOT Texas, Estonia Tallinn + Tarktee, Warendorf, Live Traffic NSW) on a fair per-pack catalog cap; semantic camera labels; monitor planes lifted clear of the terrain from a precomputed, bundled ground-height dataset. Default catalog 800 → 3,446 cameras. Full context in PR #433.

Co-authored-by: sendmebits <[email protected]>
Co-authored-by: avocadoAgent <[email protected]>
Co-authored-by: Alex Harvey <[email protected]>
Co-authored-by: Jason Meredith <[email protected]>
Co-authored-by: Daniel Smith <[email protected]>
Co-authored-by: Vladimir Sobolev <[email protected]>
Co-authored-by: Matthias Schneider <[email protected]>
Co-authored-by: Cyber Knight <[email protected]>
Co-authored-by: NovaSoft Australia <[email protected]>
2026-09-13 21:48:33 -05:00
Sameh Khamis 519bc6c362 refactor(cctv): separate camera source and scene components 2026-09-13 15:02:32 -07:00