mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
Move only the anchor's height when the floor height arrives
- The first height that replaces the entry frame's now moves only the anchor's height. The anchor keeps its place and its eased lift, so the camera no longer jumps to a corrected fix or steps back. - A detail line is measured with the title's glyph widths. They are a little wide for its smaller type, so a long detail line is no longer clipped. - The first aircraft update is checked in the existing test, and the copy is removed; test fixtures are simpler. - Comments, the release note and CURRENT-STATE match the code.
This commit is contained in:
1 parent
c190e662bc
commit
83081730c0
9 files changed
+176
-138
No files matched your search
@@ -444,10 +444,10 @@ test('Cockpit places the eye at its aircraft as the Cesium maths did', async ()
|
||||
latitude: 30.19,
|
||||
longitude: -97.67,
|
||||
onGround: false,
|
||||
stale: true,
|
||||
stale: false,
|
||||
};
|
||||
const { owner, views } = cockpitOver({ info, target });
|
||||
// Held on the target while the feed is stale.
|
||||
// The first update stands the anchor on the target.
|
||||
owner.update();
|
||||
let expected = cesiumCockpitEye(Cesium, {
|
||||
target,
|
||||
@@ -456,13 +456,12 @@ test('Cockpit places the eye at its aircraft as the Cesium maths did', async ()
|
||||
dtSec: 0,
|
||||
liftM: 0,
|
||||
});
|
||||
near(views[0].destination, expected.eye, 1e-6, 'stale eye');
|
||||
near(views[0].destination, expected.eye, 1e-6, 'first eye');
|
||||
near(views[0].orientation.direction, expected.forward, 1e-12, 'direction');
|
||||
near(views[0].orientation.up, expected.up, 1e-12, 'up');
|
||||
|
||||
// Live: the anchor coasts 80 ms along the heading and is pulled toward
|
||||
// where the layer now shows the aircraft.
|
||||
info.stale = false;
|
||||
const anchor = Cesium.Cartesian3.clone(expected.anchor);
|
||||
const moved = Cesium.Cartesian3.fromDegrees(-97.6698, 30.1901, 1210);
|
||||
owner.trackedFollow.position = () => moved;
|
||||
@@ -495,38 +494,6 @@ test('Cockpit places the eye at its aircraft as the Cesium maths did', async ()
|
||||
}
|
||||
});
|
||||
|
||||
test("a live aircraft's first Cockpit update stands the anchor on it", async () => {
|
||||
const Cesium = await import('cesium');
|
||||
const env = environment();
|
||||
try {
|
||||
const target = Cesium.Cartesian3.fromDegrees(-97.67, 30.19, 1200);
|
||||
const info = {
|
||||
icao24: 'abc123',
|
||||
layerId: 'flights',
|
||||
track: 72,
|
||||
velocityMps: 200,
|
||||
latitude: 30.19,
|
||||
longitude: -97.67,
|
||||
onGround: false,
|
||||
stale: false,
|
||||
};
|
||||
const { owner, views } = cockpitOver({ info, target });
|
||||
// Entry was a while ago: the step would carry the anchor 20 m ahead.
|
||||
owner.update();
|
||||
const expected = cesiumCockpitEye(Cesium, {
|
||||
target,
|
||||
info: { ...info, stale: true },
|
||||
heading: 72,
|
||||
dtSec: 0,
|
||||
liftM: 0,
|
||||
});
|
||||
near(views[0].destination, expected.eye, 1e-6, 'first live eye');
|
||||
owner.dispose();
|
||||
} finally {
|
||||
env.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test('a grounded Cockpit probes the mesh from the camera and keeps the eye above the floor', async () => {
|
||||
const Cesium = await import('cesium');
|
||||
const env = environment();
|
||||
|
||||
Reference in new issue
Block a user