FilamentInstance
FilamentInstance provides access to a hierarchy of entities instanced from a glTF asset.
Every entity has a TransformManager component. Some entities also have Name or Renderable components. Instances share material and geometry data with the parent FilamentAsset but maintain independent entity hierarchies, transforms, and animation states.
Key features:
Independent entity tree for each instance
Skeletal animation via getAnimator() (independent per-instance or shared from asset)
Material variant switching via applyMaterialVariant()
Skin/skeleton access for joint manipulation
Independent bounding box and transform root
Animation ownership: Each instance has its own Animator, but it can also be obtained from the parent FilamentAsset. Using the asset's animator means all instances share the same animation frame; using instance animators allows independent control.
See also
Properties
Gets the FilamentAsset that owns this instance.
Gets the axis-aligned bounding box from the min/max values in the glTF accessors, transformed for this instance.
Gets the number of entities returned by entities.
Gets all material instances of this instance. These are already bound to renderables.
Gets the number of material variants declared in the asset.
The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.
Functions
Applies the material variant at variantIndex to all primitives in this instance. Ignored if the index is out of bounds.
Attaches the given skin to the given node entity, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes. No-op if the skin index or target is invalid.
Releases ownership of the material instances so they outlive the asset; the client destroys them.
Detaches the given skin from the given node entity. No-op if skin index or target is invalid.
Gets the inverse bind matrices of the skin at skinIndex: 16 column-major floats per joint.
Gets the number of joints in the skin at skinIndex.
Gets the joint entities of the skin at skinIndex.
Gets the name of the material variant at variantIndex.
Gets the name of the skin at skinIndex, or null if it has none.
Recomputes boundingBox from the current joint and morph state, for skinned or morphed meshes.