public class MeshAppState extends ViewAppState implements IMeshSelectionListener
AppState
provides a 3D view of a
MeshComponent
.Constructor and Description |
---|
MeshAppState()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
com.jme3.scene.Node |
createHUD(EmbeddedView view)
Creates a custom HUD with a crosshair, player coordinates, and cursor
coordinates.
|
java.lang.Object |
createViewCamera(EmbeddedView view)
|
void |
disposeViewCamera(EmbeddedView view)
Disposes specified interactive camera associated with the specified
EmbeddedView . |
CustomChaseCamera |
getChaseCamera()
Gets the chase camera used to follow the player around the scene.
|
float |
getEdgeSize()
Gets the current line width of the Lines used to represent edges.
|
MeshAppStateModeFactory |
getModeFactory()
Gets the
MeshAppState 's factory used to select from
available MeshAppStateMode s. |
float |
getScale()
Gets the scale used for determining how far to spread parts of the mesh.
|
MeshSelectionManager |
getSelectionManager()
Gets the MeshApplication's manager for mesh selections.
|
float |
getVertexSize()
Gets the current radius of the Spheres used to represent vertices.
|
float |
getZoomDistance()
|
void |
registerControls()
Registers the
SimpleAppState 's customized controls with the
underlying SimpleAppState.app 's InputManager . |
void |
selectionChanged()
This method is called by the MeshApplication when its current selection
has somehow changed.
|
void |
setMesh(MeshComponent mesh)
Sets the
MeshComponent that will be rendered in the jME3
view. |
void |
setMode(MeshAppStateMode mode)
Sets the current
MeshAppStateMode (or how the view is
manipulated) for the MeshAppState . |
void |
setScale(float scale)
Sets the scale used for determining how far to spread parts of the mesh.
|
void |
start(MasterApplication app)
In addition to the default start behavior, this method starts any
associated resources.
|
void |
stop()
Overrides the default behavior to stop the
mode and
meshUpdateHandler . |
void |
unregisterControls()
Unregisters the
SimpleAppState 's customized controls from
the underlying SimpleAppState.app 's InputManager . |
void |
update(float tpf)
Updates the player location, coordinates in the HUD, and syncs all
AbstractMeshController s in the updateQueue . |
void |
updateHUD(EmbeddedView view,
int width,
int height)
Notifies the client that a HUD must be updated based on the provided
width and height of the associated
EmbeddedView 's underlying
AwtPanel . |
void |
updateViewCamera(EmbeddedView view,
boolean enabled)
Enables or disables the default
FlightCamera associated with the
EmbeddedView . |
cleanupAppState, createComposite, disposeHUD, exportImage, getCrosshairRay, getCursorRay, getCursorRayFromClick, getDisplayAxes, getDisplayHUD, getRootNode, getSceneRoot, setDisplayAxes, setDisplayHUD, start, viewActivated, viewDeactivated, viewResized
disableControls, enableControls, initialize
cleanup, createBasicMaterial, createLitMaterial, enqueue, getApplication, getCollision, getCrosshairRay, getCursorRay, getCursorRayFromClick, getMaterial, isEnabled, isInitialized, postRender, printCollisionResults, removeMaterial, render, setEnabled, setMaterial, stateAttached, stateDetached
public void start(MasterApplication app)
start
in class ViewAppState
app
- The jME-based MasterApplication
that will be
hosting this ViewAppState
.public void stop()
mode
and
meshUpdateHandler
.stop
in class ViewAppState
public void registerControls()
SimpleAppState
SimpleAppState
's customized controls with the
underlying SimpleAppState.app
's InputManager
.public void unregisterControls()
SimpleAppState
SimpleAppState
's customized controls from
the underlying SimpleAppState.app
's InputManager
.public void update(float tpf)
AbstractMeshController
s in the updateQueue
.update
in interface com.jme3.app.state.AppState
update
in class SimpleAppState
SimpleAppState.update(float)
public void selectionChanged()
IMeshSelectionListener
selectionChanged
in interface IMeshSelectionListener
public void setMesh(MeshComponent mesh)
MeshComponent
that will be rendered in the jME3
view.mesh
- The mesh to render.public void setMode(MeshAppStateMode mode)
MeshAppStateMode
(or how the view is
manipulated) for the MeshAppState
.mode
- The new mode.public MeshSelectionManager getSelectionManager()
MeshSelectionManager
.public MeshAppStateModeFactory getModeFactory()
MeshAppState
's factory used to select from
available MeshAppStateMode
s.MeshAppStateModeFactory
.public com.jme3.scene.Node createHUD(EmbeddedView view)
createHUD
in interface IEmbeddedViewClient
createHUD
in class ViewAppState
view
- The EmbeddedView
that is requesting the GUI/HUD
Node
.Node
.public void updateHUD(EmbeddedView view, int width, int height)
IEmbeddedViewClient
EmbeddedView
's underlying
AwtPanel
.
Note: This method is called from the render thread.
updateHUD
in interface IEmbeddedViewClient
updateHUD
in class ViewAppState
view
- The EmbeddedView
whose size has changed.width
- The new width of the EmbeddedView
's
AwtPanel
.height
- The new width of the EmbeddedView
's
AwtPanel
.public java.lang.Object createViewCamera(EmbeddedView view)
createViewCamera
in interface IEmbeddedViewClient
createViewCamera
in class ViewAppState
view
- The EmbeddedView
that is requesting an
interactive camera.public void updateViewCamera(EmbeddedView view, boolean enabled)
ViewAppState
FlightCamera
associated with the
EmbeddedView
.updateViewCamera
in interface IEmbeddedViewClient
updateViewCamera
in class ViewAppState
view
- The EmbeddedView
that has gained or lost focus.enabled
- Whether or not to enable the interactive camera.public void disposeViewCamera(EmbeddedView view)
IEmbeddedViewClient
EmbeddedView
.
Note: This method is called from the render thread.
disposeViewCamera
in interface IEmbeddedViewClient
disposeViewCamera
in class ViewAppState
view
- The EmbeddedView
that is removing the interactive
camera.public CustomChaseCamera getChaseCamera()
createViewCamera(EmbeddedView)
.public float getZoomDistance()
public void setScale(float scale)
scale
- The new scale value.public float getScale()
public float getVertexSize()
public float getEdgeSize()