mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
Fix the review findings across the engines, layers, data and QA
Navara now matches Cesium where the review found it diverging: a flight holds the camera inputs, camera.changed counts turns as Cesium does, render requests made during a frame survive it, follow pinches zoom, ground widths follow the pixel ratio and Cyber sonar reaches glyph caches and models. On Cesium, a staged imagery swap keeps loading tiles, setView replaces a running flight, and a cleared weather detail goes away. The contract gains MoverSet.failed, maps.terrainRevision, render.maxTextureSize and surface.sampleTerrainMostDetailed on every engine, so layers retry failed models, key road heights by terrain, size weather textures to the GPU and place Bhote Koshi cards on detailed terrain. Engine switches keep the live view, follows, focus, layer options and cards: a pick hands over the exact pose, applies no address options and pans no carried-over card; a history visit still applies its entry. Layers put GhostMaps pins, cable landings, OSM Places and directions on the measured surface without per-frame sampling, draw the Cockpit contact dot, hide disabled CCTV on attach, and keep ALPR running outside secure contexts. KML imports draw raised polygon fills, rotated and coloured ground overlays and north-referenced icon headings, and report files with nothing to draw. QA scripts read the contract instead of Cesium internals (test:track is 109/109 again), wait for the camera to rest before clicking, and give cold switches and parked engines realistic time. Docs follow the code.
This commit is contained in:
1 parent
69fbf5b38d
commit
0ef29781e5
276 files changed
+7217
-1517
No files matched your search
@@ -77,9 +77,11 @@ const SCRIPTABLE = new Set([
|
||||
'sampleHeight',
|
||||
'sampleHeightDetailed',
|
||||
'terrainHeight',
|
||||
'sampleTerrainMostDetailed',
|
||||
'clampToHeight',
|
||||
'tilesLoaded',
|
||||
'worldToWindow',
|
||||
'moverFailed',
|
||||
]);
|
||||
const EASINGS = {
|
||||
linear: (t) => t,
|
||||
@@ -254,13 +256,16 @@ export function createFakeEngine(options = {}) {
|
||||
};
|
||||
});
|
||||
// Movers keep their store for tests; commit counts as a render request.
|
||||
const moverRegistry = createMoverRegistry(() => {
|
||||
const moverRegistry = createMoverRegistry((options) => {
|
||||
const part = {
|
||||
commits: 0,
|
||||
commit() {
|
||||
part.commits++;
|
||||
fake.renderRequests++;
|
||||
},
|
||||
// Scripted as 'moverFailed' (set id, index) for a load that fails.
|
||||
failed: (index) =>
|
||||
scripted('moverFailed', [options.id, index], () => false),
|
||||
destroy() {},
|
||||
};
|
||||
return part;
|
||||
@@ -340,7 +345,14 @@ export function createFakeEngine(options = {}) {
|
||||
renderRequests: 0,
|
||||
cameraInputsEnabled: true,
|
||||
credits: [],
|
||||
maps: { imagery: undefined, terrain: undefined, photoreal: null },
|
||||
maps: {
|
||||
imagery: undefined,
|
||||
terrain: undefined,
|
||||
photoreal: null,
|
||||
terrainRevision: 0,
|
||||
},
|
||||
// render.maxTextureSize: a common WebGL2 limit; tests set a smaller one.
|
||||
maxTextureSize: 4096,
|
||||
destroyed: false,
|
||||
};
|
||||
const record = (method, args) => fake.calls.push({ method, args });
|
||||
@@ -523,6 +535,7 @@ export function createFakeEngine(options = {}) {
|
||||
command('camera.setView', [view]);
|
||||
if (!view?.destination)
|
||||
throw new TypeError('setView needs a destination');
|
||||
cancelCurrentFlight();
|
||||
apply(viewFor(view.destination, view.orientation, CESIUM_DEFAULTS));
|
||||
},
|
||||
flyTo(flightOptions) {
|
||||
@@ -780,6 +793,7 @@ export function createFakeEngine(options = {}) {
|
||||
continuous = Boolean(enabled);
|
||||
},
|
||||
isContinuous: () => continuous,
|
||||
maxTextureSize: () => fake.maxTextureSize,
|
||||
setSharpen(options) {
|
||||
record('render.setSharpen', [options]);
|
||||
sharpen = mergeSharpen(sharpen, options);
|
||||
@@ -823,6 +837,14 @@ export function createFakeEngine(options = {}) {
|
||||
return scripted('terrainHeight', [position], () => 0);
|
||||
},
|
||||
terrainHeightSupported: true,
|
||||
async sampleTerrainMostDetailed(positions) {
|
||||
record('surface.sampleTerrainMostDetailed', [positions]);
|
||||
return scripted('sampleTerrainMostDetailed', [positions], () =>
|
||||
positions.map((position) =>
|
||||
scripted('terrainHeight', [position], () => 0),
|
||||
),
|
||||
);
|
||||
},
|
||||
clampToHeight(position, exclude) {
|
||||
record('surface.clampToHeight', [position, exclude]);
|
||||
return scripted('clampToHeight', [position, exclude], () => undefined);
|
||||
@@ -894,6 +916,7 @@ export function createFakeEngine(options = {}) {
|
||||
)
|
||||
throw new TypeError(`Unknown terrain source: ${kind}`);
|
||||
fake.maps.terrain = source;
|
||||
fake.maps.terrainRevision++;
|
||||
},
|
||||
async setPhotorealTiles(source) {
|
||||
record('maps.setPhotorealTiles', [source]);
|
||||
@@ -914,6 +937,7 @@ export function createFakeEngine(options = {}) {
|
||||
baseImagery: fake.maps.imagery ?? null,
|
||||
photoreal: fake.maps.photoreal,
|
||||
}),
|
||||
terrainRevision: () => fake.maps.terrainRevision,
|
||||
},
|
||||
destroy() {
|
||||
record('destroy', []);
|
||||
|
||||
Reference in new issue
Block a user