mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Fly the route dolly with the geo maths and ask its mesh probe through the height gateway
The route dolly's frame (arc points, horizontal chords, turn angles, the heading's turn toward the gaze, the bank roll and the eye) and the corridor cells now use src/geo instead of Cesium's Cartesian3, Cartographic, Quaternion and Matrix3, with the same formulas in the same order, so every frame comes out bit for bit as before. The mesh floor probe takes the viewer and asks heights through heightsOf, so it sees through draw sets not drawn for height queries, as every other height read does.
This commit is contained in:
1 parent
e37349a061
commit
2c7f882bd2
2 files changed
+115
-172
No files matched your search
@@ -8,6 +8,7 @@
|
||||
* anything interrupts it.
|
||||
*/
|
||||
import { bindFakeCesiumCamera } from './testSupport/fakeCameraPort.mjs';
|
||||
import { bindRenderer } from './render/rendererOf.js';
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import * as Cesium from 'cesium';
|
||||
@@ -107,11 +108,12 @@ function createTickableViewer({ heightM = 700 } = {}) {
|
||||
canvas: { addEventListener() {}, removeEventListener() {} },
|
||||
tweens: [],
|
||||
requestRender() {},
|
||||
// A live app has a rendered surface under the route; the mesh probe reads
|
||||
// it, so these flights start immediately rather than arming.
|
||||
sampleHeight: () => 0,
|
||||
},
|
||||
camera,
|
||||
}, {
|
||||
// A live app has a rendered surface under the route; the mesh probe reads
|
||||
// it, so these flights start immediately rather than arming.
|
||||
query: { sampleHeightNow: () => 0 },
|
||||
});
|
||||
return {
|
||||
viewer,
|
||||
@@ -562,12 +564,17 @@ test('the rendered mesh answers when the DEM never will — once, and only once'
|
||||
test('probeMeshFloorM reports COVERAGE, not just a height', () => {
|
||||
assert.deepEqual(probeMeshFloorM(null, [{ lat: 1, lon: 1 }]),
|
||||
{ heightM: Number.NaN, sampled: 0, requested: 1 }, 'no scene, no reading');
|
||||
assert.deepEqual(probeMeshFloorM({ sampleHeight: () => 120 }, []),
|
||||
const surface = (sampleHeightNow) => {
|
||||
const viewer = {};
|
||||
bindRenderer(viewer, { query: { sampleHeightNow } });
|
||||
return viewer;
|
||||
};
|
||||
assert.deepEqual(probeMeshFloorM(surface(() => 120), []),
|
||||
{ heightM: Number.NaN, sampled: 0, requested: 0 }, 'no cells, no reading');
|
||||
// Cells whose tiles are not streamed contribute NOTHING — silence must never
|
||||
// be mistaken for flat ground, which is why the caller gets a count.
|
||||
const partial = probeMeshFloorM(
|
||||
{ sampleHeight: (c) => (c.longitude > 0 ? 340 : undefined) },
|
||||
surface((point) => (point.lon > 0 ? 340 : null)),
|
||||
[{ lat: 1, lon: 1 }, { lat: 1, lon: -1 }],
|
||||
);
|
||||
assert.equal(partial.heightM, 340, 'the probe takes the HIGHEST surface it saw');
|
||||
|
||||
Reference in new issue
Block a user