com.jme.app
Class StandardGameState

java.lang.Object
  extended bycom.jme.app.StandardGameState
All Implemented Interfaces:
GameState
Direct Known Subclasses:
IngameState, MenuState

public abstract class StandardGameState
extends java.lang.Object
implements GameState

A typical game state that initializes a rootNode and camera. The input handler is left to be initialized by derived classes.

Author:
Per Thulin

Field Summary
protected  Camera cam
           
protected  InputHandler input
           
protected  Node stateNode
           
 
Constructor Summary
StandardGameState()
          Initializes rootNode and camera.
 
Method Summary
 void cleanup()
          Empty.
 Camera getCamera()
          Gets the camera of this state.
 Node getStateNode()
          Gets the state node of this state.
protected abstract  void initInput()
          Initialize the input handler.
 void render(float tpf)
          Empty.
 void setCamera(Camera cam)
          Sets the camera of this state.
 void switchTo()
          Empty.
 void update(float tpf)
          Updates the InputHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

protected InputHandler input

stateNode

protected Node stateNode

cam

protected Camera cam
Constructor Detail

StandardGameState

public StandardGameState()
Initializes rootNode and camera.

Method Detail

update

public void update(float tpf)
Updates the InputHandler.

Specified by:
update in interface GameState
Parameters:
tpf - The time since last frame.

render

public void render(float tpf)
Empty.

Specified by:
render in interface GameState
Parameters:
tpf - The time since last frame.
See Also:
GameState.render(float)

switchTo

public void switchTo()
Empty.

Specified by:
switchTo in interface GameState
See Also:
GameState.switchTo()

cleanup

public void cleanup()
Empty.

Specified by:
cleanup in interface GameState
See Also:
GameState.cleanup()

getCamera

public Camera getCamera()
Gets the camera of this state.

Specified by:
getCamera in interface GameState
Returns:
The camera of this state.

setCamera

public void setCamera(Camera cam)
Sets the camera of this state.

Specified by:
setCamera in interface GameState

getStateNode

public Node getStateNode()
Gets the state node of this state.

Specified by:
getStateNode in interface GameState
Returns:
The state node of this state.

initInput

protected abstract void initInput()
Initialize the input handler.