Package 

Class Scene


  • 
    public class Scene
    
                        

    A Scene is a flat container of RenderableManager and LightManager components.

    A Scene doesn'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 a Scene at any time. Moreover clients can use TransformManager to create a graph of transforms.

    A RenderableManager component must be added to a Scene in order to be rendered, and the Scene must be provided to a View.

    Creation and DestructionA Scene is created using createScene and destroyed using destroyScene.
    • Method Detail

      • setSkybox

         void setSkybox(@Nullable() Skybox skybox)

        Sets the Skybox.The Skybox is drawn last and covers all pixels not touched by geometry.

        Parameters:
        skybox - the Skybox to use to fill untouched pixels,or null to unset the Skybox.
      • addEntities

         void addEntities(Array<int> entities)

        Adds a list of entities to the Scene.

        Parameters:
        entities - array containing entities to add to the Scene.
      • removeEntity

         void removeEntity(int entity)

        Removes an Entity from the Scene.

        Parameters:
        entity - the Entity to remove from the Scene.
      • 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 the Scene.
      • getEntityCount

         int getEntityCount()

        Returns the total number of Entities in the Scene, whether alive or not.

      • hasEntity

         boolean hasEntity(int entity)

        Returns true if the given entity is in the Scene.

      • 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