Package jme3utilities
Class SimpleAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
jme3utilities.NamedAppState
jme3utilities.SimpleAppState
- All Implemented Interfaces:
com.jme3.app.state.AppState
- Direct Known Subclasses:
PerformanceAppState,ViewPortAppState
A NamedAppState with protected fields analogous to those of
SimpleApplication. If any of these fields change, notify
these states by invoking refreshCachedFields().-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.jme3.asset.AssetManagerasset manager: set by initialize()protected com.jme3.renderer.Cameradefault camera for rendering: set by initialize()protected com.jme3.input.FlyByCameracamera controller for demos and debugging: set by initialize()protected com.jme3.scene.Noderoot node of GUI scene graph: set by initialize()protected com.jme3.renderer.ViewPortviewport for GUI scene: set by initialize()protected com.jme3.input.InputManagerinput manager: set by initialize()protected com.jme3.renderer.RenderManagerrender manager: set by initialize()protected com.jme3.scene.Noderoot node of main scene graph: set by initialize()protected com.jme3.app.SimpleApplicationapplication instance: set by initialize()protected com.jme3.app.state.AppStateManagerAppState manager: set by initialize()protected com.jme3.renderer.ViewPortviewport for 3-D scene: set by initialize()Fields inherited from class com.jme3.app.state.AbstractAppState
initialized -
Constructor Summary
ConstructorsConstructorDescriptionSimpleAppState(boolean initialState) Instantiate an uninitialized state.SimpleAppState(InitialState initialState) Instantiate an uninitialized state. -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(com.jme3.app.state.AppStateManager sm, com.jme3.app.Application app) Initialize this state during the first update after it gets attached.voidUpdate cached references to match the application.voidrender(com.jme3.renderer.RenderManager rm) Callback to perform rendering for this state during each frame.voidstateDetached(com.jme3.app.state.AppStateManager sm) Immediate callback when this state gets detached.Methods inherited from class jme3utilities.NamedAppState
cleanup, getInfluence, hasInfluenceOver, influence, isEnabled, isInitialized, postRender, setEnabled, stateAttached, stopInfluencing, toString, updateMethods inherited from class com.jme3.app.state.AbstractAppState
getId, setId
-
Field Details
-
stateManager
protected com.jme3.app.state.AppStateManager stateManagerAppState manager: set by initialize() -
assetManager
protected com.jme3.asset.AssetManager assetManagerasset manager: set by initialize() -
cam
protected com.jme3.renderer.Camera camdefault camera for rendering: set by initialize() -
flyCam
protected com.jme3.input.FlyByCamera flyCamcamera controller for demos and debugging: set by initialize() -
inputManager
protected com.jme3.input.InputManager inputManagerinput manager: set by initialize() -
guiNode
protected com.jme3.scene.Node guiNoderoot node of GUI scene graph: set by initialize() -
rootNode
protected com.jme3.scene.Node rootNoderoot node of main scene graph: set by initialize() -
renderManager
protected com.jme3.renderer.RenderManager renderManagerrender manager: set by initialize() -
simpleApplication
protected com.jme3.app.SimpleApplication simpleApplicationapplication instance: set by initialize() -
guiViewPort
protected com.jme3.renderer.ViewPort guiViewPortviewport for GUI scene: set by initialize() -
viewPort
protected com.jme3.renderer.ViewPort viewPortviewport for 3-D scene: set by initialize()
-
-
Constructor Details
-
SimpleAppState
public SimpleAppState(boolean initialState) Instantiate an uninitialized state.- Parameters:
initialState- true → enabled, false → disabled
-
SimpleAppState
Instantiate an uninitialized state.- Parameters:
initialState- Enabled or Disabled (null means disabled)
-
-
Method Details
-
refreshCachedFields
public void refreshCachedFields()Update cached references to match the application. -
initialize
public void initialize(com.jme3.app.state.AppStateManager sm, com.jme3.app.Application app) Initialize this state during the first update after it gets attached. Should be invoked only by a subclass or by the AppStateManager.- Specified by:
initializein interfacecom.jme3.app.state.AppState- Overrides:
initializein classNamedAppState- Parameters:
sm- the manager for this state (not null)app- the application which owns this state (not null, alias created)
-
render
public void render(com.jme3.renderer.RenderManager rm) Callback to perform rendering for this state during each frame. Should be invoked only by a subclass or by the AppStateManager.- Specified by:
renderin interfacecom.jme3.app.state.AppState- Overrides:
renderin classNamedAppState- Parameters:
rm- the application's render manager (not null)
-
stateDetached
public void stateDetached(com.jme3.app.state.AppStateManager sm) Immediate callback when this state gets detached. Should be invoked only by a subclass or by the AppStateManager.Without knowing which thread invoked detach(), it is unsafe to modify the scene graph in this method. Instead, scene-graph modifications should occur in
cleanup().- Specified by:
stateDetachedin interfacecom.jme3.app.state.AppState- Overrides:
stateDetachedin classNamedAppState- Parameters:
sm- the application's state manager (not null)
-