Class FilamentInstance


  • public class FilamentInstance
    extends java.lang.Object
    Provides 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
      void attachSkin​(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.
      void detachSkin​(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.
      Animator getAnimator()
      Retrieves the Animator for this instance.
      FilamentAsset getAsset()  
      int[] getEntities()
      Gets the list of entities for this instance, one for each glTF node.
      int getJointCountAt​(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.
      int getRoot()
      Gets the transform root for the asset, which has no matching glTF node.
      int getSkinCount()
      Gets the skin count of this instance.
      java.lang.String[] getSkinNames()
      Gets the skin name at skin index in this instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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 the Animator for 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.