mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
3D models only within 3 km of the camera, at true size
An aircraft, vessel, transit or rail vehicle now draws as its 3D model only when it is within 3 km of the camera, and as its icon farther away. A model already drawn is kept out to 3.6 km, so a vehicle on the edge does not flicker. Proximity and All use the same distance and still differ by how many models they allow (150 and 350). Models are drawn at their true size: the minimum pixel size that inflated distant models is gone. The camera altitude above which no model is considered is now the highest aircraft the layers draw (30 km) plus the 3.6 km, so a camera high above the ground still models an aircraft close to it. Cockpit's aircraft silhouettes keep their own 150/185 km and 400/450 km bands, since they are icons.
This commit is contained in:
1 parent
624c229bc2
commit
36624cd329
22 files changed
+260
-181
No files matched your search
@@ -70,19 +70,24 @@ for (const layer of LAYERS) {
|
||||
'the tracked-model driver uses the cockpit-aware predicate');
|
||||
});
|
||||
|
||||
test(`${layer.name}: Cockpit uses standard Proximity and All radii with a lower cap`, () => {
|
||||
assert.equal(numericConstant(source, 'MODEL_PROX_ADD_M'), 150_000);
|
||||
assert.equal(numericConstant(source, 'MODEL_PROX_KEEP_M'), 185_000);
|
||||
assert.equal(numericConstant(source, 'MODEL_ALL_ADD_M'), 400_000);
|
||||
assert.equal(numericConstant(source, 'MODEL_ALL_KEEP_M'), 450_000);
|
||||
test(`${layer.name}: models draw within 3 km in both modes; Cockpit's AIR band keeps its own radii`, () => {
|
||||
assert.equal(numericConstant(source, 'MODEL_ADD_M'), 3000);
|
||||
assert.equal(numericConstant(source, 'MODEL_KEEP_M'), 3600);
|
||||
assert.equal(numericConstant(source, 'COCKPIT_MODEL_MAX'), 60);
|
||||
|
||||
const add = /^([ \t]*)function _modelAddDistM\b[\s\S]*?\n\1\}/m.exec(source)?.[0];
|
||||
const keep = /^([ \t]*)function _modelKeepDistM\b[\s\S]*?\n\1\}/m.exec(source)?.[0];
|
||||
assert.match(add, /(?:(?:flightState|state)\.)?_models3dMode\s*===\s*'all'\s*\?\s*(?:policy\.)?MODEL_ALL_ADD_M\s*:\s*(?:policy\.)?MODEL_PROX_ADD_M/);
|
||||
assert.match(keep, /(?:(?:flightState|state)\.)?_models3dMode\s*===\s*'all'\s*\?\s*(?:policy\.)?MODEL_ALL_KEEP_M\s*:\s*(?:policy\.)?MODEL_PROX_KEEP_M/);
|
||||
assert.doesNotMatch(add, /COCKPIT_MODEL_ADD_M/);
|
||||
assert.doesNotMatch(keep, /COCKPIT_MODEL_KEEP_M/);
|
||||
assert.match(add, /return\s+(?:policy\.)?MODEL_ADD_M;/, 'Proximity and All share the add radius');
|
||||
assert.match(keep, /return\s+(?:policy\.)?MODEL_KEEP_M;/, 'Proximity and All share the keep radius');
|
||||
|
||||
// The AIR silhouettes are icons, not models: their band stays mode-aware.
|
||||
assert.equal(numericConstant(source, 'COCKPIT_AIR_PROX_ADD_M'), 150_000);
|
||||
assert.equal(numericConstant(source, 'COCKPIT_AIR_PROX_KEEP_M'), 185_000);
|
||||
assert.equal(numericConstant(source, 'COCKPIT_AIR_ALL_ADD_M'), 400_000);
|
||||
assert.equal(numericConstant(source, 'COCKPIT_AIR_ALL_KEEP_M'), 450_000);
|
||||
const near = /^([ \t]*)function _refreshCockpitNearContacts\b[\s\S]*?\n\1\}/m.exec(source)?.[0];
|
||||
assert.match(near, /all\s*\?\s*COCKPIT_AIR_ALL_ADD_M\s*:\s*COCKPIT_AIR_PROX_ADD_M/);
|
||||
assert.match(near, /all\s*\?\s*COCKPIT_AIR_ALL_KEEP_M\s*:\s*COCKPIT_AIR_PROX_KEEP_M/);
|
||||
|
||||
const cap = /^([ \t]*)function _modelCap\b[\s\S]*?\n\1\}/m.exec(source)?.[0];
|
||||
assert.match(cap, /Math\.min\(\s*(?:policy\.)?COCKPIT_MODEL_MAX/,
|
||||
|
||||
Reference in new issue
Block a user