mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Draw the aircraft fleet icons through the draw port
The civil flights and military layers now draw their contacts as one GPU icon set each from the renderer's draw port instead of a custom primitive. Each contact is an icon item whose motion is the dead reckoning the layer plans (interpolation between fixes, warm-up and coast arcs, or a hold), with its nose gliding onto a new course at the fleet's slew cap. A contact's item is replanned when its motion runs out, grounded contacts are pinned with held motion, and focus de-emphasis is written per item. The near/far image switch follows the renderer's pixel ratio, and writes made during a fleet tick reach the set before that frame draws. The aircraft icon layer and the flights icon part no longer touch Cesium and leave the allow-list. Clicks resolve the draw port's pick ids as well as the ones the tracked model and entities still carry, so selection, follow and share-follow work as before.
This commit is contained in:
1 parent
e94b7ffb01
commit
dbd6363e43
30 files changed
+977
-551
No files matched your search
@@ -4,10 +4,12 @@ import { createRendering as civilRendering } from '../layers/flights/rendering.j
|
||||
import { createRendering as militaryRendering } from '../layers/military/rendering.js';
|
||||
import { createMilitarySnapshotRenderer } from '../layers/military/snapshotRenderer.js';
|
||||
import { createIcons as createMilitaryIcons } from '../layers/military/icons.js';
|
||||
import { createIconSet } from './iconSet.js';
|
||||
import { createContactIcons } from './aircraftIconLayer.js';
|
||||
import {
|
||||
aircraftMotionRegime,
|
||||
createMotionRegime,
|
||||
fixEpochMs,
|
||||
julianAt,
|
||||
} from './aircraftMotionRegime.js';
|
||||
import { aircraftEmergency } from './aircraftEmergency.js';
|
||||
// Source-to-voice provenance, status retention/clearing, contact-time contracts,
|
||||
@@ -471,7 +473,7 @@ test('tint priorities cover normal, priority, emergency, tracking and Cockpit do
|
||||
test('GERMAN: an existing untracked military icon repaints each poll without losing its fade', () => {
|
||||
const { flightState, rendering } = renderHarness(militaryRendering);
|
||||
Object.assign(flightState, {
|
||||
_icons: createIconSet(),
|
||||
_icons: createContactIcons(),
|
||||
_models: new Map(),
|
||||
_positionHistory: new Map(),
|
||||
_displayCourse: new Map(),
|
||||
@@ -500,6 +502,8 @@ test('GERMAN: an existing untracked military icon repaints each poll without los
|
||||
{ speed: 'speedMps', track: 'track' },
|
||||
createMotionRegime(),
|
||||
),
|
||||
_displayTimeAt: julianAt,
|
||||
_fixEpochMs: fixEpochMs,
|
||||
},
|
||||
};
|
||||
const icons = createMilitaryIcons({
|
||||
@@ -507,11 +511,13 @@ test('GERMAN: an existing untracked military icon repaints each poll without los
|
||||
services: { focus: { focusPassIsNeeded: () => false } },
|
||||
parts,
|
||||
});
|
||||
const row = flightState._icons.add('abc123', {
|
||||
layer: 'military',
|
||||
id: 'abc123',
|
||||
const row = 'abc123';
|
||||
flightState._icons.put({
|
||||
id: row,
|
||||
pos: { x: 0, y: 0, z: 0 },
|
||||
meta: { layer: 'military', id: row },
|
||||
});
|
||||
// The focus fade the fleet tick composes lives in its own column.
|
||||
// The focus fade the fleet tick composes lives in its own field.
|
||||
flightState._icons.setFocus(row, 0.65);
|
||||
const apply = createMilitarySnapshotRenderer({
|
||||
flightState,
|
||||
@@ -546,7 +552,7 @@ test('GERMAN: an existing untracked military icon repaints each poll without los
|
||||
{ observedAtMs: NOW_MS },
|
||||
);
|
||||
apply(snapshot, {});
|
||||
assert.equal(flightState._icons.color(row).green < 0.5, red);
|
||||
assert.equal(flightState._icons.item(row).color[1] < 0.5, red);
|
||||
assert.ok(Math.abs(flightState._icons.focus(row) - 0.65) < 1e-6);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user