ui/map/aircraft/Aircraft3DModelLoader¶
Classes¶
Aircraft3DModelLoader¶
Defined in: ui/map/aircraft/Aircraft3DModelLoader.ts:15
Aircraft3DModelLoader - GLTF/GLB model loading and caching for the 3D aircraft layer, extracted from Aircraft3DRenderer.
Loads each model path at most once, normalizes materials/textures for quality at small scales, and records the raw bounding-box extent so per-aircraft scaling can convert GLB units to real-world meters. Animation clips baked into the GLB (e.g. spinning engines/rotors) are kept alongside the scene so each aircraft clone can play them.
Constructors¶
Constructor¶
Defined in: ui/map/aircraft/Aircraft3DModelLoader.ts:32
Parameters¶
opts¶
getMaxAnisotropy¶
() => number
Renderer texture-anisotropy limit, queried at normalize time.
onModelLoaded¶
(path) => void
Called after a model finishes loading and is cached.
onModelFailed?¶
(path) => void
Called when a model load fails, so queued aircraft can fall back.
Returns¶
Methods¶
get()¶
Defined in: ui/map/aircraft/Aircraft3DModelLoader.ts:42
Cached model for a path, when loaded.
Parameters¶
path¶
string
Returns¶
Group\<Object3DEventMap> | undefined
rawMaxDim()¶
Defined in: ui/map/aircraft/Aircraft3DModelLoader.ts:47
Raw bounding-box max extent recorded when the model loaded.
Parameters¶
path¶
string
Returns¶
number | undefined
animations()¶
Defined in: ui/map/aircraft/Aircraft3DModelLoader.ts:52
Animation clips baked into the GLB (empty for static models).
Parameters¶
path¶
string
Returns¶
AnimationClip[]
hasFailed()¶
Defined in: ui/map/aircraft/Aircraft3DModelLoader.ts:57
Whether a previous load of this path failed (and wasn't retried).
Parameters¶
path¶
string
Returns¶
boolean
load()¶
Defined in: ui/map/aircraft/Aircraft3DModelLoader.ts:66
Load a GLTF/GLB model by URL, caching it for future clones. Idempotent: returns immediately if the model is already loaded, currently loading, or known to fail.
Parameters¶
path¶
string
Returns¶
void
clearCache()¶
Defined in: ui/map/aircraft/Aircraft3DModelLoader.ts:118
Drop cached models so stale assets reload fresh, disposing each model's GPU resources. In-flight loads are kept; their completions re-populate the cache.
Returns¶
void
clearAll()¶
Defined in: ui/map/aircraft/Aircraft3DModelLoader.ts:130
Full teardown: dispose and drop the cache, forget in-flight loads (their completions are discarded in load()'s callback).
Returns¶
void