Class SceneRenderer

java.lang.Object
cz.fidentis.analyst.rendering.SceneRenderer

public class SceneRenderer extends Object
Handles DrawableMeshs - objects to be drawn, and (re-)renders them on demand.
  • Field Details Link icon

    • BRIGHT_BACKGROUND Link icon

      public static final Color BRIGHT_BACKGROUND
    • DARK_BACKGROUND Link icon

      public static final Color DARK_BACKGROUND
  • Constructor Details Link icon

    • SceneRenderer Link icon

      public SceneRenderer()
  • Method Details Link icon

    • initGLContext Link icon

      public void initGLContext(com.jogamp.opengl.GLContext glContext)
      Initialization method - must be called first.
      Parameters:
      glContext - An OpenGL context. Must not be null, must be at least GL2
      Throws:
      IllegalArgumentException - if the gl is null
    • setBrightBackground Link icon

      public void setBrightBackground()
      Sets the scene background to bright.
    • setDarkBackground Link icon

      public void setDarkBackground()
      Sets the scene background to dark.
    • setViewport Link icon

      public void setViewport(int x, int y, int width, int height)
      Sets the view-port.
      Parameters:
      x - X corner
      y - Y corner
      width - Width
      height - Height
    • renderScene Link icon

      public void renderScene(Camera camera, Collection<Drawable> drawables)
      Renders drawable objects.
    • getViewportWidth Link icon

      public int getViewportWidth()
      gets view port width in pixels
      Returns:
      view port width in pixels
    • getViewportHeight Link icon

      public int getViewportHeight()
      gets view port height in pixels
      Returns:
      view port height in pixels
    • clearScene Link icon

      protected void clearScene()
      Clears the scene and prepares it for the re-drawing.
    • getShadersManager Link icon

      public ShadersManager getShadersManager()
      Gets the current manager of shaders
      Returns:
      shaders manager
    • hasShaders Link icon

      public boolean hasShaders()
      Returns true, if OpenGL shaders are available
      Returns:
      true, if OpenGL shaders are available
    • castRayThroughPixel Link icon

      public Ray castRayThroughPixel(int pixelX, int pixelY, Camera camera)
      Cast a ray through a pixel under the mouse pointer.
      Parameters:
      pixelX - The X coordinate of mouse pointer
      pixelY - The X coordinate of mouse pointer
      camera - Camera
      Returns:
      A ray directing towards the scene