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:
Sameh Khamis committed 2026-11-03 10:56:08 -08:00
1 parent 7ebc73393a
commit bb91688a62
23 files changed
+424 -172

No files matched your search

+5 -4
View File
@@ -7,6 +7,7 @@ import {
applyAircraftModelTreatment,
cameraLimbDistanceM,
} from './aircraftRecession.js';
import { mirrorBillboard } from './billboardMirror.js';
const params = { ...DEFAULT_AIRCRAFT_RECESSION_PARAMS };
const cameraHeightM = 1_000_000;
@@ -68,7 +69,7 @@ test('globe-view transition eases to identity without a threshold pop', () => {
test('aircraft billboard wire writes scale and alpha only for the far treatment', () => {
const color = { withAlpha: (alpha) => ({ alpha }) };
const near = { scale: 1.2, color: { alpha: 0.8 } };
const near = mirrorBillboard({ scale: 1.2, color: { alpha: 0.8 } });
const nearResult = applyAircraftBillboardTreatment({
billboard: near,
baseScale: 1.2,
@@ -82,7 +83,7 @@ test('aircraft billboard wire writes scale and alpha only for the far treatment'
assert.equal(nearResult.scaleWrites, 0);
assert.equal(nearResult.alphaWrites, 0);
const far = { scale: 1.2, color: { alpha: 0.8 } };
const far = mirrorBillboard({ scale: 1.2, color: { alpha: 0.8 } });
const farResult = applyAircraftBillboardTreatment({
billboard: far,
baseScale: 1.2,
@@ -101,7 +102,7 @@ test('aircraft billboard wire writes scale and alpha only for the far treatment'
test('combined focus and haze product is clamped at the composed alpha floor', () => {
const color = { withAlpha: (alpha) => ({ alpha }) };
const billboard = { scale: 0.45, color: { alpha: 1 } };
const billboard = mirrorBillboard({ scale: 0.45, color: { alpha: 1 } });
const result = applyAircraftBillboardTreatment({
billboard,
baseScale: 1,
@@ -118,7 +119,7 @@ test('combined focus and haze product is clamped at the composed alpha floor', (
test('applyAircraftBillboardTreatment returns its documented module singleton', () => {
const color = { withAlpha: (alpha) => ({ alpha }) };
const billboard = { scale: 1, color: { alpha: 1 } };
const billboard = mirrorBillboard({ scale: 1, color: { alpha: 1 } });
const input = {
billboard,
baseAlpha: 1,