mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Keep aircraft, installation and viewshed state off Cesium objects
The aircraft layers' model spec key, IR boost and belly offset and the billboards' large-icon flag move into aircraftVisuals, one store shared by flights, military and local ADS-B. Installation markers' last drawn height and selection move into installationMarkers. The CCTV viewshed QA tag is now the viewshedCameraId record field, which qa-cctv-v2 reads through entityRecords. Test fixtures drop a placement flag nothing reads.
This commit is contained in:
1 parent
2394703c14
commit
04a70d59e9
11 files changed
+84
-40
No files matched your search
@@ -15,6 +15,7 @@ import {
|
||||
MODEL_PROX_KEEP_M,
|
||||
} from '../flights/policy.js';
|
||||
import { AIRCRAFT_ENVIRONMENT_MAP_OPTIONS } from '../../data/aircraftModelLighting.js';
|
||||
import { aircraftVisuals } from '../aircraft/visualState.js';
|
||||
|
||||
const specKey = (spec) => `${spec.url}@${spec.scale}`;
|
||||
|
||||
@@ -78,7 +79,7 @@ export function createLocalAdsbModels({
|
||||
const spec = civilAircraftModelSpec(marker.klass);
|
||||
const key = specKey(spec);
|
||||
const current = models.get(id);
|
||||
if (current && current._gevSpecKey === key) return;
|
||||
if (current && aircraftVisuals.read(current)?.specKey === key) return;
|
||||
if (current) release(id);
|
||||
if (pending.has(id) || models.size + pending.size >= cap) return;
|
||||
const loadGeneration = generation;
|
||||
@@ -113,8 +114,9 @@ export function createLocalAdsbModels({
|
||||
return;
|
||||
}
|
||||
model.id = id;
|
||||
model._gevSpecKey = key;
|
||||
model._gevBellyM = spec.bellyM;
|
||||
const visual = aircraftVisuals.write(model);
|
||||
visual.specKey = key;
|
||||
visual.bellyM = spec.bellyM;
|
||||
// Admitted, not yet the visual: placement turns it on.
|
||||
model.show = false;
|
||||
collection.add(model);
|
||||
@@ -182,7 +184,7 @@ export function createLocalAdsbModels({
|
||||
return Cesium.Cartesian3.fromRadians(
|
||||
carto.longitude,
|
||||
carto.latitude,
|
||||
height + (model?._gevBellyM || 0),
|
||||
height + (aircraftVisuals.read(model)?.bellyM || 0),
|
||||
Cesium.Ellipsoid.WGS84,
|
||||
scratchGround,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user