gizmoball.graphics
Class WorldDrawer

java.lang.Object
  extended by gizmoball.graphics.WorldDrawer

public class WorldDrawer
extends java.lang.Object

The class that will draw, in 3D, the objects in the world. You pass in a WorldState object, containing all the game objects. To make changes in what is to be drawn, modify the passed in WorldState directly (and the objects that it holds).


Constructor Summary
WorldDrawer(WorldState state)
          Constructs a rendering instance
WorldDrawer(WorldState state, Vect3 initialCameraPos, Vect3 initialLookAt)
          Constructs a rendering instance, with the specified initial camera position
 
Method Summary
 boolean cameraIsMoving()
           
 void display(GLAutoDrawable drawable)
          Renders all displayable objects
 void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
          method required by GLEventListener interface
 void init(GLAutoDrawable gld)
          performs the initialization of the scene
 void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
          method required by GLEventListener interface
 void setCamera(Vect3 newPosition)
          Sets the camera to a new location.
 void setLookAt(Vect3 newLookat)
          Sets the camera look at to a new location.
 void translateCamera(Vect3 diff)
          Moves the camera by a specified amount.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorldDrawer

public WorldDrawer(WorldState state)
Constructs a rendering instance


WorldDrawer

public WorldDrawer(WorldState state,
                   Vect3 initialCameraPos,
                   Vect3 initialLookAt)
Constructs a rendering instance, with the specified initial camera position

Method Detail

init

public void init(GLAutoDrawable gld)
performs the initialization of the scene

See Also:
javax.media.opengl.GLEventListener#init(javax.media.opengl.GLAutoDrawable)

display

public void display(GLAutoDrawable drawable)
Renders all displayable objects

See Also:
javax.media.opengl.GLEventListener#display(javax.media.opengl.GLAutoDrawable)

reshape

public void reshape(GLAutoDrawable drawable,
                    int x,
                    int y,
                    int width,
                    int height)
method required by GLEventListener interface


displayChanged

public void displayChanged(GLAutoDrawable drawable,
                           boolean modeChanged,
                           boolean deviceChanged)
method required by GLEventListener interface


translateCamera

public void translateCamera(Vect3 diff)
Moves the camera by a specified amount.


setCamera

public void setCamera(Vect3 newPosition)
Sets the camera to a new location.


cameraIsMoving

public boolean cameraIsMoving()

setLookAt

public void setLookAt(Vect3 newLookat)
Sets the camera look at to a new location.