Banuba SDK
BNBEntity.h
Go to the documentation of this file.
1 // AUTOGENERATED FILE - DO NOT MODIFY!
2 // This file generated by Djinni from scene.djinni
3 
4 #import "BNBComponentType.h"
5 #import <Foundation/Foundation.h>
6 @class BNBComponent;
7 @class BNBEntity;
8 @class BNBLayer;
9 
10 
11 /**
12  * A structure element of the scene.
13  *
14  * To construct a scene, you should form a hierarchy of entities to create its
15  * structure, then add different components such as lights, cameras, and
16  * geometry to entities to create visible content.
17  *
18  * Each entity has a name which could be used for finding the entity in a hierarchy.
19  *
20  * Entities in the scene form a tree hierarchy between parents and children.
21  *
22  * Each entity could be in an enabled or disabled state. The disabling of the entity
23  * is equivalent to removing the entity and all its children from the hierarchy.
24  *
25  * An entity is a container for components. Each entity could contain several components,
26  * but only one component of each component type. The Transform component is mandatory
27  * and it implicitly placed in each entity.
28  *
29  */
30 @interface BNBEntity : NSObject
31 
32 + (nullable BNBEntity *)create:(nonnull NSString *)name;
33 
34 /** Set a new name to the entity. Name could be empty. */
35 - (void)setName:(nonnull NSString *)name;
36 
37 - (nonnull NSString *)getName;
38 
39 - (void)addChild:(nullable BNBEntity *)child;
40 
41 - (void)removeChild:(nullable BNBEntity *)child;
42 
43 - (nonnull NSArray<BNBEntity *> *)getChildren;
44 
45 - (void)clearChildren;
46 
47 /**
48  * Perform depth-first traverse of entity tree.
49  * Return first found child with name `entityName` or NULL if such an entity doesn't exist.
50  */
51 - (nullable BNBEntity *)findChildByName:(nonnull NSString *)entityName;
52 
53 - (nullable BNBEntity *)getParent;
54 
55 - (void)setActive:(BOOL)active;
56 
57 - (BOOL)isActive;
58 
59 - (void)addIntoLayer:(nullable BNBLayer *)layer;
60 
61 - (void)removeFromLayer;
62 
63 - (nullable BNBLayer *)getLayer;
64 
65 - (void)addComponent:(nullable BNBComponent *)component;
66 
67 - (BOOL)hasComponent:(BNBComponentType)type;
68 
69 - (nullable BNBComponent *)getComponent:(BNBComponentType)type;
70 
71 - (void)removeComponent:(nullable BNBComponent *)component;
72 
73 @end
-[BNBEntity getName]
nonnull NSString * getName()
-[BNBEntity isActive]
BOOL isActive()
BNBComponent
Definition: BNBComponent.h:15
-[BNBEntity getChildren]
nonnull NSArray< BNBEntity * > * getChildren()
-[BNBEntity clearChildren]
void clearChildren()
-[BNBEntity getParent]
nullable BNBEntity * getParent()
-[BNBEntity removeFromLayer]
void removeFromLayer()
BNBLayer
Definition: BNBLayer.h:9
BNBEntity
A structure element of the scene.
Definition: BNBEntity.h:31
-[BNBEntity getLayer]
nullable BNBLayer * getLayer()
BNBComponentType.h