Skip to content

ui/map/aircraft/Aircraft3DFleet

Classes

Aircraft3DFleet

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:44

Aircraft3DFleet - mesh CRUD and bookkeeping for the 3D aircraft layer, extracted from Aircraft3DCustomLayer.

Owns the live mesh registry and the queue of aircraft waiting for their model to load, creates/updates/removes meshes in the projection-correct group, and re-applies transforms across the whole fleet.

Constructors

Constructor
new Aircraft3DFleet(deps): Aircraft3DFleet;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:49

Parameters
deps

Aircraft3DFleetDeps

Returns

Aircraft3DFleet

Accessors

size
Get Signature
get size(): number;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:51

Returns

number

Methods

get()
get(id): Aircraft3DMesh | undefined;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:55

Parameters
id

string

Returns

Aircraft3DMesh | undefined

forEach()
forEach(cb): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:59

Parameters
cb

(entry, id) => void

Returns

void

create()
create(
   id, 
   data, 
   modelPath): void;

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

Create 3D mesh for a new aircraft using the specified model. If the model isn't cached yet, queues the aircraft and kicks off the load; the mesh is created when the model becomes available.

Parameters
id

string

data

AircraftMeshData

modelPath

string

Returns

void

update()
update(id, data): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:135

Update existing aircraft mesh

Parameters
id

string

data

AircraftMeshData

Returns

void

remove()
remove(id): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:169

Detach an aircraft mesh from its group. The mesh is a clone that shares the cached model's geometry/materials, so those GPU resources are NOT disposed here — the model loader owns and disposes them when its cache is cleared. Disposing per-clone would tear down resources still used by every other aircraft of the same type.

Parameters
id

string

Returns

void

advanceAnimations()
advanceAnimations(delta): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:187

Advance every playing animation mixer by delta seconds. Called once per rendered frame by the owning layer; a no-op for static models.

Parameters
delta

number

Returns

void

refreshPending()
refreshPending(id, data): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:207

Keep queued aircraft data fresh until their model loads

Parameters
id

string

data

AircraftMeshData

Returns

void

prunePending()
prunePending(activeIds): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:217

Drop queued aircraft that no longer exist in the simulation

Parameters
activeIds

Set\<string>

Returns

void

processPending()
processPending(path): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:229

Create meshes for aircraft that were queued waiting for path to load.

Parameters
path

string

Returns

void

reapplyAllTransforms()
reapplyAllTransforms(): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:249

Re-apply the projection-appropriate transform to every aircraft mesh.

Returns

void

applyGlobeTransforms()
applyGlobeTransforms(): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:263

Re-apply the origin-relative globe transform to every mesh (per frame).

Returns

void

enableMatrixAutoUpdate()
enableMatrixAutoUpdate(): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:273

Make sure all aircraft use relative positioning (matrixAutoUpdate) after the mercator camera projection has been applied.

Returns

void

switchGroups()
switchGroups(toGlobe): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:282

Switch all aircraft meshes between globe and mercator groups

Parameters
toGlobe

boolean

Returns

void

removeAllForReload()
removeAllForReload(): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:314

Remove and dispose every live mesh, keeping the pending queue (used when the user changes the fallback model: in-flight loads still complete and rebuild queued aircraft).

Returns

void

clear()
clear(): void;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:321

Full teardown: remove and dispose every mesh and forget the queue.

Returns

void

Interfaces

Aircraft3DMesh

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:14

Aircraft mesh bookkeeping entry

Properties

mesh
mesh: Object3D;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:15

data
data: AircraftMeshData;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:16

modelPath
modelPath: string;

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

lastUpdate
lastUpdate: number;

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

currentGroup
currentGroup: "mercator" | "globe";

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

mixer?
optional mixer?: AnimationMixer<AnimationMixerEventMap>;

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

Plays the GLB's baked animation clips; absent for static models.


Aircraft3DFleetDeps

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:28

Everything the fleet needs from the owning custom layer. Groups are fetched through getters because they only exist once the scene is ready.

Properties

modelLoader
modelLoader: Aircraft3DModelLoader;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:29

transforms
transforms: Aircraft3DTransforms;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:30

getMercatorGroup
getMercatorGroup: () => Group<Object3DEventMap> | null;

Defined in: ui/map/aircraft/Aircraft3DFleet.ts:31

Returns

Group\<Object3DEventMap> | null

getGlobeGroup
getGlobeGroup: () => Group<Object3DEventMap> | null;

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

Returns

Group\<Object3DEventMap> | null

isGlobeProjection
isGlobeProjection: () => boolean;

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

Returns

boolean