Package com.banuba.sdk.scene
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MeshInstance.CppProxy
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
animationChange(java.lang.String animation, AnimationMode mode)
Change current animation if animation with specified name exist.void
animationPause()
pause animation playback.void
animationPlay()
Start animation playback.void
animationSeek(long positionNs)
Set current animation playback position.Component
asComponent()
static MeshInstance
create()
Fabric method for mesh_instance creating.java.lang.String
getAnimation()
long
getAnimationDurationNs()
AnimationMode
getAnimationMode()
long
getAnimationPositionNs()
long
getAnimationTimeOffsetNs()
Returns current animation playback time offset from begin(0).java.util.ArrayList<Material>
getMaterials()
get materials for each sub geometryMesh
getMesh()
PhysicsSimulator
getPhysicsSimulator()
Material
getSubGeometryMaterial(java.lang.String subGeometryName)
returns material from mesh sub geometry with specified name if it exist, null otherwiseboolean
isAnimationEnded()
True if animation playback stop.boolean
isAnimationPlaying()
True if animation playback was started.boolean
isVisible()
void
setAnimationTimeOffsetNs(long timeNs)
Set current animation playback time offset from begin(0).void
setMesh(Mesh mesh)
set mesh for given mesh instance.void
setSubGeometryMaterial(java.lang.String subGeometryName, Material material)
set for mesh sub geometry with specified name specified material if sub geometry with given name exists.void
setVisible(boolean visible)
set mesh visibility flag.
-
-
-
Method Detail
-
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 java.lang.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 java.lang.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 java.util.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 java.lang.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 java.lang.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)
-
-