@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / ModelComponent
Class: ModelComponent ​
Defined in: components/Model.ts:49
References a GLTF/GLB asset loaded from path. The model loading system resolves the asset asynchronously and populates ModelComponent.object once available; loading is deferred-tolerant so the entity exists before the model finishes loading. ModelComponent.loadState reports progress ("loading" → "loaded" or "error").
Extends ​
Constructors ​
Constructor ​
ts
new ModelComponent(path): ModelComponent;Defined in: components/Model.ts:64
Parameters ​
| Parameter | Type |
|---|---|
path | string |
Returns ​
ModelComponent
Overrides ​
Properties ​
| Property | Type | Description | Defined in |
|---|---|---|---|
path | string | Source URL or localasset:// path of the GLTF/GLB asset. | components/Model.ts:51 |
object | Object3D<Object3DEventMap> | null | Loaded model object, populated asynchronously by the model loader. null until loaded. | components/Model.ts:53 |
loadState | ModelLoadState | "loading" while the asset is being fetched and parsed, "loaded" once it is attached to the entity, "error" when it failed (see loadError). A model with an empty path reports "error". Runtime-only: never saved. | components/Model.ts:60 |
loadError? | string | Why the load failed, when loadState is "error". Runtime-only. | components/Model.ts:62 |

