mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Cut duplicated and dead code across the engines, the layers and the QA scripts
- src/geo drops the ported debug argument checks and the tests that bitExact already covers; package boundaries accept a directory entry, so src/geo/ is listed once per group. - Cesium no longer carries movers and lines nobody draws with: they are optional engine capabilities. The fake engine and the Cesium camera use the shared cameraMath; unused contract tables, clock.ticked, the 'finest' surface detail and Navara click statistics are gone. - ALPR keeps one overlay core and one presentation model for both engines, bikeshare one station bookkeeping, the Navara ground effects one definition helper; image atlases, view centres, mover banks and colours are shared. - The legacy switch route, the clock offset and rate controls and other unused exports are removed. - The acceptance runs the Navara draw, geo import and scope checks; scenarios use the harness switch and page helpers; the main chunk check keeps the size budget only and runs once in CI.
This commit is contained in:
1 parent
c502404e1d
commit
7abf74518f
272 files changed
+4828
-10213
No files matched your search
@@ -261,10 +261,8 @@ const TRACKED_RASTER_PX = 192;
|
||||
* Default size serves the fleet; pass `aircraftIcon(kind, TRACKED_ICON_PX)`
|
||||
* (re-exported below) for the tracked billboard. */
|
||||
export const TRACKED_ICON_PX = TRACKED_RASTER_PX;
|
||||
/** The fleet raster size (aircraftIcon's default). */
|
||||
export const FLEET_ICON_PX = FLEET_RASTER_PX;
|
||||
/** Every silhouette kind aircraftIcon draws (an engine's sprite atlas). */
|
||||
export const AIRCRAFT_ICON_KINDS = Object.freeze(Object.keys(BODIES));
|
||||
const AIRCRAFT_ICON_KINDS = Object.freeze(Object.keys(BODIES));
|
||||
export function aircraftIcon(kind, px = FLEET_RASTER_PX) {
|
||||
const k = BODIES[kind] ? kind : 'airliner';
|
||||
const key = `${k}@${px}`;
|
||||
|
||||
@@ -2,8 +2,8 @@ import { engineFromViewer } from '../globe/cesium/engineFromViewer.js';
|
||||
|
||||
/**
|
||||
* Arrival corrections belong to one globe engine and yield to its next camera
|
||||
* owner. Callers may name the engine or (layers until phase 1c) the viewer it
|
||||
* is registered for; both reach the same correction.
|
||||
* owner. Callers may name the engine or (layers that still hold one) the
|
||||
* viewer it is registered for; both reach the same correction.
|
||||
*/
|
||||
const arrivals = new WeakMap();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ for (const layer of LAYERS) {
|
||||
|
||||
test(`${layer.name}: every GLB creation bypasses the tile-contended frame-spread queue`, () => {
|
||||
// The aircraft renderer loads through its `loadModel`, Cesium.Model.fromGltfAsync
|
||||
// unless a test injects a loader (phase 3).
|
||||
// unless a test injects a loader.
|
||||
assert.match(source, /loadModel = \(options\) => Cesium\.Model\.fromGltfAsync\(options\)/);
|
||||
const calls = [...source.matchAll(/(?:Cesium\.Model\.fromGltfAsync|\bloadModel)\(\{([\s\S]*?)\}\)/g)];
|
||||
assert.ok(calls.length >= 3, `expected fleet, tracked, and preload model calls; found ${calls.length}`);
|
||||
|
||||
@@ -34,7 +34,7 @@ export const OPENMAPTILES_CREDIT = {
|
||||
key: 'openfreemap',
|
||||
html: 'Vector tiles: <a href="https://openfreemap.org" target="_blank" rel="noopener">OpenFreeMap</a> © <a href="https://openmaptiles.org" target="_blank" rel="noopener">OpenMapTiles</a>',
|
||||
};
|
||||
export const GOOGLE_PLACES_CREDIT = {
|
||||
const GOOGLE_PLACES_CREDIT = {
|
||||
key: 'google-maps-places',
|
||||
html: 'Google Maps Places: <a href="https://developers.google.com/maps/documentation/places/web-service/policies" target="_blank" rel="noopener">Google Maps</a>',
|
||||
};
|
||||
@@ -45,7 +45,7 @@ const viewerCredits = new WeakMap();
|
||||
|
||||
/**
|
||||
* Credits of a globe engine, or of a Cesium viewer's credit display for
|
||||
* callers that still hold a viewer (layers until phase 1c); null without one.
|
||||
* callers that still hold a viewer (Cesium layers); null without one.
|
||||
* @returns {{ addStatic: Function, request: () => void } | null}
|
||||
*/
|
||||
function creditsOf(target) {
|
||||
|
||||
@@ -143,7 +143,7 @@ test('every scene click handler consults ownership before it picks', () => {
|
||||
'src/layers/submarineCables/interaction.js',
|
||||
'viewer.scene.pick(click.position)',
|
||||
],
|
||||
// Vessels take the engine dispatcher's pick (phase 3, 13a): the guard
|
||||
// Vessels take the engine dispatcher's pick: the guard
|
||||
// comes before the click rule reads it.
|
||||
['src/layers/vessels/selection.js', 'resolvePickId(picked)'],
|
||||
];
|
||||
|
||||
@@ -140,7 +140,7 @@ test('sampler on a globe engine: samples engine.surface and latches against the
|
||||
assert.equal(cachedMeshFloor(cell.lat, cell.lon), 137.0);
|
||||
const [call] = engine.fake.callsOf('surface.sampleHeightDetailed');
|
||||
assert.ok(Math.abs(Cesium.Math.toDegrees(call.args[0].latitude) - cell.lat) < 1e-9);
|
||||
assert.deepEqual(call.args[1], { exclude: ['own'], lod: 'visible' });
|
||||
assert.deepEqual(call.args[1], { exclude: ['own'] });
|
||||
});
|
||||
|
||||
test('sampler: a coarse tile answer is a miss; a fine one latches', async () => {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Native constants shared by the W1 adapters; keep the SDK import here.
|
||||
// Read on call: the production build's Cesium global loads with the first
|
||||
// Cesium globe, after this module has loaded on a Navara start.
|
||||
import { Axis, ScreenSpaceEventType } from 'cesium';
|
||||
import { ScreenSpaceEventType } from 'cesium';
|
||||
|
||||
export const modelAxis = () => Axis;
|
||||
export const trackingEventTypes = () => ScreenSpaceEventType;
|
||||
@@ -1,6 +1,6 @@
|
||||
import { nearbyContact } from './pickRegistry.js';
|
||||
// One selection dispatcher for the layers that have moved onto the globe
|
||||
// engine (phase 3 Task 4): one click subscription with picks
|
||||
// One selection dispatcher for the layers that draw through the globe
|
||||
// engine: one click subscription with picks
|
||||
// (engine.input.on('click', …, { pick: true, drill: 8 })), the press
|
||||
// gesture and one Escape listener, instead of a ScreenSpaceEventHandler
|
||||
// per layer. Owners register as with pickRegistry (registerPickOwner, so
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
isTrackingSelectionGesture,
|
||||
} from './trackingClickGesture.js';
|
||||
|
||||
export const SELECTION_DRILL = 8;
|
||||
const SELECTION_DRILL = 8;
|
||||
|
||||
/**
|
||||
* @param {import('../globe/contract.js').GlobeEngine} engine
|
||||
|
||||
@@ -109,7 +109,7 @@ test('flights, AIS, and FIRMS enable paths are wired through the shared sprite r
|
||||
assert.deepEqual(calls, [viewer, viewer, viewer]);
|
||||
|
||||
const firmsLayer = createFirmsHeatmapLayer({ id: 'firms', name: 'FIRMS' });
|
||||
// Flights draws through its renderer (phase 3): enable asks the fleet to
|
||||
// Flights draws through its renderer: enable asks the fleet to
|
||||
// restore its order, which the Cesium aircraft renderer wires to the shared
|
||||
// restorer under the flights' sprite slot.
|
||||
assert.match(flightsLayer.enable.toString(), /fleet\.restoreOrderOnEnable\(\)/);
|
||||
|
||||
@@ -114,7 +114,7 @@ test('civilian and military click handlers apply duration only at the deselect b
|
||||
readLayerSource(new URL('./flights.js', import.meta.url)),
|
||||
readLayerSource(new URL('./militaryFlights.js', import.meta.url)),
|
||||
];
|
||||
// Flights and military moved to the selection dispatcher (phase 3), whose
|
||||
// Flights and military use the selection dispatcher, whose
|
||||
// source applies the same two rules: the selection gesture before a
|
||||
// select, the full click classifier before the empty-space deselect, which
|
||||
// each layer answers with a user-origin clear.
|
||||
|
||||
Reference in new issue
Block a user