Sprites for helicopters, ground vehicles, stations and vessel types; history to live without an empty map; model parts in Cesium

Aircraft icons are one size; helicopters turn a three-frame rotor while
airborne or moving; ADS-B ground vehicles share one amber sprite and
stations/obstacles one mast; vessels get hull sprites by type and one buoy.
Going live keeps contacts until the first live answer and replaces them by
id; fast playback holds before the loaded positions end and prefetches
ahead. Cesium models move their parts from the optional model part state.
This commit is contained in:
Sameh Khamis committed 2026-11-17 15:09:54 -08:00
1 parent 624c229bc2
commit 7186f720df
97 files changed
+6586 -343

No files matched your search

+29
View File
@@ -20,6 +20,7 @@
*/
import { classifyAircraft } from './aircraftClass.js';
import { readPartTable } from '../render/modelParts.js';
import { FLEET_TRAIL_ANCHORS } from './fleetTrailAnchors.js';
import { isAidToNavigation } from './vesselTypes.js';
@@ -527,6 +528,34 @@ export function namedFleetModels(types) {
]);
}
/** Each loaded set's part tables by model name (null for a model without one). */
const partTables = new WeakMap();
/**
* The part table of model `name` in a loaded set, read once from its GLB:
* which moving parts it has (`render/modelParts.js`); null for a model
* without one, or whose GLB did not load.
* @param {{bytes?: Map<string, Uint8Array>}|null|undefined} set
* @param {string|null|undefined} name
* @returns {import('../render/modelParts').PartTable|null}
*/
export function fleetPartTable(set, name) {
const bytes = name ? set?.bytes?.get(name) : undefined;
if (!bytes) return null;
let tables = partTables.get(set);
if (!tables) partTables.set(set, (tables = new Map()));
if (!tables.has(name)) {
let table = null;
try {
table = readPartTable(bytes);
} catch {
// A malformed table: the model draws whole.
}
tables.set(name, table);
}
return tables.get(name);
}
let loading = null;
let loaded = null;