public class AddMode extends MeshAppStateMode
MeshAppStateMode
allows the user to add additional polygons to
the MeshAppState
's MeshComponent
by clicking on the grid.
Vertices can be re-used, and once enough vertices have been placed, the user
can confirm or cancel the new polygon from keyboard input.Constructor and Description |
---|
AddMode(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 . |
int |
getPolygonSize()
Gets the current size of polygons created by AddMode.
|
void |
leftClick(boolean isPressed,
float tpf)
This is called if the left mouse button is clicked or released.
|
void |
registerControls()
Registers additional controls for adding mesh elements.
|
void |
setPolygonSize(int size)
Sets the current size of polygons created by AddMode.
|
void |
unregisterControls()
Unregisters the additional controls for adding mesh elements.
|
void |
zoomChanged(float distance)
This method updates all controllers for temporary spatials to account for
any changes in zoom.
|
rightClick, setChaseCamera, update
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 AddMode(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 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 int getPolygonSize()
public void setPolygonSize(int size)
size
- An integer value greater than 2. If it is 2 or less, this
method does nothing.public void zoomChanged(float distance)
distance
- The camera's new distance from the target.