Class FilamentInstance
- java.lang.Object
-
- com.google.android.filament.gltfio.FilamentInstance
-
public class FilamentInstance extends java.lang.ObjectProvides access to a hierarchy of entities that have been instanced from a glTF asset.- See Also:
FilamentAsset,Animator,AssetLoader
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachSkin(int skinIndex, int target)Attaches the given skin to the given node, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes.voiddetachSkin(int skinIndex, int target)Attaches the given skin to the given node, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes.AnimatorgetAnimator()Retrieves theAnimatorfor this instance.FilamentAssetgetAsset()int[]getEntities()Gets the list of entities for this instance, one for each glTF node.intgetJointCountAt(int skinIndex)Gets the joint count at skin index in this instance.int[]getJointsAt(int skinIndex)Gets joints at skin index in this instance.com.google.android.filament.MaterialInstance[]getMaterialInstances()java.lang.String[]getMaterialVariantNames()Returns the names of all material variants.intgetRoot()Gets the transform root for the asset, which has no matching glTF node.intgetSkinCount()Gets the skin count of this instance.java.lang.String[]getSkinNames()Gets the skin name at skin index in this instance.
-
-
-
Method Detail
-
getAsset
@NonNull public FilamentAsset getAsset()
-
getRoot
public int getRoot()
Gets the transform root for the asset, which has no matching glTF node.
-
getEntities
@NonNull public int[] getEntities()
Gets the list of entities for this instance, one for each glTF node.All of these have a transform component. Some of the returned entities may also have a renderable component.
-
getAnimator
@NonNull public Animator getAnimator()
Retrieves theAnimatorfor this instance.
-
getSkinCount
public int getSkinCount()
Gets the skin count of this instance.
-
getSkinNames
@NonNull public java.lang.String[] getSkinNames()
Gets the skin name at skin index in this instance.
-
attachSkin
public void attachSkin(@IntRange(from=0L) int skinIndex, int target)Attaches the given skin to the given node, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes. This is a no-op if the given skin index or target is invalid.
-
detachSkin
public void detachSkin(@IntRange(from=0L) int skinIndex, int target)Attaches the given skin to the given node, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes. This is a no-op if the given skin index or target is invalid.
-
getJointCountAt
public int getJointCountAt(@IntRange(from=0L) int skinIndex)Gets the joint count at skin index in this instance.
-
getJointsAt
@NonNull public int[] getJointsAt(@IntRange(from=0L) int skinIndex)Gets joints at skin index in this instance.
-
getMaterialInstances
@NonNull public com.google.android.filament.MaterialInstance[] getMaterialInstances()
-
getMaterialVariantNames
@NonNull public java.lang.String[] getMaterialVariantNames()
Returns the names of all material variants.
-
-