mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 03:14:00 +00:00
fix(street-level): keep cones on low ground, and gekh's P3s
From gekh's review of db79027, each with a test that fails before:
- P2: image cones and the photo marker no longer disappear where the
ground lies below the WGS84 ellipsoid (NYC -22 m, Colombo -95 m). The
horizon cull's occluder is WGS84 shrunk by 1 km (HORIZON_CULL_DEPTH_M),
below any real surface, so a camera near or under the ellipsoid no
longer treats every lower point as behind the horizon; the far side of
the Earth is still hidden from orbit (tested).
- Mesh range across the date line: the camera's longitude is taken to the
box's side of +-180 before clamping (meshBoxInRange), so a tile just
across the line is not measured from its far edge.
- MapillaryJS no longer tracks window resizes (trackResize: false): the
panel's ResizeObserver resizes the viewer and skips it while hidden, so
a window resize after closing a photo cannot ask for a tile at z=NaN.
- A key-less install sends no tile requests before the key status is
known: coverage waits for the first status answer and the provider
refreshes it once the status lands.
- constructCatalog takes the source method list from MAPILLARY_SOURCE_
METHODS; sequences.js imports view.js once; the provider's unused
re-exports are gone.
Verified: unit 5970 pass; strict fixture gate on a production build 28 ok
+ 2 "no Google 3D" skips and the panel gate 6/6 (QA_FAIL_ON_RETRY=1);
live gate with a real token 25 ok + 3 fixture-only skips.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
db79027998
commit
c65feda4b1
10 files changed
+208
-19
No files matched your search
@@ -265,3 +265,58 @@ test('the horizon cull stops listening once nothing is left, and starts again fo
|
||||
assert.equal(h.changes(), 2, 'a redraw for each change');
|
||||
h.cull.stop();
|
||||
});
|
||||
|
||||
/** A cull over `points` ([lon, lat, height]) seen from a camera at `camera`. */
|
||||
function cullFrom(camera, points) {
|
||||
const items = points.map(([lon, lat, height]) => ({
|
||||
position: Cesium.Cartesian3.fromDegrees(lon, lat, height),
|
||||
show: true,
|
||||
}));
|
||||
const horizon = createHorizonCull({
|
||||
getViewer: () => ({
|
||||
camera: { positionWC: Cesium.Cartesian3.fromDegrees(...camera) },
|
||||
scene: { preRender: { addEventListener: () => () => {} } },
|
||||
}),
|
||||
items: () => items,
|
||||
});
|
||||
horizon.update();
|
||||
horizon.stop();
|
||||
return items.map((item) => item.show);
|
||||
}
|
||||
|
||||
test('cones and the marker stay visible on ground below the WGS84 ellipsoid (gekh P2)', () => {
|
||||
// NYC in FOLLOW: eye 2.4 m above ground at -22 m, a cone 10 m away.
|
||||
assert.deepEqual(
|
||||
cullFrom([-74.006, 40.7128, -19.6], [[-74.006, 40.71289, -22]]),
|
||||
[true],
|
||||
);
|
||||
// Colombo framing view: camera at -21 m, cones at -95 m about 80 m away.
|
||||
assert.deepEqual(
|
||||
cullFrom(
|
||||
[79.8612, 6.9271, -21],
|
||||
[
|
||||
[79.8612, 6.92782, -95],
|
||||
[79.86192, 6.9271, -95],
|
||||
],
|
||||
),
|
||||
[true, true],
|
||||
);
|
||||
// Austin, ground well above the ellipsoid: as before.
|
||||
assert.deepEqual(
|
||||
cullFrom([-97.7431, 30.2672, 132], [[-97.7431, 30.2681, 130]]),
|
||||
[true],
|
||||
);
|
||||
});
|
||||
|
||||
test('the horizon cull still hides the far side of the Earth from orbit (gekh P2)', () => {
|
||||
assert.deepEqual(
|
||||
cullFrom(
|
||||
[0, 0, 20_000_000],
|
||||
[
|
||||
[10, 10, 0],
|
||||
[180, 0, 0],
|
||||
],
|
||||
),
|
||||
[true, false],
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user