public class RootNodeAppState extends AbstractAppState
Modifier and Type | Field and Description |
---|---|
protected Node |
rootNode |
protected ViewPort |
viewPort |
initialized
Constructor and Description |
---|
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(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(java.lang.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.
|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Called by
AppStateManager when transitioning this
AppState from terminating to detached. |
Node |
getRootNode()
Returns the managed rootNode.
|
ViewPort |
getViewPort()
Returns the used ViewPort
|
void |
initialize(AppStateManager stateManager,
Application app)
Called by
AppStateManager when transitioning this AppState
from initializing to running.This will happen on the next iteration through the update loop after AppStateManager.attach(com.jme3.app.state.AppState) was called. |
void |
update(float tpf)
Called to update the
AppState . |
getId, isEnabled, isInitialized, postRender, render, setEnabled, setId, stateAttached, stateDetached
public RootNodeAppState()
public RootNodeAppState(ViewPort viewPort)
viewPort
- An existing ViewPortpublic RootNodeAppState(Node rootNode)
rootNode
- An existing root Nodepublic RootNodeAppState(ViewPort viewPort, Node rootNode)
viewPort
- An existing ViewPortrootNode
- An existing root Nodepublic RootNodeAppState(java.lang.String id, ViewPort viewPort, Node rootNode)
id
- the desired AppState IDviewPort
- An existing ViewPortrootNode
- An existing root Nodepublic void initialize(AppStateManager stateManager, Application app)
AppState
AppStateManager
when transitioning this AppState
from initializing to running.AppStateManager.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.
initialize
in interface AppState
initialize
in class AbstractAppState
stateManager
- The state managerapp
- The applicationpublic void update(float tpf)
AppState
AppState
. This method will be called
every render pass if the AppState
is both attached and enabled.update
in interface AppState
update
in class AbstractAppState
tpf
- Time since the last call to update(), in seconds.public void cleanup()
AppState
AppStateManager
when transitioning this
AppState
from terminating to detached. This
method is called the following render pass after the AppState
has
been detached and is always called once and only once for each time
initialize()
is called. Either when the AppState
is detached or when the application terminates (if it terminates normally).cleanup
in interface AppState
cleanup
in class AbstractAppState
public Node getRootNode()
public ViewPort getViewPort()