mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(weather): upright N. America cloud tiles; lift shells over coarse 3D tiles (#730)
This commit is contained in:
1 parent
082074a006
commit
005254fcd1
7 files changed
+130
-3
No files matched your search
@@ -6,6 +6,7 @@ import {
|
||||
createWeatherShell,
|
||||
detailWindow,
|
||||
orderWeatherShells,
|
||||
shellLift,
|
||||
WEATHER_SHELL_CACHE_BYTES,
|
||||
WEATHER_SHELL_HEIGHTS,
|
||||
} from './shellRendering.js';
|
||||
@@ -297,6 +298,44 @@ test('a surface applies a new detail window only once its image has drawn; the s
|
||||
assert.equal(scene.postRender.size, 0);
|
||||
});
|
||||
|
||||
test('shells rise with the camera over coarse 3D tiles, in steps, up to 60 km', () => {
|
||||
assert.equal(shellLift(undefined), 0);
|
||||
assert.equal(shellLift(1_200), 0, 'city views keep the shell heights');
|
||||
assert.equal(shellLift(3_000_000), 12_000);
|
||||
assert.equal(shellLift(8_000_000), 32_000);
|
||||
assert.equal(shellLift(18_500_000), 60_000);
|
||||
const camera = { positionCartographic: { height: 1_200 } };
|
||||
const scene = {
|
||||
primitives: new Cesium.PrimitiveCollection(),
|
||||
preRender: new Cesium.Event(),
|
||||
postRender: new Cesium.Event(),
|
||||
camera,
|
||||
requestRender() {},
|
||||
};
|
||||
const surface = createShellSurface({
|
||||
viewer: { scene },
|
||||
cesium: Cesium,
|
||||
rectangle: Cesium.Rectangle.fromDegrees(-130, 20, -60, 55),
|
||||
height: 5_800,
|
||||
});
|
||||
const primitive = scene.primitives.get(0);
|
||||
const identity = primitive.modelMatrix;
|
||||
scene.preRender.raiseEvent();
|
||||
assert.equal(primitive.modelMatrix, identity, 'no lift, no new matrix');
|
||||
camera.positionCartographic.height = 8_000_000;
|
||||
scene.preRender.raiseEvent();
|
||||
const radius = Cesium.Ellipsoid.WGS84.maximumRadius;
|
||||
assert.ok(
|
||||
Math.abs(primitive.modelMatrix[0] * radius - (radius + 32_000)) < 1e-3,
|
||||
);
|
||||
const lifted = primitive.modelMatrix;
|
||||
camera.positionCartographic.height = 8_010_000;
|
||||
scene.preRender.raiseEvent();
|
||||
assert.equal(primitive.modelMatrix, lifted, 'the same step keeps the matrix');
|
||||
surface.destroy();
|
||||
assert.equal(scene.preRender.numberOfListeners, 0);
|
||||
});
|
||||
|
||||
test('real Cesium builds the two-texture material, the opaque-pass appearance and the rectangle primitive', () => {
|
||||
const scene = {
|
||||
primitives: new Cesium.PrimitiveCollection(),
|
||||
|
||||
Reference in new issue
Block a user