Package com.google.android.filament
Class Scene
- java.lang.Object
-
- com.google.android.filament.Scene
-
public class Scene extends java.lang.ObjectASceneis a flat container ofRenderableManagerandLightManagercomponents.
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 useTransformManagerto create a graph of transforms.
A
RenderableManagercomponent must be added to aScenein order to be rendered, and theScenemust be provided to aView.Creation and Destruction
ASceneis created usingEngine.createScene()and destroyed usingEngine.destroyScene(Scene).- See Also:
View,LightManager,RenderableManager,TransformManager
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddEntities(int[] entities)Adds a list of entities to theScene.voidaddEntity(int entity)Adds anEntityto theScene.IndirectLightgetIndirectLight()intgetLightCount()Returns the number ofLightManagercomponents in theScene.longgetNativeObject()intgetRenderableCount()Returns the number ofRenderableManagercomponents in theScene.SkyboxgetSkybox()voidremove(int entity)Deprecated.voidremoveEntities(int[] entities)Removes a list of entities from theScene.voidremoveEntity(int entity)Removes anEntityfrom theScene.voidsetIndirectLight(IndirectLight ibl)Sets theIndirectLightto use when rendering theScene.voidsetSkybox(Skybox skybox)Sets theSkybox.
-
-
-
Method Detail
-
getSkybox
@Nullable public Skybox getSkybox()
- Returns:
- the
Skyboxornullif none is set - See Also:
setSkybox(Skybox)
-
setSkybox
public void setSkybox(@Nullable Skybox skybox)
-
getIndirectLight
@Nullable public IndirectLight getIndirectLight()
- Returns:
- the
IndirectLightornullif none is set - See Also:
setIndirectLight(IndirectLight)
-
setIndirectLight
public void setIndirectLight(@Nullable IndirectLight ibl)Sets theIndirectLightto use when rendering theScene. Currently, aScenemay only have a singleIndirectLight. This call replaces the currentIndirectLight.- Parameters:
ibl- theIndirectLightto use when rendering theSceneornullto unset.
-
addEntity
public void addEntity(int entity)
Adds anEntityto theScene.- Parameters:
entity- the entity is ignored if it doesn't have aRenderableManagercomponent orLightManagercomponent.
A givenEntityobject can only be added once to aScene.
-
addEntities
public void addEntities(int[] entities)
Adds a list of entities to theScene.- Parameters:
entities- array containing entities to add to theScene.
-
removeEntity
public void removeEntity(int entity)
Removes anEntityfrom theScene.- Parameters:
entity- theEntityto remove from theScene. If the specifiedentitydoesn't exist, this call is ignored.
-
remove
@Deprecated public void remove(int entity)
Deprecated.
-
removeEntities
public void removeEntities(int[] entities)
Removes a list of entities from theScene. 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.
-
getRenderableCount
public int getRenderableCount()
Returns the number ofRenderableManagercomponents in theScene.- Returns:
- number of
RenderableManagercomponents in theScene..
-
getLightCount
public int getLightCount()
Returns the number ofLightManagercomponents in theScene.- Returns:
- number of
LightManagercomponents in theScene..
-
getNativeObject
public long getNativeObject()
-
-