mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 16:52:20 +00:00
Keep the cockpit camera steady near the ground on both engines
Cesium lifts a camera below its globe every frame, between the cockpit's 20 Hz updates, so an eye placed under the terrain (an aircraft reading below it on a cold floor cell) jumped up and down. The cockpit now also keeps its eye above the engine's own surface. Navara's ground floor stands aside while the camera inputs are off, since the cockpit places the camera itself.
This commit is contained in:
1 parent
9825b02aab
commit
90166024e9
8 files changed
+105
-9
No files matched your search
@@ -562,6 +562,21 @@ test('the floor does not fight flights or a lookAt target', () => {
|
||||
engine.destroy();
|
||||
});
|
||||
|
||||
test('the floor stands aside while the camera inputs are off (the cockpit drives it)', () => {
|
||||
const { engine, view } = setup();
|
||||
view.sampleTerrainHeight = () => 100;
|
||||
engine.input.setCameraInputs(false);
|
||||
engine.camera.setView({
|
||||
destination: cartesian3.fromDegrees(2.35, 48.85, 112),
|
||||
});
|
||||
view.emit('preRender', 1);
|
||||
near(heightOf(engine), 112, 1e-6, 'the cockpit eye 12 m up is kept');
|
||||
engine.input.setCameraInputs(true);
|
||||
view.emit('preRender', 2);
|
||||
near(heightOf(engine), 130, 1e-6, 'lifted once the inputs are back');
|
||||
engine.destroy();
|
||||
});
|
||||
|
||||
test('the ground floor reports its own ground and margin (diagnostics, not contract)', () => {
|
||||
const { engine } = setup();
|
||||
assert.equal(typeof engine.groundFloor.ground, 'function');
|
||||
|
||||
Reference in new issue
Block a user