feat(selection): selecting a contact keeps its size and the camera's view: aircraft, vessels, trains and transit vehicles keep their form and size when selected (colour only); a click follows from the camera's own distance and angle, the contact gliding to the centre over one second (FollowTarget transitionS, shared rule render/camera/followTransition, conformance camera.follow.transition)

This commit is contained in:
Sameh Khamis committed 2026-11-13 15:02:28 -08:00
1 parent e3865f462f
commit 7a61bf04a0
52 files changed
+1648 -891

No files matched your search

+4 -16
View File
@@ -41,8 +41,7 @@ import {
} from '../../data/modelVisualAnchor.js';
import {
FOCUS_EVIDENCE_DEV,
TRACKED_MODEL_MAX_PX,
TRACKED_MODEL_MIN_PX,
MODEL_MIN_PX,
TRACKED_BILLBOARD_SCALE_BY_DISTANCE,
DR_CORRECTION_MS,
COURSE_SLEW_DT_MAX_SEC,
@@ -113,7 +112,6 @@ export function createMotion({
corridorFloorCells,
allocateCorridorCells,
} = services.groundFloor;
const { trackedModelScaleForPixelCap } = services.camera;
const {
nearFarScalarValueAtDistance,
clearFocusTarget,
@@ -375,21 +373,11 @@ export function createMotion({
const spec = parts.rendering._modelSpec(
flightState.records.data.get(icao24),
);
const scale = trackedModelScaleForPixelCap({
baseScale: spec.scale,
nativeRadiusM: spec.nativeRadiusM,
rangeM,
viewportHeightPx,
fovyRad: pose.fovy,
maximumPixelSize: TRACKED_MODEL_MAX_PX,
});
// Drawn as the fleet draws it: its own size, never under MODEL_MIN_PX.
const focalLengthPx = viewportHeightPx / (2 * Math.tan(pose.fovy / 2));
const projectedDiameterPx =
(2 * spec.nativeRadiusM * scale * focalLengthPx) / rangeM;
return Math.max(
TRACKED_MODEL_MIN_PX,
Math.min(TRACKED_MODEL_MAX_PX, projectedDiameterPx),
);
(2 * spec.nativeRadiusM * spec.scale * focalLengthPx) / rangeM;
return Math.max(MODEL_MIN_PX, projectedDiameterPx);
}
const sprite = readEntityRecord(flightState._trackedEntity)?.sprite;