mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +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
@@ -84,25 +84,25 @@ for (const layer of LAYERS) {
|
||||
test(`${layer.name}: near AIR state is independent from model admission`, () => {
|
||||
assert.match(source, /nextCockpitNearContacts\(/,
|
||||
'Cockpit derives a separate near-contact hysteresis set');
|
||||
assert.match(source, /!state\._cockpitNearContacts\.has\(icao24\);\s*if \(cockpitDot\) \{\s*const dot = iconAtlas\.slot\(cockpitContactDotImage\(\)/,
|
||||
assert.match(source, /!state\._cockpitNearContacts\.has\(icao24\);\s*const look = cockpitDot\s*\?\s*\{\s*image: cockpitDotImage\(\)/,
|
||||
'only out-of-range Cockpit contacts become dots');
|
||||
// `_iconKind` is identity for every unconverted contact (see
|
||||
// tr3bRegistry.test.mjs) — it only swaps the glyph for a contact the
|
||||
// operator explicitly converted into a TR-3B.
|
||||
assert.match(source, /aircraftIcon\(\s*(?:parts\.)?rendering\._iconKind\(icao24, info\?\.klass\),?\s*\)/,
|
||||
assert.match(source, /aircraftIcon\(\s*(?:parts\.)?rendering\._iconKind\(icao24, info\?\.klass\),?\s*(?:FLEET_ICON_PX,?\s*)?\)/,
|
||||
'near contacts and model fallbacks retain the class-derived aircraft silhouette');
|
||||
assert.match(source, /set\.setFlag\(row, ICON_ROTATES, false\);/,
|
||||
assert.match(source, /color: rgba\(rendering\._cockpitContactColor\(icao24, info\)\),\s*rotationMode: 'screen',/,
|
||||
'far dots are reset to a rotation-free presentation');
|
||||
assert.match(source, /set\.setFlag\(row, ICON_ROTATES, true\);/,
|
||||
assert.match(source, /color: rgba\(rendering\._fleetBillboardColor\(icao24, info\)\),\s*rotationMode: 'course',/,
|
||||
'near 2D silhouettes continue to receive projected course');
|
||||
assert.match(source, /icons\.setShown\(row, false\);\s*\/\/\s*hand\s*off\s*ONLY\s*once\s*the\s*model\s*renders/,
|
||||
assert.match(source, /icons\.setShown\(icao24, false\);\s*\/\/\s*hand\s*off\s*ONLY\s*once\s*the\s*model\s*renders/,
|
||||
'the gap-proof icon-to-model handoff remains intact');
|
||||
});
|
||||
|
||||
test(`${layer.name}: Cockpit exit clears near state before restoring map presentation`, () => {
|
||||
const setMode = /^([ \t]*)function _setCockpitContactMode\b[\s\S]*?\n\1\}/m.exec(source)?.[0];
|
||||
assert.match(setMode, /else\s*(?:(?:flightState|state)\.)?_cockpitNearContacts\s*=\s*new\s*Set\(\s*,?\s*\);/);
|
||||
assert.match(setMode, /for \(let row = 0; row < \(icons\?\.count \?\? 0\); row\+\+\)\s*parts\.icons\._applyIconPresentation\(icons\.idAt\(row\)\);/);
|
||||
assert.match(setMode, /for \(const icao24 of (?:flightState\._)?icons\?\.ids\(\) \?\? \[\]\)\s*parts\.icons\._applyIconPresentation\(icao24\);/);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user