mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(street-level): coverage keeps its filter, selection and ground
From the IC8 review of #768 (P2s), each with a test that fails before: - Far-side overview dots no longer show through the globe. They skip the depth test so they stay above Google 3D terrain, so points behind the horizon are now hidden with an EllipsoidalOccluder (as the cyclones layer does), re-culled only when the camera moves. - The per-tile cap applies after the imagery filter: a dense tile of newer flat captures kept no 360° lines at all. Lookup, picking and counts use the drawn set. - Lines whose ground heights were evicted, or whose terrain lookup failed, are cast again on the next refresh instead of staying draped for good (castRequested no longer latches; castAbort marks a cast in flight). The height cache now drops its oldest corners instead of all of them. - A selection made or cleared while a tile's lines rebuild is applied once they are ready (each primitive remembers the selection it was built with). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
f75cdf3626
commit
b1924ebb3e
4 files changed
+464
-60
No files matched your search
@@ -239,6 +239,27 @@ test('a full cache is cleared before a request counts its corners, so the reques
|
||||
assert.ok(caster.castLine(line), 'the whole line casts');
|
||||
});
|
||||
|
||||
test('a full cache drops its oldest corners, not every corner', async () => {
|
||||
const caster = createGroundCaster({
|
||||
terrain: fakeTerrain(),
|
||||
step: 0.001,
|
||||
maxCorners: 4,
|
||||
cacheMax: 12,
|
||||
});
|
||||
// Three cells apart from each other, four corners each: the cache is full.
|
||||
const cells = [10.0005, 10.0105, 10.0205, 10.0305].map((lon) => [
|
||||
lon,
|
||||
50.0005,
|
||||
]);
|
||||
for (const cell of cells.slice(0, 3))
|
||||
assert.equal(await caster.prepare([cell]), true);
|
||||
// A fourth makes room by dropping the first cell only.
|
||||
assert.equal(await caster.prepare([cells[3]]), true);
|
||||
assert.equal(caster.heightAt(...cells[0]), null, 'oldest dropped');
|
||||
for (const cell of cells.slice(1))
|
||||
assert.notEqual(caster.heightAt(...cell), null, 'newer cells kept');
|
||||
});
|
||||
|
||||
test('cancelling a prepare cancels its terrain request', async () => {
|
||||
const seen = [];
|
||||
const caster = createGroundCaster({
|
||||
|
||||
Reference in new issue
Block a user