Class SceneRenderer
java.lang.Object
gaiasky.scene.system.render.SceneRenderer
- All Implemented Interfaces:
IObserver, ISceneRenderer
Coordinates and manages all rendering operations in Gaia Sky.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat[]Alpha values for each type.long[]Contains the last update time of each of the flagsContains the flags representing each type's visibility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallOn(ComponentTypes comp) Checks if the component types are all on.floatalpha(ComponentTypes comp) Computes the alpha of this component types by multiplying the alphas of all componentsvoidvoiddispose()voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager) Actually initializes all the clockwork of this renderer using the assets in the given manager.com.badlogic.gdx.graphics.glutils.FrameBuffergetFrameBuffer(int w, int h) getRenderLists(boolean full) Returns he render lists of this renderer.Gets the current render process.Map<XrControllerDevice, com.badlogic.ashley.core.Entity> voidinitialize(com.badlogic.gdx.assets.AssetManager manager) Initializes the renderer, sending all the necessary assets to the manager for loading.booleanbooleanisOn(int ordinal) booleanChecks if a given component type is onbooleanisVR()voidEvent notification call.voidrender(ICamera camera, double t, int rw, int rh, int tw, int th, com.badlogic.gdx.graphics.glutils.FrameBuffer fb, IPostProcessor.PostProcessBean ppb) Main render function.voidrenderModel(IRenderable r, IntModelBatch batch) voidrenderScene(ICamera camera, double t, RenderingContext renderContext) Renders the scene given a camera, a session time in seconds and a render context.voidvoidresize(int tw, int th, int rw, int rh) Resizes the scene renderer and all its sub-renderers and assets, but not the render systems.voidresize(int tw, int th, int rw, int rh, boolean resizeRenderSys) Resizes the scene renderer and all its sub-renderers and assets.voidresizeRenderSystems(int tw, int th) Resizes the render systems of this renderer.voidsetRendering(boolean rendering) void
-
Field Details
-
visible
Contains the flags representing each type's visibility -
times
public long[] timesContains the last update time of each of the flags -
alphas
public float[] alphasAlpha values for each type.
-
-
Constructor Details
-
SceneRenderer
-
-
Method Details
-
initialize
public void initialize(com.badlogic.gdx.assets.AssetManager manager) Description copied from interface:ISceneRendererInitializes the renderer, sending all the necessary assets to the manager for loading.- Specified by:
initializein interfaceISceneRenderer- Parameters:
manager- The asset manager.
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager) Description copied from interface:ISceneRendererActually initializes all the clockwork of this renderer using the assets in the given manager.- Specified by:
doneLoadingin interfaceISceneRenderer- Parameters:
manager- The asset manager.
-
setRendering
public void setRendering(boolean rendering) -
getRenderLists
Description copied from interface:ISceneRendererReturns he render lists of this renderer.- Specified by:
getRenderListsin interfaceISceneRenderer- Parameters:
full- Whether to return the render lists for the full- or the half-resolution buffer.
-
getRenderListsFull
-
getRenderListsHalf
-
renderModel
-
clearScreen
public void clearScreen() -
render
public void render(ICamera camera, double t, int rw, int rh, int tw, int th, com.badlogic.gdx.graphics.glutils.FrameBuffer fb, IPostProcessor.PostProcessBean ppb) Main render function.- Parameters:
camera- The camera.t- The session time, in seconds.rw- The actual width of the frame buffer to render.rh- The actual height of the frame buffer to render.tw- The width of the target to render.th- The height of the target to render.fb- The frame buffer. Null to render to screen.ppb- The post process bean.
-
getRenderProcess
Description copied from interface:ISceneRendererGets the current render process.- Specified by:
getRenderProcessin interfaceISceneRenderer- Returns:
- The render mode.
-
getOrInitializeRenderSystem
-
renderScene
Renders the scene given a camera, a session time in seconds and a render context. Needs to manage full- and half-resolution render lists and buffers.- Specified by:
renderScenein interfaceISceneRenderer- Parameters:
camera- The camera to use.t- The time in seconds since the start.renderContext- The render context.
-
resetRenderLists
public void resetRenderLists() -
isOn
Checks if a given component type is on- Specified by:
isOnin interfaceISceneRenderer- Parameters:
comp- The component- Returns:
- Whether the component is on
-
allOn
Checks if the component types are all on.- Specified by:
allOnin interfaceISceneRenderer- Parameters:
comp- The components.- Returns:
- Whether the components are all on.
-
alpha
Computes the alpha of this component types by multiplying the alphas of all components- Parameters:
comp- The components- Returns:
- The alpha value
-
isOn
public boolean isOn(int ordinal) -
isVR
public boolean isVR() -
notify
-
resize
public void resize(int tw, int th, int rw, int rh) Resizes the scene renderer and all its sub-renderers and assets, but not the render systems.- Parameters:
tw- New target (screen) width.th- New target (screen) height.rw- New render buffer width.rh- New render buffer height.
-
resize
public void resize(int tw, int th, int rw, int rh, boolean resizeRenderSys) Resizes the scene renderer and all its sub-renderers and assets.- Parameters:
tw- New target (screen) width.th- New target (screen) height.rw- New render buffer width.rh- New render buffer height.resizeRenderSys- Also resize all render systems.
-
resizeRenderSystems
public void resizeRenderSystems(int tw, int th) Resizes the render systems of this renderer.- Parameters:
tw- New target (screen) width.th- New target (screen) height.
-
dispose
public void dispose() -
updateLineRenderSystems
public void updateLineRenderSystems() -
getRenderAssets
-
getRenderModeOpenXR
-
getVrContext
-
getFrameBuffer
public com.badlogic.gdx.graphics.glutils.FrameBuffer getFrameBuffer(int w, int h) -
getModelRenderSystem
-
getXRControllerToModel
-
isCubemapRenderMode
public boolean isCubemapRenderMode()
-