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

public class SimpleAppState extends NamedAppState
A NamedAppState with protected fields analogous to those of SimpleApplication. If any of these fields change, notify these states by invoking refreshCachedFields().
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.jme3.asset.AssetManager
    asset manager: set by initialize()
    protected com.jme3.renderer.Camera
    default camera for rendering: set by initialize()
    protected com.jme3.input.FlyByCamera
    camera controller for demos and debugging: set by initialize()
    protected com.jme3.scene.Node
    root node of GUI scene graph: set by initialize()
    protected com.jme3.renderer.ViewPort
    viewport for GUI scene: set by initialize()
    protected com.jme3.input.InputManager
    input manager: set by initialize()
    protected com.jme3.renderer.RenderManager
    render manager: set by initialize()
    protected com.jme3.scene.Node
    root node of main scene graph: set by initialize()
    protected com.jme3.app.SimpleApplication
    application instance: set by initialize()
    protected com.jme3.app.state.AppStateManager
    AppState manager: set by initialize()
    protected com.jme3.renderer.ViewPort
    viewport for 3-D scene: set by initialize()

    Fields inherited from class com.jme3.app.state.AbstractAppState

    initialized
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleAppState(boolean initialState)
    Instantiate an uninitialized state.
    Instantiate an uninitialized state.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    initialize(com.jme3.app.state.AppStateManager sm, com.jme3.app.Application app)
    Initialize this state during the first update after it gets attached.
    void
    Update cached references to match the application.
    void
    render(com.jme3.renderer.RenderManager rm)
    Callback to perform rendering for this state during each frame.
    void
    stateDetached(com.jme3.app.state.AppStateManager sm)
    Immediate callback when this state gets detached.

    Methods inherited from class com.jme3.app.state.AbstractAppState

    getId, setId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • stateManager

      protected com.jme3.app.state.AppStateManager stateManager
      AppState manager: set by initialize()
    • assetManager

      protected com.jme3.asset.AssetManager assetManager
      asset manager: set by initialize()
    • cam

      protected com.jme3.renderer.Camera cam
      default camera for rendering: set by initialize()
    • flyCam

      protected com.jme3.input.FlyByCamera flyCam
      camera controller for demos and debugging: set by initialize()
    • inputManager

      protected com.jme3.input.InputManager inputManager
      input manager: set by initialize()
    • guiNode

      protected com.jme3.scene.Node guiNode
      root node of GUI scene graph: set by initialize()
    • rootNode

      protected com.jme3.scene.Node rootNode
      root node of main scene graph: set by initialize()
    • renderManager

      protected com.jme3.renderer.RenderManager renderManager
      render manager: set by initialize()
    • simpleApplication

      protected com.jme3.app.SimpleApplication simpleApplication
      application instance: set by initialize()
    • guiViewPort

      protected com.jme3.renderer.ViewPort guiViewPort
      viewport for GUI scene: set by initialize()
    • viewPort

      protected com.jme3.renderer.ViewPort viewPort
      viewport 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

      public SimpleAppState(InitialState initialState)
      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:
      initialize in interface com.jme3.app.state.AppState
      Overrides:
      initialize in class NamedAppState
      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:
      render in interface com.jme3.app.state.AppState
      Overrides:
      render in class NamedAppState
      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:
      stateDetached in interface com.jme3.app.state.AppState
      Overrides:
      stateDetached in class NamedAppState
      Parameters:
      sm - the application's state manager (not null)