Package com.jme3.app.state
Class RootNodeAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
com.jme3.app.state.RootNodeAppState
- All Implemented Interfaces:
- AppState
AppState that manages and updates a RootNode attached to a ViewPort, the
 default Application ViewPort is used by default, a RootNode is created by
 default.
- 
Field SummaryFieldsFields inherited from class com.jme3.app.state.AbstractAppStateinitialized
- 
Constructor SummaryConstructorsConstructorDescriptionCreates the AppState with a new, empty root Node, attaches it to the default Application ViewPort and updates it when attached to the AppStateManager.RootNodeAppState(ViewPort viewPort) Creates the AppState with the given ViewPort and creates a RootNode that is attached to the given ViewPort and updates it when attached to the AppStateManager.RootNodeAppState(ViewPort viewPort, Node rootNode) Creates the AppState with the given ViewPort and root Node, attaches the root Node to the ViewPort and updates it.RootNodeAppState(Node rootNode) Creates the AppState with the given root Node, uses the default Application ViewPort and updates the root Node when attached to the AppStateManager.RootNodeAppState(String id, ViewPort viewPort, Node rootNode) Creates the AppState with the given unique ID, ViewPort, and root Node, attaches the root Node to the ViewPort and updates it.
- 
Method SummaryModifier and TypeMethodDescriptionvoidcleanup()Called byAppStateManagerwhen transitioning thisAppStatefrom terminating to detached.Returns the managed rootNode.Returns the used ViewPortvoidinitialize(AppStateManager stateManager, Application app) Called byAppStateManagerwhen transitioning thisAppStatefrom initializing to running.
 This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)was called.voidupdate(float tpf) Called to update theAppState.Methods inherited from class com.jme3.app.state.AbstractAppStategetId, isEnabled, isInitialized, postRender, render, setEnabled, setId, stateAttached, stateDetached
- 
Field Details- 
viewPort
- 
rootNode
 
- 
- 
Constructor Details- 
RootNodeAppStatepublic RootNodeAppState()Creates the AppState with a new, empty root Node, attaches it to the default Application ViewPort and updates it when attached to the AppStateManager.
- 
RootNodeAppStateCreates the AppState with the given ViewPort and creates a RootNode that is attached to the given ViewPort and updates it when attached to the AppStateManager.- Parameters:
- viewPort- An existing ViewPort
 
- 
RootNodeAppStateCreates the AppState with the given root Node, uses the default Application ViewPort and updates the root Node when attached to the AppStateManager.- Parameters:
- rootNode- An existing root Node
 
- 
RootNodeAppStateCreates the AppState with the given ViewPort and root Node, attaches the root Node to the ViewPort and updates it.- Parameters:
- viewPort- An existing ViewPort
- rootNode- An existing root Node
 
- 
RootNodeAppStateCreates the AppState with the given unique ID, ViewPort, and root Node, attaches the root Node to the ViewPort and updates it.- Parameters:
- id- the desired AppState ID
- viewPort- An existing ViewPort
- rootNode- An existing root Node
 
 
- 
- 
Method Details- 
initializeDescription copied from interface:AppStateCalled byAppStateManagerwhen transitioning thisAppStatefrom initializing to running.
 This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)was called.AppStateManagerwill call this only from the update loop inside the rendering thread. This means is it safe to modify the scene graph from this method.- Specified by:
- initializein interface- AppState
- Overrides:
- initializein class- AbstractAppState
- Parameters:
- stateManager- The state manager
- app- The application
 
- 
updatepublic void update(float tpf) Description copied from interface:AppStateCalled to update theAppState. This method will be called every render pass if theAppStateis both attached and enabled.- Specified by:
- updatein interface- AppState
- Overrides:
- updatein class- AbstractAppState
- Parameters:
- tpf- Time since the last call to update(), in seconds.
 
- 
cleanuppublic void cleanup()Description copied from interface:AppStateCalled byAppStateManagerwhen transitioning thisAppStatefrom terminating to detached. This method is called the following render pass after theAppStatehas been detached and is always called once and only once for each timeinitialize()is called. Either when theAppStateis detached or when the application terminates (if it terminates normally).- Specified by:
- cleanupin interface- AppState
- Overrides:
- cleanupin class- AbstractAppState
 
- 
getRootNodeReturns the managed rootNode.- Returns:
- The managed rootNode
 
- 
getViewPortReturns the used ViewPort- Returns:
- The used ViewPort
 
 
-