mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Keep Navara's 3D Tiles where the tileset puts them
Navara's 3D Tiles source defaults to model.height 1, which moves a transformed tileset by a metre along Earth-fixed X: on the synthetic set flat roofs read 0.12 m high and a sloping roof 0.68 m off, and the drawn meshes move with them. The adapter sets the height to 0 and records the package behaviour in WORKAROUNDS.md, with a test that loads the real package. The downward surface ray now takes its direction from the place's own normal, so it no longer drifts sideways. qa-tiles-fixture gains --report (heights and drape pixels per engine, without asserting), starts on Cesium, and checks each drape hidden, shown and hidden again; qa-surface-heights uses the plan's 0.5 m tolerance under tiles and names the point that misses.
This commit is contained in:
1 parent
3c304502a0
commit
00153acbeb
10 files changed
+430
-97
No files matched your search
@@ -23,6 +23,8 @@ import {
|
||||
fixtureRoutes,
|
||||
observeSurfaceMovers,
|
||||
settledPositions,
|
||||
assertTileHeight,
|
||||
waitForSurfaceHeights,
|
||||
} from './qa/surfaceHeights.mjs';
|
||||
|
||||
export function compareHeights(before, after, { tiles = false } = {}) {
|
||||
@@ -82,7 +84,7 @@ export function compareHeights(before, after, { tiles = false } = {}) {
|
||||
!missing.length &&
|
||||
!extra.length &&
|
||||
!invalid.length &&
|
||||
maxAbsM <= 0.1 + 1e-9,
|
||||
maxAbsM <= (tiles ? 0.5 : 0.1) + 1e-9,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -237,32 +239,7 @@ async function main(argv) {
|
||||
},
|
||||
);
|
||||
await whenSettled(page);
|
||||
await page.waitForFunction(
|
||||
({ points, tiles }) => {
|
||||
const { engine } = window.__godsEyeView;
|
||||
engine.render.request('qa-surface-heights');
|
||||
return (
|
||||
engine.surface.tilesLoaded() &&
|
||||
engine.maps.photorealActive() === tiles &&
|
||||
points.every((p) => {
|
||||
const place = {
|
||||
longitude: (p.lon * Math.PI) / 180,
|
||||
latitude: (p.lat * Math.PI) / 180,
|
||||
height: 0,
|
||||
};
|
||||
const height = tiles
|
||||
? engine.surface.sampleHeight(place)
|
||||
: engine.surface.terrainHeight(place);
|
||||
return (
|
||||
Number.isFinite(height) &&
|
||||
(tiles ? Math.abs(height - 50) < 0.1 : height > 1)
|
||||
);
|
||||
})
|
||||
);
|
||||
},
|
||||
{ timeout: 90000 },
|
||||
{ points, tiles },
|
||||
);
|
||||
await waitForSurfaceHeights(page, kind, tiles);
|
||||
await page.evaluate(observeSurfaceMovers);
|
||||
snapshot.engines[kind] = {};
|
||||
for (const layer of layers) {
|
||||
@@ -285,9 +262,10 @@ async function main(argv) {
|
||||
snapshot.engines[kind][layer] = values;
|
||||
if (tiles)
|
||||
for (const [id, p] of Object.entries(values))
|
||||
assert.ok(
|
||||
Math.abs(p.heightM - (50 + offsets[layer])) <= 0.1,
|
||||
`${kind}/${layer}/${id}: ${p.heightM} m, expected ${50 + offsets[layer]} m`,
|
||||
assertTileHeight(
|
||||
p.heightM,
|
||||
50 + offsets[layer],
|
||||
`${kind}/${layer}/${id}`,
|
||||
);
|
||||
await strict.passed(
|
||||
page,
|
||||
@@ -296,7 +274,7 @@ async function main(argv) {
|
||||
values,
|
||||
);
|
||||
console.log(
|
||||
`PASS ${kind}/${layer}: ${rows.length} points${tiles ? ` at ${50 + offsets[layer]} m (±0.1 m)` : ''}`,
|
||||
`PASS ${kind}/${layer}: ${rows.length} points${tiles ? ` at ${50 + offsets[layer]} m (±0.5 m)` : ''}`,
|
||||
);
|
||||
await unloadDisplay(page, layer);
|
||||
}
|
||||
@@ -316,7 +294,7 @@ async function main(argv) {
|
||||
);
|
||||
assert.ok(
|
||||
comparison.ok,
|
||||
'Surface heights differ by more than 0.1 m or the point sets changed',
|
||||
`Surface heights differ by more than ${tiles ? 0.5 : 0.1} m or the point sets changed`,
|
||||
);
|
||||
}
|
||||
console.log(
|
||||
|
||||
Reference in new issue
Block a user