Skip to main content

Interface: FilamentAsset

Extends

Properties

entityCount

readonly entityCount: number

Gets the number of entities returned by entities.

Inherited from

FilamentInstanceBase.entityCount

Defined in

src/types/FilamentInstanceBase.ts:35


getEntities()

getEntities: () => Entity[]

Gets the list of entities, one for each glTF node. All of these have a Transform component. Some of the returned entities may also have a Renderable component and/or a Light component.

Returns

Entity[]

Inherited from

FilamentInstanceBase.getEntities

Defined in

src/types/FilamentInstanceBase.ts:22


getRenderableEntities()

getRenderableEntities: () => Entity[]

Gets the list of entities in the asset that have renderable components.

Returns

Entity[]

Defined in

src/types/FilamentAsset.ts:10


isValid

readonly isValid: boolean

Get if the refernce to the native pointer is still valid and strong.

If this is false, this object has been manually released with release() and all other methods on this object will throw an Error.

Inherited from

PointerHolder.isValid

Defined in

src/types/PointerHolder.ts:37


renderableEntityCount

readonly renderableEntityCount: number

Gets the number of entities returned by renderableEntities.

Defined in

src/types/FilamentAsset.ts:15

Methods

createAnimator()

createAnimator(nameComponentManager): FilamentAnimator

Parameters

nameComponentManager: NameComponentManager

Returns

FilamentAnimator

Inherited from

FilamentInstanceBase.createAnimator

Defined in

src/types/FilamentInstanceBase.ts:16


getAssetInstances()

getAssetInstances(): FilamentInstance[]

Gets all instances associated with the asset. List will only be greater than 1 if the asset was loaded with loadInstancedAsset.

Returns

FilamentInstance[]

Defined in

src/types/FilamentAsset.ts:33


getBoundingBox()

getBoundingBox(): AABB

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

This does not return a bounding box over all FilamentInstance, it's just a straightforward AAAB that can be determined at load time from the asset data.

Returns

AABB

Inherited from

FilamentInstanceBase.getBoundingBox

Defined in

src/types/FilamentInstanceBase.ts:30


getFirstEntityByName()

getFirstEntityByName(name): undefined | Entity

Parameters

name: string

Returns

undefined | Entity

Defined in

src/types/FilamentAsset.ts:17


getInstance()

getInstance(): FilamentInstance

Convenience method to get the first instance.

Returns

FilamentInstance

Defined in

src/types/FilamentAsset.ts:27


getRoot()

getRoot(): Entity

Gets the transform root for the asset, which has no matching glTF node.

This node exists for convenience, allowing users to transform the entire asset. For instanced assets, this is a "super root" where each of its children is a root in a particular instance. This allows users to transform all instances en masse if they wish to do so.

Returns

Entity

Inherited from

FilamentInstanceBase.getRoot

Defined in

src/types/FilamentInstanceBase.ts:14


release()

release(): void

Manually release this reference to the native pointer. This will ensure that JS will no longer hold a strong reference, and memory can be safely cleaned up.

If the native pointer is still referenced elsewhere in native code, the underlying memory will not be deleted unless the other references are also released.

If this is not called, the memory will only be cleaned once the JS gabage collector decides to delete this object, which might be at any point in the future.

Calling release() is not required as the GC will destroy this object eventually anyways, but it is recommended to optimize memory usage.

After manually releasing a pointer, all future methods on this object will throw an Error.

Returns

void

Inherited from

PointerHolder.release

Defined in

src/types/PointerHolder.ts:30


releaseSourceData()

releaseSourceData(): void

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

Returns

void

Defined in

src/types/FilamentAsset.ts:22