mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(flights): render on Navara
Task 10b. src/layers/aircraft/render/navara.js implements the aircraft renderer contract on the engine contract alone (no three, no Cesium): - Fleet glyphs: banks of engine.movers sprite sets (one per distance scale and depth mode the handles ask for; flights: one, 'always', Cesium's NearFarScalar), growing by doubling, from a glyph atlas of every aircraftIcon() kind at the fleet (64 px) and tracked (192 px) rasters (data/aircraftIcons: AIRCRAFT_ICON_KINDS, aircraftIconCells, aircraftIconAtlasLayout, drawAircraftIconAtlas). Sprite handles keep the Billboard field vocabulary as setters; a frame's writes commit once at the end of the frame listener that made them (a microtask outside one). - Models: banks of model mover sets per glTF and look; handles report ready from MoverSet.ready() and computedScale from minimumPixelSize kept on the CPU (radiusM in the spec, the class's nativeRadiusM); poses are Cesium's HPR frame (modelMatrix) turned by Navara's glTF axes (Z_UP_TO_X_UP: its loader is already Z-up; chosen side by side with Cesium among six candidates). - Tracked glyph: a sprite whose position/colour/rotation callbacks are read every frame in preRender; follow = engine.camera.follow with the tracked readout's card as its label (gevFollowHandle); current() maps the follow back to the tracked handle, also while follow() raises followChanged. - Trail and live head: engine.lines (alpha 0.85, depth-fail 0.4, geodesic) in the gev-trail pick namespace. - View: camera/scene adapters over engine.camera.pose() (registered with the engine so shared helpers project through it), frustum and horizon tests, frame number, engine frame events. flights/render/navara.js registers it for 'navara' from the Navara mode's import(); the Navara catalog now offers Live Flights. Also: tracking a contact that is selected but no longer followed follows it again (a camera command ends a Navara follow; on Cesium a search flight releases trackedEntity): trackById/select re-follows instead of only re-publishing. Behaviour change on Cesium only in that case. Tests: the renderer on the fake engine (contract, atlas, banks, per-frame commits, growth, tracked callbacks, follow label, model pose, trails) and the flights logic over it (fleet, click-select, follow, re-follow after a camera command, release, no set left behind).
This commit is contained in:
1 parent
20e9d4a0fa
commit
b14bf7e013
10 files changed
+1530
-3
No files matched your search
+21
-1
@@ -5,7 +5,11 @@
|
||||
|
||||
import { DATA_CREDITS, registerDataCredits } from '../data/dataCredits.js';
|
||||
import { isEmbeddedInline } from './embed.js';
|
||||
import { createLayerAvailability } from './layers/renderers.js';
|
||||
import {
|
||||
createLayerAvailability,
|
||||
layerAvailableOn,
|
||||
registerLayerRenderers,
|
||||
} from './layers/renderers.js';
|
||||
import {
|
||||
getRenderGovernorDiagnostics,
|
||||
governorRequestRender,
|
||||
@@ -45,6 +49,18 @@ const SHELL_CREDIT_KEYS = new Set([
|
||||
'reearth-terrain',
|
||||
]);
|
||||
|
||||
/**
|
||||
* Registers the Navara layer renderers (once per page). Each loads only
|
||||
* here, through import(), so Cesium mode never fetches them.
|
||||
*/
|
||||
export async function registerNavaraLayerRenderers() {
|
||||
if (layerAvailableOn('flights', 'navara')) return;
|
||||
const { createFlightsNavaraRenderer } =
|
||||
await import('../layers/flights/render/navara.js');
|
||||
if (!layerAvailableOn('flights', 'navara'))
|
||||
registerLayerRenderers('navara', { flights: createFlightsNavaraRenderer });
|
||||
}
|
||||
|
||||
/**
|
||||
* The scene on the experimental Navara engine: no viewer and no Cesium
|
||||
* objects. Navara builds the map sources from the controller's descriptions
|
||||
@@ -72,6 +88,10 @@ export async function createNavaraScene({
|
||||
});
|
||||
defer(() => globe.destroy());
|
||||
const { engine } = globe;
|
||||
// The layers drawn on Navara (their render/navara.js), before the catalog
|
||||
// asks the registry which layers this engine shows.
|
||||
await registerNavaraLayerRenderers();
|
||||
signal.throwIfAborted();
|
||||
// The tools install the governor on this engine; it goes before the engine.
|
||||
defer(() => uninstallRenderGovernor(engine));
|
||||
signal.throwIfAborted();
|
||||
|
||||
Reference in new issue
Block a user