|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmex.game.state.GameState
com.jmex.game.state.BasicGameState
com.jmex.game.state.CameraGameStateDefaultCamera
com.jmex.game.state.CameraGameState
public class CameraGameState
A typical game state that initializes a rootNode, camera and a ZBufferState.
In update(float) we call updateGeometricState(0, true) on the rootNode, and in render(float) we draw it.
stateUpdate and stateRender can be filled with custom logic. Much like in SimpleGame.
The setActive method will trigger the onActivate/onDeactivate methods, giving derived classes an opportunity to perform special actions. E.g. start/stop playing menu music and such. Beware though; the onActivate method points the renderer to the camera contained by this state, so if you override it you must remember to call super.onActivate().
Field Summary | |
---|---|
protected Camera |
cam
The camera of this game state. |
Fields inherited from class com.jmex.game.state.BasicGameState |
---|
rootNode |
Fields inherited from class com.jmex.game.state.GameState |
---|
active, name, parent |
Constructor Summary | |
---|---|
CameraGameState(java.lang.String name)
Inits rootNode, camera and ZBufferState. |
Method Summary | |
---|---|
Camera |
getCamera()
Gets the camera of this state. |
protected void |
initCamera()
Initializes a standard camera. |
protected void |
onActivate()
Points the renderers camera to the one contained by this state. |
void |
setCamera(Camera cam)
Sets the camera of this state. |
Methods inherited from class com.jmex.game.state.CameraGameStateDefaultCamera |
---|
getRootNode, initZBuffer, onDeactivate, render, setActive, stateRender, stateUpdate, update |
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 |
Field Detail |
---|
protected Camera cam
Constructor Detail |
---|
public CameraGameState(java.lang.String name)
name
- The name of this GameState.Method Detail |
---|
protected void onActivate()
onActivate
in class CameraGameStateDefaultCamera
public Camera getCamera()
public void setCamera(Camera cam)
protected void initCamera()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |