FilamentAsset

class FilamentAsset(nativeHandle: NativePointer)

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

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Properties

Link copied to clipboard

Returns the number of instances created from this asset (>= 1 unless detached).

Link copied to clipboard

Returns every FilamentInstance created from this asset.

Link copied to clipboard

Gets the bounding box computed from the min/max values in the glTF accessors.

Link copied to clipboard

Gets the entities representing cameras. All of these have a Camera component.

Link copied to clipboard
Link copied to clipboard

Returns the Engine associated with the AssetLoader that created this asset.

Link copied to clipboard

Gets the list of entities, one per glTF node. All have a Transform component; some also have a Renderable and/or Light component.

Link copied to clipboard

Gets the number of entities returned by entities.

Link copied to clipboard

Convenience accessor for the first instance (assetInstances[0]).

Link copied to clipboard

Gets the entities representing lights. All of these have a Light component.

Link copied to clipboard
Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Link copied to clipboard

Gets the entities that have Renderable components.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Gets the URIs of all externally-referenced buffers/textures (to feed ResourceLoader).

Link copied to clipboard

Gets the transform root of the asset, an extra entity with no matching glTF node.

Link copied to clipboard

Gets the number of glTF scenes in the asset.

Link copied to clipboard

Lazily creates a single LINES renderable that draws the transformed bounding-box hierarchy.

Functions

Link copied to clipboard
fun addEntitiesToScene(targetScene: Scene, entities: IntArray, sceneFilter: Int)

Adds the entities that belong to one of the glTF scenes in sceneFilter (a bit mask of scene indices) to targetScene.

Link copied to clipboard

Releases ownership of the Filament components (renderables, lights, …) so they outlive AssetLoader.destroyAsset; the client destroys them.

Link copied to clipboard
fun getEntitiesByName(name: String, entities: IntArray): Int

Gets up to entities.size entities whose name label matches name exactly into entities.

Link copied to clipboard
fun getEntitiesByPrefix(prefix: String, entities: IntArray): Int

Gets up to entities.size entities whose name label starts with prefix into entities.

Link copied to clipboard
fun getExtras(entity: Entity): String?

Gets the glTF extras string for the given node entity (or for the asset itself), if any.

Link copied to clipboard

Returns the first entity with the given name, or 0 if none exists.

Link copied to clipboard

Gets the number of morph targets declared on the given entity.

Link copied to clipboard
fun getMorphTargetNameAt(entity: Entity, targetIndex: Int): String?

Gets the name of morph target targetIndex declared on the given entity.

Link copied to clipboard
fun getName(entity: Entity): String?

Gets the name label for the given entity, or null if it has none.

Link copied to clipboard
fun getSceneName(sceneIndex: Int): String?

Gets the name of glTF scene sceneIndex, or null if it has none.

Link copied to clipboard

Pops a ready renderable off the async-load queue, or returns 0 if none is ready.

Link copied to clipboard
fun popRenderables(entities: IntArray): Int

Pops up to entities.size ready renderables off the async-load queue into entities.

Link copied to clipboard

Reclaims CPU-side memory for URI strings, binding lists, and raw animation data.