Package com.banuba.sdk.scene
Interface Entity
- All Known Implementing Classes:
Entity.CppProxy
public interface Entity
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.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Entity.CppProxy
-
Method Summary
Modifier and Type Method Description void
addChild(Entity child)
void
addComponent(Component component)
void
addIntoLayer(Layer layer)
void
clearChildren()
static Entity
create(java.lang.String name)
Entity
findChildByName(java.lang.String entityName)
Perform depth-first traverse of entity tree.java.util.ArrayList<Entity>
getChildren()
Component
getComponent(ComponentType type)
Layer
getLayer()
java.lang.String
getName()
Entity
getParent()
boolean
hasComponent(ComponentType type)
boolean
isActive()
void
removeChild(Entity child)
void
removeComponent(Component component)
void
removeFromLayer()
void
setActive(boolean active)
void
setName(java.lang.String name)
Set a new name to the entity.
-
Method Details
-
setName
void setName(@NonNull java.lang.String name)Set a new name to the entity. Name could be empty. -
getName
@NonNull java.lang.String getName() -
addChild
-
removeChild
-
getChildren
-
clearChildren
void clearChildren() -
findChildByName
Perform depth-first traverse of entity tree. Return first found child with name `entityName` or NULL if such an entity doesn't exist. -
getParent
-
setActive
void setActive(boolean active) -
isActive
boolean isActive() -
addIntoLayer
-
removeFromLayer
void removeFromLayer() -
getLayer
-
addComponent
-
hasComponent
-
getComponent
-
removeComponent
-
create
-