mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Read flight and military billboard state from the app's mirror
Flights and military now add their billboards through addBillboard and write show, position, scale, rotation, size and distance scaling through setBillboard, which keeps the app's copy in src/data/billboardMirror.js. Their reads go to billboardState instead of the Cesium billboard, so the layers no longer read back what they pushed to the renderer. A mirrored billboard needs an explicit width and height, because unset Cesium reports the loaded image's size. Colour is not mirrored yet: the cyber-sonar theme writes it too and tells the writers apart by the live value, so it moves with the effects port.
This commit is contained in:
1 parent
7ebc73393a
commit
bb91688a62
23 files changed
+424
-172
No files matched your search
@@ -9,6 +9,7 @@ import {
|
||||
ENRICH_AMBIENT_REFILL_WINDOW_MS,
|
||||
ENRICH_AMBIENT_PER_SWEEP,
|
||||
} from './policy.js';
|
||||
import { billboardState } from '../../data/billboardMirror.js';
|
||||
|
||||
export function createEnrichment({
|
||||
flightState,
|
||||
@@ -199,11 +200,9 @@ export function createEnrichment({
|
||||
if (flightState._enrichSeen.has(`t:${icao24}`)) continue; // answered / queued / negative this session
|
||||
if (!/^[0-9a-f]{6}$/i.test(icao24)) continue; // adsbdb keys are 6-char hex only
|
||||
if (flightState.records.data.get(icao24)?.onGround) continue; // ground traffic never spends ambient budget (click-to-enrich still works)
|
||||
if (!bb.position || !occluder.isPointVisible(bb.position)) continue; // beyond the limb
|
||||
Cesium.Cartesian3.clone(
|
||||
bb.position,
|
||||
flightState._scratchModelBS.center,
|
||||
);
|
||||
const { position } = billboardState(bb);
|
||||
if (!position || !occluder.isPointVisible(position)) continue; // beyond the limb
|
||||
Cesium.Cartesian3.clone(position, flightState._scratchModelBS.center);
|
||||
if (
|
||||
cull.computeVisibility(flightState._scratchModelBS) ===
|
||||
Cesium.Intersect.OUTSIDE
|
||||
@@ -211,7 +210,7 @@ export function createEnrichment({
|
||||
continue; // off-screen
|
||||
cand.push([
|
||||
icao24,
|
||||
Cesium.Cartesian3.distanceSquared(camPos, bb.position),
|
||||
Cesium.Cartesian3.distanceSquared(camPos, position),
|
||||
]);
|
||||
}
|
||||
cand.sort((a, b) => a[1] - b[1]); // nearest first — what the user is looking at resolves first
|
||||
|
||||
Reference in new issue
Block a user