Skip to content

ui/map/aircraft/Aircraft3DTransforms

Classes

Aircraft3DTransforms

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:62

Aircraft3DTransforms - scene-origin management and mesh/camera transform math for the 3D aircraft layer, extracted from Aircraft3DCustomLayer.

Owns the moving scene origin (mercator mode positions meshes in meters relative to it), the globe origin rebasing that keeps mesh translations small enough for float32, and the per-frame camera projection updates for both projection modes.

Constructors

Constructor
new Aircraft3DTransforms(deps): Aircraft3DTransforms;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:73

Parameters
deps

Aircraft3DTransformsDeps

Returns

Aircraft3DTransforms

Methods

updateSceneOrigin()
updateSceneOrigin(aircraftData): boolean;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:80

Initialize or update scene origin based on aircraft positions. Returns true when the origin was repositioned, in which case the caller must re-apply mercator transforms to existing meshes.

Parameters
aircraftData

AircraftData

Returns

boolean

updateMeshTransform()
updateMeshTransform(mesh, data): void;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:247

Update mesh position, rotation, and scale using relative positioning Used when scene-based transform is active (mercator mode)

Parameters
mesh

Object3D

data

AircraftMeshData

Returns

void

updateMeshTransformForGlobe()
updateMeshTransformForGlobe(mesh, data): void;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:274

Update mesh for globe projection using individual projection-aware transforms

Parameters
mesh

Object3D

data

AircraftMeshData

Returns

void

applyGlobeCamera()
applyGlobeCamera(args): void;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:353

Per-frame camera projection for globe mode. Each aircraft mesh gets an origin-relative globe model transform, and the shared origin matrix is folded into the camera projection here. Both factors are combined on the CPU in double precision, so the GPU only ever sees small mesh translations — this is what keeps small aircraft from collapsing into stringy float32 artifacts.

Parameters
args

Render3DArgs

Returns

void

applyMercatorCamera()
applyMercatorCamera(args): boolean;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:377

Per-frame camera projection for mercator mode. Returns false when no scene origin exists yet (nothing to project against).

Parameters
args

Render3DArgs

Returns

boolean

Interfaces

AircraftMeshData

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:17

Simplified aircraft data for 3D rendering

Properties

lat
lat: number;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:18

lon
lon: number;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:19

alt
alt: number;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:20

hdg
hdg: number;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:21

selected
selected: boolean;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:22

inconf
inconf: boolean;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:23

actype
actype: string;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:24


Aircraft3DTransformsDeps

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:32

Everything the transform math needs from the owning custom layer. Map and camera are fetched through getters because they only exist once MapLibre has called the layer's onAdd.

Properties

getMap
getMap: () => Map$1 | null;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:33

Returns

Map$1 | null

getCamera
getCamera: () => Camera;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:34

Returns

Camera

getDisplayOptions
getDisplayOptions: () => DisplayOptions;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:35

Returns

DisplayOptions

createFallbackMatrix
createFallbackMatrix: (lng, lat, altitude, heading, pitch, roll, scale) => Matrix4;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:40

Mercator fallback matrix builder (CustomLayer3D.createTransformMatrix): (lng, lat, altitude, headingRad, pitchRad, rollRad, scale).

Parameters
lng

number

lat

number

altitude

number

heading

number

pitch

number

roll

number

scale

number

Returns

Matrix4

stateManager
stateManager: StateManager | null;

Defined in: ui/map/aircraft/Aircraft3DTransforms.ts:50

Source of per-aircraft scale overrides; null in tests.