mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
10d0e49ddb3b65bd9a13f864875ac9d75ef0d263
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
10d0e49ddb |
fix(globe): Navara aircraft models face, size and light as Cesium's (10b review 3)
The near-pose finding (Navara models faint, Cesium ~23 bright aircraft) came from the side-by-side's frozen page clock: the fleet tick ran once per pose, so Cesium never handed its aircraft to their models and drew 3× glyphs, against real models on Navara. With the hand-off driven (the move ends every 10 frames while a pose loads), both engines draw models, and the comparison showed three real differences, all fixed: - Orientation: Navara's glTF loader is three's GLTFLoader, which keeps the scene Y-up; the instance turn is now Cesium's whole axis correction (Y_UP_TO_Z_UP × Z_UP_TO_X_UP), not Z_UP_TO_X_UP alone. Every fleet model drew 90° off its heading. - Size: minimumPixelSize is taken at Cesium's distance (Camera distanceToBoundingSphere: view depth less the radius at the model's own scale), in the mover and in ModelHandle.computedScale; the straight-line distance drew off-centre models up to 16 % larger. - Colour: the instance colour tints by the set's blend amount (Cesium's colorBlendAmount) and its alpha is the model's opacity (Cesium: a model colour's alpha makes it translucent), not a blend weight; a model is translucent only while faded. An ambient share of the tinted surface (MODEL_AMBIENT 0.5, Cesium's image-based lighting) keeps a tinted aircraft near-white at a low sun (median luminance 139 → 190; Cesium 197). qa-flights-engines (now --layer=flights|military) gates the near pose with --models=on: computed scale within ±5 % per model (ratio 1.000007), footprint against the same view with the layer off within ±20 % (1553 vs 1496 px, 104 %), median luminance within ±10 % (189.8 vs 196.7). The probe's drawn() reports a model's computedScale. Flights models on: 19/19. |
||
|
|
9dc446bd24 |
feat(military): render on Navara
Task 11b. src/layers/military/render/navara.js: the shared Navara aircraft renderer with the military's sprite slot (SPRITE_LAYER_ORDER 'military', under flights) and jet.glb's nose offset; registered by registerNavaraLayerRenderers (now a table of lazily imported factories, flights and military), so the Navara catalog offers military and the main chunk stays without three/Navara. - The follow passes between aircraft layers on Navara as on Cesium: the follow-handle → tracked-handle map and the "follow being started" handle are shared by every aircraft renderer of the page, so a layer whose follow another layer took reads the new owner's tracked handle (and its gevSelectionOrigin) — before, it read a bare follow handle and reported 'programmatic'. - trackById on a selected-but-not-followed contact follows it again (as flights since 10b; on Navara any camera command ends a follow). - qaDrawn (the probe's drawn()) for military, shared with flights (src/layers/aircraft/qaDrawn.js). - ?qaFeed=military:synthetic[:count]: seeded readsb rows (1 000 by default, 150 near JFK, 12 on the ground, 8 types), the first 25 hexes shared with the synthetic civil flights. - qa-w1-layers: sections 4–6 read the --layer's module (were 'flights'); section 5 keeps the queries beside the voice answers (the voice block overwrote them, so --compare never compared queries); for military: the follow passes military → flights → military, and flights leaves the 25 shared aircraft to military while it is on (9 975 / 10 000 / 9 975). qa-w1-layers --layer=military: Cesium 25/25, Navara 26/26, --compare parity (queries included; the known 2.3 px camera offset at the global pose only). |
||
|
|
7c0891deda |
refactor(military): Cesium rendering behind a renderer interface
Task 11a. The military flights logic no longer imports Cesium: it draws
through the shared aircraft renderer (src/layers/aircraft/render/cesium.js)
with the military's parameters in src/layers/military/render/cesium.js
(sprite-order slot 'military', jet.glb's 180° nose offset), registered for
'cesium' in the renderer registry and created at init(viewer, {engine}).
The same pure move as flights in 10a:
- Fleet: the BillboardCollection and its sprite-order slot (enable keeps
restoreSpriteOrder, as before); sprites stay Billboard handles.
- Models: fleet/tracked/preload glTF loads (asynchronous:false, MIX tint at
MODEL_COLOR_BLEND_AMOUNT, IR boost as `unlit` → the UNLIT CustomShader),
the model collection, setPose. The per-class specs keep their own nose
offset: setPose takes an optional offsetDeg (default the layer's), on
both aircraft renderers (same arithmetic, test added).
- Tracked: the ENU billboard Entity with its position/colour/rotation
callbacks (#FFD166, transparent amber once the model owns the visual),
viewFrom, followed through viewer.trackedEntity + the one exact tracked
frame; refocusTrackedById through follow.refocus.
- Trail: the entity trail and the floored live head segment.
- View: camera/scene reads, frame number, frustum and horizon tests,
render requests, frame events.
- Clicks and Escape go through the engine's selection dispatcher (the
ScreenSpaceEventHandler and keydown listener are gone); the cross-layer
untrack watches the renderer's follow. Same rules: cockpit clicks are
inert, the tracked visual/model is a no-op, another layer's pick is not
empty space, an unowned pick is.
- Colours are engine-neutral Rgba (MIL_ICON_COLOR #FFB800,
TRACKED_ICON_COLOR #FFD166, AMBER_TRANSPARENT), NearFarScalar →
nearFarScale; Cesium math → src/geo.
- check-import-directions: src/layers/military/ joins the rendered layers
(cesium only in render/cesium*.js).
- The military registry and the flights' duplicate suppression are
untouched.
Source-text tests updated with the moved code, same meaning:
- militaryAwareness.test: military's hasContact guard reads fleet.visible().
- trackingClickGesture.test: the military gesture rules are the
dispatcher's (selection gesture before select, click classifier before
the empty-space clear), military answers the empty click with a
user-origin clear — the same assertion flights already had.
- ownership.test: the services fixture names selection and renderer; the
app-composed services build the layer's Cesium renderer.
- renderers.test: flights and military have extracted Cesium renderers.
New tests: the military logic over a plain-data renderer and a fake engine
(amber fleet, click-select, #FFD166 tracked glyph, no-op on the tracked
visual, empty-click and Escape release, the keyboard left on destroy); the
plain-data renderer moved to src/testSupport for both aircraft layers;
setPose with a per-model offset.
W1 replay vs
|
||
|
|
b14bf7e013 |
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). |