mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Merge main into fix/earthquake-click-details
Resolves conflicts with main: a world focus target's own range past its framed radius replaces the kind's range (#1832), so a quake asks for its own range only past M6 and the earthquake framing stays its floor; FIRMS keeps main's marker stand-in under the card-on-top rule; launches keep main's label click and also read the card on top through the pick registry.
This commit is contained in:
commit
e87aa5190d
1337 files changed
+38638
-9950
No files matched your search
+21
-2
@@ -208,7 +208,7 @@ test('fires frame wider than vessels — a fire is read by its surroundings', ()
|
||||
|
||||
// A large quake's disc does not fit the earthquake framing, so the target
|
||||
// asks for more room; it never gets less than the framing.
|
||||
test('a target can widen its framing, never narrow it', () => {
|
||||
test('a target can widen its framing sphere, never narrow it', () => {
|
||||
const fly = (extra) => {
|
||||
const camera = stubCamera();
|
||||
flyToWorldTarget(bindFakeCesiumCamera({ camera }), {
|
||||
@@ -222,13 +222,32 @@ test('a target can widen its framing, never narrow it', () => {
|
||||
const m72 = fly({ radiusM: 147000, rangeM: 514000 });
|
||||
assert.equal(m72.sphere.radius, 147000);
|
||||
assert.equal(m72.options.offset.range, 514000);
|
||||
const m3 = fly({ radiusM: 8000, rangeM: 28000 });
|
||||
const m3 = fly({ radiusM: 8000 });
|
||||
assert.equal(m3.sphere.radius, WORLD_FOCUS_FRAMING.earthquake.radiusM);
|
||||
assert.equal(m3.options.offset.range, WORLD_FOCUS_FRAMING.earthquake.rangeM);
|
||||
const bad = fly({ radiusM: NaN, rangeM: -1 });
|
||||
assert.equal(bad.options.offset.range, WORLD_FOCUS_FRAMING.earthquake.rangeM);
|
||||
});
|
||||
|
||||
test("a target's own range stands the camera off that far, past the framed radius", () => {
|
||||
const range = (rangeM) => {
|
||||
const camera = stubCamera();
|
||||
flyToWorldTarget(bindFakeCesiumCamera({ camera }), {
|
||||
kind: 'fire',
|
||||
id: 'fire-1',
|
||||
position: POSITION,
|
||||
rangeM,
|
||||
});
|
||||
const { sphere, options } = camera.calls.flights[0];
|
||||
assert.equal(sphere.radius, WORLD_FOCUS_FRAMING.fire.radiusM);
|
||||
return options.offset.range;
|
||||
};
|
||||
assert.equal(range(24_000), 24_000);
|
||||
// Inside the framed sphere, or not a number: the kind's own range.
|
||||
for (const value of [WORLD_FOCUS_FRAMING.fire.radiusM, 0, -5, NaN, '9000'])
|
||||
assert.equal(range(value), WORLD_FOCUS_FRAMING.fire.rangeM);
|
||||
});
|
||||
|
||||
test('every framing is a real oblique standoff, not a nadir or an inside-out sphere', () => {
|
||||
const kinds = Object.keys(WORLD_FOCUS_FRAMING);
|
||||
assert.deepEqual(kinds.sort(), [
|
||||
|
||||
Reference in new issue
Block a user