public abstract class MeshAppStateMode extends SimpleAppState implements ICameraListener
AppState
s designed for
manipulating the scene in a MeshAppState
. Any features shared
among all such AppState
s should be implemented here.Constructor and Description |
---|
MeshAppStateMode(MeshAppState appState)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
disableAppState()
This is called when the
SimpleAppState is disabled or
"deactivated". |
void |
enableAppState()
This is called when the
SimpleAppState is enabled or
"activated". |
abstract java.lang.String |
getDescription()
Gets a description of this
MeshAppStateMode . |
abstract java.lang.String |
getName()
Gets the name of this
MeshAppStateMode . |
void |
leftClick(boolean isPressed,
float tpf)
This is called if the left mouse button is clicked or released.
|
void |
registerControls()
Registers mouse click controls wired to
leftClick(boolean, float) and
rightClick(boolean, float) . |
void |
rightClick(boolean isPressed,
float tpf)
This is called if the right mouse button is clicked or released.
|
void |
setChaseCamera(CustomChaseCamera chaseCam)
Sets the custom chase camera that is used by the parent
MeshAppState . |
void |
unregisterControls()
Unregisters mouse click controls wired to
leftClick(boolean, float) and
rightClick(boolean, float) . |
void |
update(float tpf) |
cleanup, createBasicMaterial, createLitMaterial, disableControls, enableControls, enqueue, getApplication, getCollision, getCrosshairRay, getCursorRay, getCursorRayFromClick, getMaterial, initialize, isEnabled, isInitialized, postRender, printCollisionResults, removeMaterial, render, setEnabled, setMaterial, start, stateAttached, stateDetached, stop
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
zoomChanged
public MeshAppStateMode(MeshAppState appState)
appState
- The MeshAppState
that this
MeshAppStateMode
supports.public void enableAppState()
SimpleAppState
SimpleAppState
is enabled or
"activated". This is equivalent to unpausing or resuming a game.
Note: If this method is overridden, then the first
call from the sub-class should be super.enableAppState();
in
order to properly enable the default SimpleAppState
features.
public void registerControls()
leftClick(boolean, float)
and
rightClick(boolean, float)
.
Note: If overridden, the first call should be
super.registerControls();
to properly register the left and
right mouse clicks controls.
public void disableAppState()
SimpleAppState
SimpleAppState
is disabled or
"deactivated". This is equivalent to pausing or halting a game.
Note: If this method is overridden, then the last
call from the sub-class should be super.disableAppState();
in order to properly disable the default SimpleAppState
features.
public void unregisterControls()
leftClick(boolean, float)
and
rightClick(boolean, float)
.
Note: If overridden, the last call should be
super.unregisterControls();
to properly unregister the left
and right mouse clicks controls.
public void update(float tpf)
update
in interface com.jme3.app.state.AppState
update
in class SimpleAppState
public void leftClick(boolean isPressed, float tpf)
isPressed
- Whether the left mouse button is pressed or released.tpf
- Time per frame, as in update(float)
.public void rightClick(boolean isPressed, float tpf)
isPressed
- Whether the right mouse button is pressed or released.tpf
- Time per frame, as in update(float)
.public abstract java.lang.String getName()
MeshAppStateMode
. This is used as a
display name for buttons and other widgets.public abstract java.lang.String getDescription()
MeshAppStateMode
. This is used as
a description for widget tool tips.public void setChaseCamera(CustomChaseCamera chaseCam)
MeshAppState
. This is critical to update the scales of
vertices and edges when the camera's zoom changes.chaseCam
- The new chase camera.