public class PlantAppState extends ViewAppState implements IUpdateableListener, IPlantCompositeListener
AppState
provides a 3D view of a reactor plant.component
Constructor and Description |
---|
PlantAppState()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addedComponents(PlantComposite composite,
java.util.List<PlantComponent> added)
PlantComponents have been added to the PlantComposite.
|
java.lang.Object |
createViewCamera(EmbeddedView view)
Overrides the default view camera to set its initial location based on
the default position and orientation.
|
FlightCamera |
getFlightCamera()
Gets the flying camera associated with the plant view.
|
void |
registerControls()
Registers the
SimpleAppState 's customized controls with the
underlying SimpleAppState.app 's InputManager . |
void |
removedComponents(PlantComposite composite,
java.util.List<PlantComponent> removed)
PlantComponents have been removed the PlantComposite.
|
void |
resetCamera()
Resets the plant view's camera to its default position and orientation.
|
void |
setDefaultCameraOrientation(com.jme3.math.Vector3f direction,
com.jme3.math.Vector3f up)
Sets the default orientation of the view's camera.
|
void |
setDefaultCameraPosition(com.jme3.math.Vector3f position)
Sets the default position of the view's camera.
|
void |
setPlant(PlantComposite plant)
Sets the root PlantComponent that contains the pipes, junctions,
reactors, etc.
|
void |
setWireframe(boolean wireframe)
Sets all rendered plant components to be viewed as wireframes or as solid
objects.
|
void |
unregisterControls()
Unregisters the
SimpleAppState 's customized controls from
the underlying SimpleAppState.app 's InputManager . |
void |
update(float tpf) |
void |
update(IUpdateable component)
This operation notifies the listener that an update has occurred in the
Component.
|
cleanupAppState, createComposite, createHUD, disposeHUD, disposeViewCamera, exportImage, getCrosshairRay, getCursorRay, getCursorRayFromClick, getDisplayAxes, getDisplayHUD, getRootNode, getSceneRoot, setDisplayAxes, setDisplayHUD, start, start, stop, updateHUD, updateViewCamera, 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 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)
update
in interface com.jme3.app.state.AppState
update
in class SimpleAppState
public void addedComponents(PlantComposite composite, java.util.List<PlantComponent> added)
IPlantCompositeListener
addedComponents
in interface IPlantCompositeListener
composite
- The PlantComposite that has gained PlantComponents.added
- A list of the added PlantComponents.public void removedComponents(PlantComposite composite, java.util.List<PlantComponent> removed)
IPlantCompositeListener
removedComponents
in interface IPlantCompositeListener
composite
- The PlantComposite that has removed PlantComponents.removed
- A list of the removed PlantComponents.public void update(IUpdateable component)
IUpdateableListener
This operation notifies the listener that an update has occurred in the Component.
update
in interface IUpdateableListener
component
- The component that was updated in some way.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 setDefaultCameraPosition(com.jme3.math.Vector3f position)
position
- The new default position. If null, an exception is thrown.public void setDefaultCameraOrientation(com.jme3.math.Vector3f direction, com.jme3.math.Vector3f up)
direction
- The new default direction in which the camera will point. If
null, an exception is thrown.up
- The new default up direction. If null or if it is not
orthogonal to the camera direction, an exception is thrown.public void resetCamera()
public FlightCamera getFlightCamera()
public void setPlant(PlantComposite plant)
plant
- The new plant.public void setWireframe(boolean wireframe)
wireframe
- If true, plant components will be rendered with wireframes. If
false, they will be rendered solid.