public class EditMode extends MeshAppStateMode implements IMeshSelectionListener
MeshAppStateMode
allows the user to select available vertices
and modify them by dragging them or deleting them. The left/right control and
left/right shift keys aid in selection (control is usually toggle, while
shift is usually add).Constructor and Description |
---|
EditMode(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". |
java.lang.String |
getDescription()
Gets a description of this
MeshAppStateMode . |
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 additional controls for editing mesh elements.
|
void |
selectionChanged()
This method updates the
EditMode 's knowledge of the
currently-selected vertices in the MeshApplication . |
void |
unregisterControls()
Unregisters the additional controls for adding mesh elements.
|
void |
update(float tpf) |
void |
zoomChanged(float distance)
This method updates all controllers for temporary spatials to account for
any changes in zoom.
|
rightClick, setChaseCamera
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
public EditMode(MeshAppState appState)
appState
- The MeshAppState
that this
MeshAppStateMode
supports.public java.lang.String getName()
MeshAppStateMode
MeshAppStateMode
. This is used as a
display name for buttons and other widgets.getName
in class MeshAppStateMode
public java.lang.String getDescription()
MeshAppStateMode
MeshAppStateMode
. This is used as
a description for widget tool tips.getDescription
in class MeshAppStateMode
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.
enableAppState
in class MeshAppStateMode
public void registerControls()
registerControls
in class MeshAppStateMode
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.
disableAppState
in class MeshAppStateMode
public void unregisterControls()
unregisterControls
in class MeshAppStateMode
public void update(float tpf)
update
in interface com.jme3.app.state.AppState
update
in class MeshAppStateMode
public void leftClick(boolean isPressed, float tpf)
MeshAppStateMode
leftClick
in class MeshAppStateMode
isPressed
- Whether the left mouse button is pressed or released.tpf
- Time per frame, as in MeshAppStateMode.update(float)
.public void selectionChanged()
EditMode
's knowledge of the
currently-selected vertices in the MeshApplication
.selectionChanged
in interface IMeshSelectionListener
public void zoomChanged(float distance)
zoomChanged
in interface ICameraListener
distance
- The camera's new distance from the target.