mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
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.
This commit is contained in:
1 parent
f13c60c477
commit
93942d0dbe
32 files changed
+1301
-71
No files matched your search
@@ -59,6 +59,12 @@ export function _initCctvPanel() {
|
||||
);
|
||||
});
|
||||
|
||||
// The picker defers rebuilds while focused; catch up once it lets go.
|
||||
this.listen(this._cctvSelect, 'blur', () => {
|
||||
this._cctvSelectSource = null;
|
||||
this._renderCctvState(this._cctvState);
|
||||
});
|
||||
|
||||
this.listen(this._cctvSelect, 'change', async () => {
|
||||
const generation = ++this._actionGeneration;
|
||||
const activeId = this._cctvState?.activeCameraId;
|
||||
@@ -72,9 +78,9 @@ export function _initCctvPanel() {
|
||||
(activeId && activeId !== this._cctvState?.activeCameraId)
|
||||
)
|
||||
return;
|
||||
// Picking a camera from the dropdown flies to it. The catalog spans
|
||||
// three metros, so a bare selection used to leave the view in the old
|
||||
// city with a camera active thousands of km away.
|
||||
// Picking a camera from the dropdown flies to it. The dropdown lists the
|
||||
// cameras in view (and the active camera, which may be far away), so a
|
||||
// bare selection could leave the view somewhere else.
|
||||
this.actions.runExplicitFocus(
|
||||
() => (this.cctv.selectCamera(cameraId) ? cameraId : null),
|
||||
(selectedId) => this.cctv.focusCamera(selectedId, 2.2),
|
||||
|
||||
Reference in new issue
Block a user