com.jmex.game.state
Class CameraGameStateDefaultCamera

java.lang.Object
  extended by com.jmex.game.state.GameState
      extended by com.jmex.game.state.BasicGameState
          extended by com.jmex.game.state.CameraGameStateDefaultCamera
Direct Known Subclasses:
CameraGameState

public abstract class CameraGameStateDefaultCamera
extends BasicGameState

Author:
Irrisor

Field Summary
 
Fields inherited from class com.jmex.game.state.BasicGameState
rootNode
 
Fields inherited from class com.jmex.game.state.GameState
active, name, parent
 
Constructor Summary
CameraGameStateDefaultCamera(java.lang.String name)
           
 
Method Summary
 Node getRootNode()
           
protected  void initZBuffer()
          Creates a ZBuffer to display pixels closer to the camera above farther ones.
protected abstract  void onActivate()
          Points the renderers camera to the one contained by this state.
protected  void onDeactivate()
          Derived classes can put special actions they want to perform when deactivated here.
 void render(float tpf)
          Calls stateRender(float), then renders the rootNode.
 void setActive(boolean active)
          Overwritten to appropriately call switchTo() or switchFrom().
protected  void stateRender(float tpf)
          This is where derived classes are supposed to put their render logic.
protected  void stateUpdate(float tpf)
          This is where derived classes are supposed to put their game logic.
 void update(float tpf)
          Calls stateUpdate(float), then updates the geometric state of the rootNode.
 
Methods inherited from class com.jmex.game.state.BasicGameState
cleanup
 
Methods inherited from class com.jmex.game.state.GameState
getName, getParent, isActive, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CameraGameStateDefaultCamera

public CameraGameStateDefaultCamera(java.lang.String name)
Method Detail

getRootNode

public Node getRootNode()
Overrides:
getRootNode in class BasicGameState

initZBuffer

protected void initZBuffer()
Creates a ZBuffer to display pixels closer to the camera above farther ones.


setActive

public void setActive(boolean active)
Overwritten to appropriately call switchTo() or switchFrom().

Overrides:
setActive in class GameState
Parameters:
active - Whether or not you want this GameState to be updated and rendered.
See Also:
GameState.setActive(boolean)

update

public final void update(float tpf)
Calls stateUpdate(float), then updates the geometric state of the rootNode.

Overrides:
update in class BasicGameState
Parameters:
tpf - The elapsed time since last frame.
See Also:
GameState.update(float), stateUpdate(float)

render

public final void render(float tpf)
Calls stateRender(float), then renders the rootNode.

Overrides:
render in class BasicGameState
Parameters:
tpf - The elapsed time since last frame.
See Also:
GameState.render(float), stateRender(float)

stateUpdate

protected void stateUpdate(float tpf)
This is where derived classes are supposed to put their game logic. Gets called between the input.update and rootNode.updateGeometricState calls.

Much like the structure of SimpleGame.

Parameters:
tpf - The time since the last frame.

stateRender

protected void stateRender(float tpf)
This is where derived classes are supposed to put their render logic. Gets called before the rootNode gets rendered.

Much like the structure of SimpleGame.

Parameters:
tpf - The time since the last frame.

onActivate

protected abstract void onActivate()
Points the renderers camera to the one contained by this state. Derived classes can put special actions they want to perform when activated here.


onDeactivate

protected void onDeactivate()
Derived classes can put special actions they want to perform when deactivated here.