FilamentAsset
FilamentAsset owns a loaded glTF 2.0 asset and all its Filament objects.
A FilamentAsset represents a complete glTF scene with a hierarchy of entities, each having a Transform component. Some entities also have Renderable, Light, Camera, or animation components.
Assets own strong references to VertexBuffer, IndexBuffer, Texture objects, and optionally an Animator for skeletal animations. External resource loading (textures, buffer data) is handled separately via ResourceLoader.
Note: Only the default glTF scene is loaded; other glTF scenes are ignored.
See also
Properties
Returns the number of instances created from this asset (>= 1 unless detached).
Returns every FilamentInstance created from this asset.
Gets the bounding box computed from the min/max values in the glTF accessors.
Gets the entities representing cameras. All of these have a Camera component.
Returns the Engine associated with the AssetLoader that created this asset.
Gets the number of entities returned by entities.
Convenience accessor for the first instance (assetInstances[0]).
Gets the entities representing lights. All of these have a Light component.
The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.
Gets the entities that have Renderable components.
Gets the URIs of all externally-referenced buffers/textures (to feed ResourceLoader).
Gets the number of glTF scenes in the asset.
Functions
Adds the entities that belong to one of the glTF scenes in sceneFilter (a bit mask of scene indices) to targetScene.
Releases ownership of the Filament components (renderables, lights, …) so they outlive AssetLoader.destroyAsset; the client destroys them.
Returns the first entity with the given name, or 0 if none exists.
Gets the number of morph targets declared on the given entity.
Gets the name of morph target targetIndex declared on the given entity.
Gets the name of glTF scene sceneIndex, or null if it has none.
Pops a ready renderable off the async-load queue, or returns 0 if none is ready.
Pops up to entities.size ready renderables off the async-load queue into entities.
Reclaims CPU-side memory for URI strings, binding lists, and raw animation data.