sdr 0.21

net.cscott.sdr.anim
Class SdrBaseGame

java.lang.Object
  extended by com.jme.app.AbstractGame
      extended by com.jme.app.FixedFramerateGame
          extended by net.cscott.sdr.anim.SdrBaseGame
Direct Known Subclasses:
JmeDemo, SdrGame

public abstract class SdrBaseGame
extends FixedFramerateGame

SdrBaseGame is a fixed-framerate base game class. It sets up the BaseGame in a manner similar to SimpleGame, but defers the really application-specific stuff to subclasses.

Version:
$Id: SdrBaseGame.java,v 1.4 2006-10-25 17:46:46 cananian Exp $
Author:
C. Scott Ananian

Field Summary
protected  Camera cam
          Our camera.
protected  InputHandler input
          Handles mouse/keyboard.
protected  LightState lightState
          A lightstate to turn on and off for the rootNode.
protected  Node rootNode
          Root node of our scene graph.
protected  boolean showBounds
          True if the renderer should display bounds.
protected  boolean showDepth
          True if the renderer should display the depth buffer.
protected  boolean showNormals
          True if the rnederer should display normals.
protected  Timer timer
          High resolution timer for tempo-independent animation.
protected  WireframeState wireState
          A wirestate to turn on and off for the rootNode.
 
Fields inherited from class com.jme.app.AbstractGame
ALWAYS_SHOW_PROPS_DIALOG, display, finished, FIRSTRUN_OR_NOCONFIGFILE_SHOW_PROPS_DIALOG, NEVER_SHOW_PROPS_DIALOG, properties
 
Constructor Summary
SdrBaseGame()
           
 
Method Summary
protected  void cleanup()
          Cleans up the keyboard.
protected  void doDebug(Renderer r)
           
protected  void initGame()
          Creates rootNode, lighting, and other basic render states.
protected  void initSystem()
          Creates display, sets up camera, and binds keys.
 void onCamera()
          This method is called whenever the camera is moved.
protected  void quit()
          Calls the quit of BaseGame to clean up the display and then closes the JVM.
protected  void reinit()
          Unused.
protected  void render(float interpolation)
          This is called for every frame in BaseGame.start(), after update().
protected abstract  void sdrInitGame()
          Called near end of initGame().
protected  void sdrRender()
          Defined in subclasses for custom rendering.
protected  void sdrUpdate()
          Defined in subclasses for custom updating.
protected  void update(float interpolation)
          Updates the timer, input, and update queue.
 
Methods inherited from class com.jme.app.FixedFramerateGame
getFramesPerSecond, setFrameRate, start
 
Methods inherited from class com.jme.app.AbstractGame
assertDisplayCreated, finish, getAttributes, getVersion, setDialogBehaviour, setDialogBehaviour, setDialogBehaviour
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cam

protected Camera cam
Our camera.


rootNode

protected Node rootNode
Root node of our scene graph.


input

protected InputHandler input
Handles mouse/keyboard.


timer

protected Timer timer
High resolution timer for tempo-independent animation.


showDepth

protected boolean showDepth
True if the renderer should display the depth buffer.


showBounds

protected boolean showBounds
True if the renderer should display bounds.


showNormals

protected boolean showNormals
True if the rnederer should display normals.


wireState

protected WireframeState wireState
A wirestate to turn on and off for the rootNode.


lightState

protected LightState lightState
A lightstate to turn on and off for the rootNode.

Constructor Detail

SdrBaseGame

public SdrBaseGame()
Method Detail

update

protected final void update(float interpolation)
Updates the timer, input, and update queue. Checks 'quit' key.

Specified by:
update in class FixedFramerateGame
Parameters:
interpolation - unused

sdrUpdate

protected void sdrUpdate()
Defined in subclasses for custom updating.


render

protected final void render(float interpolation)
This is called for every frame in BaseGame.start(), after update().

Specified by:
render in class FixedFramerateGame
Parameters:
interpolation - unused in this implementation.

sdrRender

protected void sdrRender()
Defined in subclasses for custom rendering.


doDebug

protected void doDebug(Renderer r)

initSystem

protected void initSystem()
Creates display, sets up camera, and binds keys.

Specified by:
initSystem in class FixedFramerateGame

onCamera

public void onCamera()
This method is called whenever the camera is moved.


initGame

protected void initGame()
Creates rootNode, lighting, and other basic render states. Called in BaseGame.start() after initSystem().

Specified by:
initGame in class FixedFramerateGame

sdrInitGame

protected abstract void sdrInitGame()
Called near end of initGame(). Must be defined by derived classes.


reinit

protected void reinit()
Unused.

Specified by:
reinit in class FixedFramerateGame

cleanup

protected void cleanup()
Cleans up the keyboard.

Specified by:
cleanup in class FixedFramerateGame

quit

protected void quit()
Calls the quit of BaseGame to clean up the display and then closes the JVM.

Overrides:
quit in class FixedFramerateGame

sdr 0.21

Copyright (c) 2006 C. Scott Ananian