Class SceneGraphRenderer

java.lang.Object
gaiasky.render.AbstractRenderer
gaiasky.render.SceneGraphRenderer
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IObserver, IProcessRenderer

public class SceneGraphRenderer
extends AbstractRenderer
implements IProcessRenderer, IObserver
Renders the scene graph.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  SceneGraphRenderer.RenderGroup
    Describes to which render group this node belongs at a particular time step.
  • Field Summary

    Fields
    Modifier and Type Field Description
    static float[] alphas
    Alpha values for each type
    static SceneGraphRenderer instance  
    com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<IRenderable>> renderLists
    Render lists for all render groups
    com.badlogic.gdx.graphics.glutils.FrameBuffer[] shadowMapFb  
    java.util.Map<ModelBody,​com.badlogic.gdx.math.Matrix4> smCombinedMap  
    java.util.Map<ModelBody,​com.badlogic.gdx.graphics.Texture> smTexMap  
    static long[] times
    Contains the last update time of each of the flags
    static ComponentTypes visible
    Contains the flags representing each type's visibility

    Fields inherited from class gaiasky.render.AbstractRenderer

    sg
  • Constructor Summary

    Constructors
    Constructor Description
    SceneGraphRenderer​(VRContext vrContext)  
  • Method Summary

    Modifier and Type Method Description
    void clearLists()
    This must be called when all the rendering for the current frame has finished.
    void dispose()  
    void doneLoading​(com.badlogic.gdx.assets.AssetManager manager)
    Actually initializes all the clockwork of this renderer using the assets in the given manager
    ISGR getCurrentSGR()  
    com.badlogic.gdx.graphics.glutils.FrameBuffer getGlowFb()  
    static void initialise​(com.badlogic.gdx.assets.AssetManager manager, VRContext vrContext)  
    void initialize​(com.badlogic.gdx.assets.AssetManager manager)
    Initializes the renderer, sending all the necessary assets to the manager for loading
    boolean isOn​(int ordinal)  
    boolean isOn​(ComponentTypes comp)
    Checks if the component types are all on
    boolean isOn​(ComponentTypes.ComponentType comp)
    Checks if a given component type is on
    void notify​(Events event, java.lang.Object... data)  
    void render​(ICamera camera, double t, int rw, int rh, int tw, int th, com.badlogic.gdx.graphics.glutils.FrameBuffer fb, IPostProcessor.PostProcessBean ppb)
    Renders the scene.
    void renderGlowPass​(ICamera camera, com.badlogic.gdx.graphics.glutils.FrameBuffer fb, int eye)  
    static com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<IRenderable>> renderLists()  
    void renderScene​(ICamera camera, double t, RenderingContext rc)
    Renders the scene
    void renderSystem​(ICamera camera, double t, RenderingContext rc, java.lang.Class<? extends IRenderSystem> clazz)
    Renders all the systems which are the same type of the given class
    void resize​(int w, int h, int rw, int rh)  
    void resize​(int w, int h, int rw, int rh, boolean resizeRenderSys)  
    void resizeRenderSystems​(int w, int h, int rw, int rh)  
    void updateLineRenderSystem()  

    Methods inherited from class gaiasky.render.AbstractRenderer

    initialize

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • instance

      public static SceneGraphRenderer instance
    • visible

      public static ComponentTypes visible
      Contains the flags representing each type's visibility
    • times

      public static long[] times
      Contains the last update time of each of the flags
    • alphas

      public static float[] alphas
      Alpha values for each type
    • renderLists

      public com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<IRenderable>> renderLists
      Render lists for all render groups
    • shadowMapFb

      public com.badlogic.gdx.graphics.glutils.FrameBuffer[] shadowMapFb
    • smTexMap

      public java.util.Map<ModelBody,​com.badlogic.gdx.graphics.Texture> smTexMap
    • smCombinedMap

      public java.util.Map<ModelBody,​com.badlogic.gdx.math.Matrix4> smCombinedMap
  • Constructor Details

    • SceneGraphRenderer

      public SceneGraphRenderer​(VRContext vrContext)
  • Method Details

    • initialise

      public static void initialise​(com.badlogic.gdx.assets.AssetManager manager, VRContext vrContext)
    • renderLists

      public static com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<IRenderable>> renderLists()
    • initialize

      public void initialize​(com.badlogic.gdx.assets.AssetManager manager)
      Description copied from interface: IProcessRenderer
      Initializes the renderer, sending all the necessary assets to the manager for loading
      Specified by:
      initialize in interface IProcessRenderer
      Parameters:
      manager - The asset manager
    • doneLoading

      public void doneLoading​(com.badlogic.gdx.assets.AssetManager manager)
      Description copied from interface: IProcessRenderer
      Actually initializes all the clockwork of this renderer using the assets in the given manager
      Specified by:
      doneLoading in interface IProcessRenderer
      Parameters:
      manager - The asset manager
    • renderGlowPass

      public void renderGlowPass​(ICamera camera, com.badlogic.gdx.graphics.glutils.FrameBuffer fb, int eye)
    • 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)
      Description copied from interface: IProcessRenderer
      Renders the scene.
      Specified by:
      render in interface IProcessRenderer
      Parameters:
      camera - The camera to use
      t - The delta time computed in the update method in seconds
      rw - The width of the render buffer
      rh - The height of the render buffer
      tw - The final target width
      th - The final target height
      fb - The frame buffer to write to, if any
      ppb - The post process bean
    • getCurrentSGR

      public ISGR getCurrentSGR()
    • getGlowFb

      public com.badlogic.gdx.graphics.glutils.FrameBuffer getGlowFb()
    • renderScene

      public void renderScene​(ICamera camera, double t, RenderingContext rc)
      Renders the scene
      Parameters:
      camera - The camera to use
      t - The time in seconds since the start
      rc - The render context
    • renderSystem

      public void renderSystem​(ICamera camera, double t, RenderingContext rc, java.lang.Class<? extends IRenderSystem> clazz)
      Renders all the systems which are the same type of the given class
      Parameters:
      camera - The camera to use
      t - The time in seconds since the start
      rc - The render contex
      clazz - The class
    • clearLists

      public void clearLists()
      This must be called when all the rendering for the current frame has finished.
    • isOn

      public boolean isOn​(ComponentTypes.ComponentType comp)
      Checks if a given component type is on
      Parameters:
      comp - The component
      Returns:
      Whether the component is on
    • isOn

      public boolean isOn​(ComponentTypes comp)
      Checks if the component types are all on
      Parameters:
      comp - The components
      Returns:
      Whether the components are all on
    • isOn

      public boolean isOn​(int ordinal)
    • notify

      public void notify​(Events event, java.lang.Object... data)
      Specified by:
      notify in interface IObserver
    • resize

      public void resize​(int w, int h, int rw, int rh)
    • resize

      public void resize​(int w, int h, int rw, int rh, boolean resizeRenderSys)
    • resizeRenderSystems

      public void resizeRenderSystems​(int w, int h, int rw, int rh)
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
    • updateLineRenderSystem

      public void updateLineRenderSystem()