Interface MeshInstance

All Known Implementing Classes:
MeshInstance.CppProxy

public interface MeshInstance
class which is the container for meshes and materials and provide interface for animation controlling. Subclass of component
  • Method Details

    • setVisible

      void setVisible(boolean visible)
      set mesh visibility flag. Will be overridden if entity with mesh_instance component is child of entity with face_tracker component.
      Parameters:
      visible - (bool) visibility flag.
    • isVisible

      boolean isVisible()
      Returns:
      visibility flag (bool)
    • setSubGeometryMaterial

      void setSubGeometryMaterial(@NonNull String subGeometryName, @Nullable Material material)
      set for mesh sub geometry with specified name specified material if sub geometry with given name exists.
      Parameters:
      subGeometryName - (string) sub geometry name.
      material - (material) sub geometry material.
    • getSubGeometryMaterial

      @Nullable Material getSubGeometryMaterial(@NonNull String subGeometryName)
      returns material from mesh sub geometry with specified name if it exist, null otherwise
      Parameters:
      subGeometryName - (string) sub geometry name.
      Returns:
      sub geometry material (material).
    • getMaterials

      @NonNull ArrayList<Material> getMaterials()
      get materials for each sub geometry
      Returns:
      materials (list)
    • setMesh

      void setMesh(@Nullable Mesh mesh)
      set mesh for given mesh instance. Of some mesh was settled before need to re set all materials.
      Parameters:
      mesh - (mesh) new mesh.
    • getMesh

      @Nullable Mesh getMesh()
      Returns:
      mesh (mesh).
    • animationChange

      void animationChange(@NonNull String animation, @NonNull AnimationMode mode)
      Change current animation if animation with specified name exist.
      Parameters:
      name - (string) new animation.
      mode - (animation_mode).
    • animationPlay

      void animationPlay()
      Start animation playback.
    • animationPause

      void animationPause()
      pause animation playback.
    • animationSeek

      void animationSeek(long positionNs)
      Set current animation playback position.
      Parameters:
      positionNs - (long): position in ns.
    • isAnimationPlaying

      boolean isAnimationPlaying()
      True if animation playback was started.
      Returns:
      animation playback active flag (bool).
    • isAnimationEnded

      boolean isAnimationEnded()
      True if animation playback stop.
      Returns:
      animation playback active flag (bool).
    • getAnimation

      @NonNull String getAnimation()
      Returns:
      current setted animation name (string).
    • getAnimationMode

      @NonNull AnimationMode getAnimationMode()
      Returns:
      current setted animation mode (animation_mode). Can be off loop once once_reversed fixed.
    • getAnimationPositionNs

      long getAnimationPositionNs()
      Returns:
      current animation playback position (long).
    • getAnimationDurationNs

      long getAnimationDurationNs()
      Returns:
      current animation playback duration (long).
    • getAnimationTimeOffsetNs

      long getAnimationTimeOffsetNs()
      Returns current animation playback time offset from begin(0). Typycally equals animation position mod animation duration.
      Returns:
      animation playback time offset (long).
    • setAnimationTimeOffsetNs

      void setAnimationTimeOffsetNs(long timeNs)
      Set current animation playback time offset from begin(0). duration.
      Parameters:
      timeNs - (long): animation playback time offset.
    • getPhysicsSimulator

      @Nullable PhysicsSimulator getPhysicsSimulator()
      Returns:
      physics_simulator of current mesh_instance
    • asComponent

      @Nullable Component asComponent()
      Returns:
      upcast to base type
    • create

      @Nullable static MeshInstance create()
      Fabric method for mesh_instance creating.
      Returns:
      mesh_instance component (mesh_instance)