Banuba SDK
Instance Methods | Class Methods | List of all members
BNBMeshInstance Class Reference

#import <BNBMeshInstance.h>

Inheritance diagram for BNBMeshInstance:

Instance Methods

(void) - setVisible:
 set mesh visibility flag. More...
 
(BOOL) - isVisible
 
(void) - setSubGeometryMaterial:material:
 set for mesh sub geometry with specified name specified material if sub geometry with given name exists. More...
 
(nullable BNBMaterial *) - getSubGeometryMaterial:
 returns material from mesh sub geometry with specified name if it exist, null otherwise More...
 
(nonnull NSArray< BNBMaterial * > *) - getMaterials
 get materials for each sub geometry More...
 
(void) - setMesh:
 set mesh for given mesh instance. More...
 
(nullable BNBMesh *) - getMesh
 
(void) - animationChange:mode:
 Change current animation if animation with specified name exist. More...
 
(void) - animationPlay
 Start animation playback. More...
 
(void) - animationPause
 pause animation playback. More...
 
(void) - animationSeek:
 Set current animation playback position. More...
 
(BOOL) - isAnimationPlaying
 True if animation playback was started. More...
 
(BOOL) - isAnimationEnded
 True if animation playback stop. More...
 
(nonnull NSString *) - getAnimation
 
(BNBAnimationMode) - getAnimationMode
 
(int64_t) - getAnimationPositionNs
 
(int64_t) - getAnimationDurationNs
 
(int64_t) - getAnimationTimeOffsetNs
 Returns current animation playback time offset from begin(0). More...
 
(void) - setAnimationTimeOffsetNs:
 Set current animation playback time offset from begin(0). More...
 
(nullable BNBPhysicsSimulator *) - getPhysicsSimulator
 
(nullable BNBComponent *) - asComponent
 

Class Methods

(nullable BNBMeshInstance *) + create
 Fabric method for mesh_instance creating. More...
 

Detailed Description

Definition at line 20 of file BNBMeshInstance.h.

Method Documentation

◆ animationChange:mode:

- (void) animationChange: (nonnull NSString *)  animation
mode: (BNBAnimationMode)  mode 

Change current animation if animation with specified name exist.

Parameters
name(string) new animation.
mode(animation_mode).

◆ animationPause

- (void) animationPause

pause animation playback.

◆ animationPlay

- (void) animationPlay

Start animation playback.

◆ animationSeek:

- (void) animationSeek: (int64_t)  positionNs

Set current animation playback position.

Parameters
positionNs(long): position in ns.

◆ asComponent

- (nullable BNBComponent *) asComponent
Returns
upcast to base type

◆ create

+ (nullable BNBMeshInstance *) create

Fabric method for mesh_instance creating.

Returns
mesh_instance component (mesh_instance)

◆ getAnimation

- (nonnull NSString *) getAnimation
Returns
current setted animation name (string).

◆ getAnimationDurationNs

- (int64_t) getAnimationDurationNs
Returns
current animation playback duration (long).

◆ getAnimationMode

- (BNBAnimationMode) getAnimationMode
Returns
current setted animation mode (animation_mode). Can be off loop once once_reversed fixed.

◆ getAnimationPositionNs

- (int64_t) getAnimationPositionNs
Returns
current animation playback position (long).

◆ getAnimationTimeOffsetNs

- (int64_t) getAnimationTimeOffsetNs

Returns current animation playback time offset from begin(0).

Typycally equals animation position mod animation duration.

Returns
animation playback time offset (long).

◆ getMaterials

- (nonnull NSArray<BNBMaterial *> *) getMaterials

get materials for each sub geometry

Returns
materials (list<material>)

◆ getMesh

- (nullable BNBMesh *) getMesh
Returns
mesh (mesh).

◆ getPhysicsSimulator

- (nullable BNBPhysicsSimulator *) getPhysicsSimulator
Returns
physics_simulator of current mesh_instance

◆ getSubGeometryMaterial:

- (nullable BNBMaterial *) getSubGeometryMaterial: (nonnull NSString *)  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).

◆ isAnimationEnded

- (BOOL) isAnimationEnded

True if animation playback stop.

Returns
animation playback active flag (bool).

◆ isAnimationPlaying

- (BOOL) isAnimationPlaying

True if animation playback was started.

Returns
animation playback active flag (bool).

◆ isVisible

- (BOOL) isVisible
Returns
visibility flag (bool)

◆ setAnimationTimeOffsetNs:

- (void) setAnimationTimeOffsetNs: (int64_t)  timeNs

Set current animation playback time offset from begin(0).

duration.

Parameters
timeNs(long): animation playback time offset.

◆ setMesh:

- (void) setMesh: (nullable BNBMesh *)  mesh

set mesh for given mesh instance.

Of some mesh was settled before need to re set all materials.

Parameters
mesh(mesh) new mesh.

◆ setSubGeometryMaterial:material:

- (void) setSubGeometryMaterial: (nonnull NSString *)  subGeometryName
material: (nullable BNBMaterial *)  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.

◆ setVisible:

- (void) setVisible: (BOOL)  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.

The documentation for this class was generated from the following file: