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 Summary
Fields inherited from class com.jme3.app.state.AbstractAppState
initialized
-
Constructor Summary
ConstructorDescriptionCreates 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 Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Called byAppStateManager
when transitioning thisAppState
from terminating to detached.Returns the managed rootNode.Returns the used ViewPortvoid
initialize
(AppStateManager stateManager, Application app) Called byAppStateManager
when transitioning thisAppState
from initializing to running.
This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)
was called.void
update
(float tpf) Called to update theAppState
.Methods inherited from class com.jme3.app.state.AbstractAppState
getId, isEnabled, isInitialized, postRender, render, setEnabled, setId, stateAttached, stateDetached
-
Field Details
-
viewPort
-
rootNode
-
-
Constructor Details
-
RootNodeAppState
public 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. -
RootNodeAppState
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.- Parameters:
viewPort
- An existing ViewPort
-
RootNodeAppState
Creates 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
-
RootNodeAppState
Creates the AppState with the given ViewPort and root Node, attaches the root Node to the ViewPort and updates it.- Parameters:
viewPort
- An existing ViewPortrootNode
- An existing root Node
-
RootNodeAppState
Creates 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 IDviewPort
- An existing ViewPortrootNode
- An existing root Node
-
-
Method Details
-
initialize
Description copied from interface:AppState
Called byAppStateManager
when transitioning thisAppState
from initializing to running.
This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)
was called.AppStateManager
will 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:
initialize
in interfaceAppState
- Overrides:
initialize
in classAbstractAppState
- Parameters:
stateManager
- The state managerapp
- The application
-
update
public void update(float tpf) Description copied from interface:AppState
Called to update theAppState
. This method will be called every render pass if theAppState
is both attached and enabled.- Specified by:
update
in interfaceAppState
- Overrides:
update
in classAbstractAppState
- Parameters:
tpf
- Time since the last call to update(), in seconds.
-
cleanup
public void cleanup()Description copied from interface:AppState
Called byAppStateManager
when transitioning thisAppState
from terminating to detached. This method is called the following render pass after theAppState
has been detached and is always called once and only once for each timeinitialize()
is called. Either when theAppState
is detached or when the application terminates (if it terminates normally).- Specified by:
cleanup
in interfaceAppState
- Overrides:
cleanup
in classAbstractAppState
-
getRootNode
Returns the managed rootNode.- Returns:
- The managed rootNode
-
getViewPort
Returns the used ViewPort- Returns:
- The used ViewPort
-