hmi.graphics.lwjgl
Class LWJGLRenderer

java.lang.Object
  extended by hmi.graphics.lwjgl.LWJGLRenderer
All Implemented Interfaces:
ClockListener

public class LWJGLRenderer
extends Object
implements ClockListener

A basic renderer with basic support for animation.


Field Summary
private  double aspect
           
private  double bottom
           
private  ClockListener clockListener
           
private  double far
           
private  double fovy
           
private  LWJGLContext glc
           
private  int height
           
private  double left
           
static Logger logger
           
private  double mediaTime
           
private  double near
           
private  org.lwjgl.opengl.PixelFormat pf
           
private  double right
           
private  GLRenderObject scene
           
private  double top
           
private  Runnable updater
           
private  boolean useVsync
           
private  int width
           
 
Constructor Summary
LWJGLRenderer(int numFSAA_Samples, int numStencilBits, int width, int height)
          Create a new renderer, using a new GLCanvas with capabilities set to default values, except for the antialiasing setting.
 
Method Summary
private  void calculateFrustumFromFOVY()
           
 void destroy()
           
 void initLWJGL()
          The time method required by the ClockListener interface; It sets the current media time, and then causes a Jogl display() call.
 void initTime(double t)
          The time method required by the ClockListener interface; It sets the current media time, and then causes a Jogl display() call.
 void reshape(int x, int y, int w, int h)
          Called when the glDrawable has been resized.
 void setClockListener(ClockListener listener)
          Sets theClockListener
 void setDisplayParent(Canvas canvas)
           
 void setFar(double far)
          Sets the (positive) distance to the far clipping plane.
 void setFOVY(double fovy)
          Sets the field of view in the Y direction, specified in degrees(!)
 void setNear(double near)
          Sets the (positive) distance to the near clipping plane.
 void setScene(GLRenderObject scene)
          Sets the 3D scene object, to be rendered.
 void setVsync(boolean useVsync)
          Sets the vsync mode
 void time(double t)
          The time method required by the ClockListener interface; It sets the current media time, and then causes a Jogl display() call.
 void updateLWJGL()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static Logger logger

pf

private org.lwjgl.opengl.PixelFormat pf

scene

private GLRenderObject scene

glc

private LWJGLContext glc

clockListener

private ClockListener clockListener

mediaTime

private volatile double mediaTime

useVsync

private boolean useVsync

fovy

private double fovy

aspect

private double aspect

width

private int width

height

private int height

left

private double left

right

private double right

bottom

private double bottom

top

private double top

near

private double near

far

private double far

updater

private Runnable updater
Constructor Detail

LWJGLRenderer

public LWJGLRenderer(int numFSAA_Samples,
                     int numStencilBits,
                     int width,
                     int height)
Create a new renderer, using a new GLCanvas with capabilities set to default values, except for the antialiasing setting. The numFSAA_Samples parameter determines the (FSAA) antialiasting seting: 0 or 1 means no antialiasing, values like 2, 4, or 8 will use FSAA with the number of samples as specified. The number of stencilbits is specified as well. A 0 value here means that no stencil buffer is used

Method Detail

destroy

public void destroy()

setDisplayParent

public void setDisplayParent(Canvas canvas)

setScene

public void setScene(GLRenderObject scene)
Sets the 3D scene object, to be rendered.


setClockListener

public void setClockListener(ClockListener listener)
Sets theClockListener


initTime

public void initTime(double t)
The time method required by the ClockListener interface; It sets the current media time, and then causes a Jogl display() call.

Specified by:
initTime in interface ClockListener

initLWJGL

public void initLWJGL()
The time method required by the ClockListener interface; It sets the current media time, and then causes a Jogl display() call.


updateLWJGL

public void updateLWJGL()

time

public void time(double t)
The time method required by the ClockListener interface; It sets the current media time, and then causes a Jogl display() call.

Specified by:
time in interface ClockListener

setVsync

public void setVsync(boolean useVsync)
Sets the vsync mode


setFOVY

public void setFOVY(double fovy)
Sets the field of view in the Y direction, specified in degrees(!)


setNear

public void setNear(double near)
Sets the (positive) distance to the near clipping plane.


setFar

public void setFar(double far)
Sets the (positive) distance to the far clipping plane.


calculateFrustumFromFOVY

private void calculateFrustumFromFOVY()

reshape

public void reshape(int x,
                    int y,
                    int w,
                    int h)
Called when the glDrawable has been resized.