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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
animationChange
(String animation, AnimationMode mode) Change current animation if animation with specified name exist.void
pause animation playback.void
Start animation playback.void
animationSeek
(long positionNs) Set current animation playback position.static MeshInstance
create()
Fabric method for mesh_instance creating.long
long
long
Returns current animation playback time offset from begin(0).get materials for each sub geometrygetMesh()
getSubGeometryMaterial
(String subGeometryName) returns material from mesh sub geometry with specified name if it exist, null otherwiseboolean
True if animation playback stop.boolean
True if animation playback was started.boolean
void
setAnimationTimeOffsetNs
(long timeNs) Set current animation playback time offset from begin(0).void
set mesh for given mesh instance.void
setSubGeometryMaterial
(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 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
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
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
get materials for each sub geometry- Returns:
- materials (list
)
-
setMesh
set mesh for given mesh instance. Of some mesh was settled before need to re set all materials.- Parameters:
mesh
- (mesh) new mesh.
-
getMesh
- Returns:
- mesh (mesh).
-
animationChange
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
- Returns:
- current setted animation name (string).
-
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
- Returns:
- physics_simulator of current mesh_instance
-
asComponent
- Returns:
- upcast to base type
-
create
Fabric method for mesh_instance creating.- Returns:
- mesh_instance component (mesh_instance)
-