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

A structure element of the scene. More...

#import <BNBEntity.h>

Inheritance diagram for BNBEntity:

Instance Methods

(void) - setName:
 Set a new name to the entity. More...
 
(nonnull NSString *) - getName
 
(void) - addChild:
 
(void) - removeChild:
 
(nonnull NSArray< BNBEntity * > *) - getChildren
 
(void) - clearChildren
 
(nullable BNBEntity *) - findChildByName:
 Perform depth-first traverse of entity tree. More...
 
(nullable BNBEntity *) - getParent
 
(void) - setActive:
 
(BOOL) - isActive
 
(void) - addIntoLayer:
 
(void) - removeFromLayer
 
(nullable BNBLayer *) - getLayer
 
(void) - addComponent:
 
(BOOL) - hasComponent:
 
(nullable BNBComponent *) - getComponent:
 
(void) - removeComponent:
 

Class Methods

(nullable BNBEntity *) + create:
 

Detailed Description

A structure element of the scene.

To construct a scene, you should form a hierarchy of entities to create its structure, then add different components such as lights, cameras, and geometry to entities to create visible content.

Each entity has a name which could be used for finding the entity in a hierarchy.

Entities in the scene form a tree hierarchy between parents and children.

Each entity could be in an enabled or disabled state. The disabling of the entity is equivalent to removing the entity and all its children from the hierarchy.

An entity is a container for components. Each entity could contain several components, but only one component of each component type. The Transform component is mandatory and it implicitly placed in each entity.

Definition at line 30 of file BNBEntity.h.

Method Documentation

◆ addChild:

- (void) addChild: (nullable BNBEntity *)  child

◆ addComponent:

- (void) addComponent: (nullable BNBComponent *)  component

◆ addIntoLayer:

- (void) addIntoLayer: (nullable BNBLayer *)  layer

◆ clearChildren

- (void) clearChildren

◆ create:

+ (nullable BNBEntity *) create: (nonnull NSString *)  name

◆ findChildByName:

- (nullable BNBEntity *) findChildByName: (nonnull NSString *)  entityName

Perform depth-first traverse of entity tree.

Return first found child with name entityName or NULL if such an entity doesn't exist.

◆ getChildren

- (nonnull NSArray<BNBEntity *> *) getChildren

◆ getComponent:

- (nullable BNBComponent *) getComponent: (BNBComponentType)  type

◆ getLayer

- (nullable BNBLayer *) getLayer

◆ getName

- (nonnull NSString *) getName

◆ getParent

- (nullable BNBEntity *) getParent

◆ hasComponent:

- (BOOL) hasComponent: (BNBComponentType)  type

◆ isActive

- (BOOL) isActive

◆ removeChild:

- (void) removeChild: (nullable BNBEntity *)  child

◆ removeComponent:

- (void) removeComponent: (nullable BNBComponent *)  component

◆ removeFromLayer

- (void) removeFromLayer

◆ setActive:

- (void) setActive: (BOOL)  active

◆ setName:

- (void) setName: (nonnull NSString *)  name

Set a new name to the entity.

Name could be empty.


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