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:
Sameh Khamis committed 2026-11-17 11:21:08 -08:00
1 parent 624c229bc2
commit 36624cd329
22 files changed
+260 -181

No files matched your search

+8 -2
View File
@@ -28,6 +28,10 @@ import {
} from '../../data/trackingClickGesture.js';
import { inputFor } from '../../input/dispatcher.js';
import {
COCKPIT_AIR_ALL_ADD_M,
COCKPIT_AIR_ALL_KEEP_M,
COCKPIT_AIR_PROX_ADD_M,
COCKPIT_AIR_PROX_KEEP_M,
TRAIL_MAX_POINTS,
TRAIL_COLOR,
CYAN_TRANSPARENT,
@@ -222,11 +226,13 @@ export function createTracking({
);
distancesSquared.push([icao24, distanceSquared(eye, position)]);
}
// The AIR band follows the 3D mode, not the 3D model radius.
const all = flightState._models3dMode === 'all';
const next = nextCockpitNearContacts(
previous,
distancesSquared,
parts.rendering._modelAddDistM(),
parts.rendering._modelKeepDistM(),
all ? COCKPIT_AIR_ALL_ADD_M : COCKPIT_AIR_PROX_ADD_M,
all ? COCKPIT_AIR_ALL_KEEP_M : COCKPIT_AIR_PROX_KEEP_M,
);
flightState._cockpitNearContacts = next;
for (const icao24 of previous)