-
public class SceneA
Sceneis a flat container of RenderableManager and LightManager components.A
Scenedoesn't provide a hierarchy of objects, i.e.: it's not a scene-graph. However, it manages the list of objects to render and the list of lights. These can be added or removed from aSceneat any time. Moreover clients can use TransformManager to create a graph of transforms.A RenderableManager component must be added to a
Creation and DestructionAScenein order to be rendered, and theScenemust be provided to a View.Sceneis created using createScene and destroyed using destroyScene.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceScene.EntityProcessor
-
Method Summary
Modifier and Type Method Description SkyboxgetSkybox()voidsetSkybox(@Nullable() Skybox skybox)Sets the Skybox. IndirectLightgetIndirectLight()voidsetIndirectLight(@Nullable() IndirectLight ibl)Sets the IndirectLight to use when rendering the Scene.voidaddEntity(int entity)Adds an Entity to the Scene.voidaddEntities(Array<int> entities)Adds a list of entities to the Scene.voidremoveEntity(int entity)Removes an Entity from the Scene.voidremove(int entity)voidremoveEntities(Array<int> entities)Removes a list of entities from the Scene.This is equivalent to calling remove in a loop.If any of the specified entities do not exist in the scene, they are skipped.intgetEntityCount()Returns the total number of Entities in the Scene, whether alive or not.intgetRenderableCount()Returns the number of active (alive) RenderableManager components in the Scene.intgetLightCount()Returns the number of active (alive) LightManager components in the Scene.booleanhasEntity(int entity)Returns true if the given entity is in the Scene. longgetNativeObject()Array<int>getEntities(@Nullable() Array<int> outArray)Returns the list of all entities in the Scene. Array<int>getEntities()Returns the list of all entities in the Scene in a newly allocated array. voidforEach(@NonNull() Scene.EntityProcessor entityProcessor)Invokes user functor on each entity in the scene.It is not allowed to add or remove an entity from the scene within the functor. -
-
Method Detail
-
getIndirectLight
@Nullable() IndirectLight getIndirectLight()
-
setIndirectLight
void setIndirectLight(@Nullable() IndirectLight ibl)
Sets the IndirectLight to use when rendering the
Scene.Currently, aScenemay only have a single IndirectLight.This call replaces the current IndirectLight.- Parameters:
ibl- the IndirectLight to use when rendering theSceneornullto unset.
-
addEntity
void addEntity(int entity)
Adds an Entity to the
Scene.- Parameters:
entity- the entity is ignored if it doesn't have a RenderableManager componentor LightManager component.
-
addEntities
void addEntities(Array<int> entities)
Adds a list of entities to the
Scene.- Parameters:
entities- array containing entities to add to theScene.
-
removeEntity
void removeEntity(int entity)
Removes an Entity from the
Scene.- Parameters:
entity- the Entity to remove from theScene.
-
remove
@Deprecated() void remove(int entity)
-
removeEntities
void removeEntities(Array<int> entities)
Removes a list of entities from the
Scene.This is equivalent to calling remove in a loop.If any of the specified entities do not exist in the scene, they are skipped.- Parameters:
entities- array containing entities to remove from theScene.
-
getEntityCount
int getEntityCount()
Returns the total number of Entities in the
Scene, whether alive or not.
-
getRenderableCount
int getRenderableCount()
Returns the number of active (alive) RenderableManager components in the
Scene.
-
getLightCount
int getLightCount()
Returns the number of active (alive) LightManager components in the
Scene.
-
hasEntity
boolean hasEntity(int entity)
Returns true if the given entity is in the Scene.
-
getNativeObject
long getNativeObject()
-
getEntities
Array<int> getEntities(@Nullable() Array<int> outArray)
Returns the list of all entities in the Scene. If outArray is provided and large enough,it is used to store the list and returned, otherwise a new array is allocated and returned.
- Parameters:
outArray- an array to store the list of entities in the scene.
-
getEntities
Array<int> getEntities()
Returns the list of all entities in the Scene in a newly allocated array.
-
forEach
void forEach(@NonNull() Scene.EntityProcessor entityProcessor)
Invokes user functor on each entity in the scene.It is not allowed to add or remove an entity from the scene within the functor.
- Parameters:
entityProcessor- User provided functor called for each entity in the scene
-
-
-
-