Package jme3utilities.ui
Class CameraOrbitAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
jme3utilities.NamedAppState
jme3utilities.SimpleAppState
jme3utilities.ui.AcorusAppState
jme3utilities.ui.CameraOrbitAppState
- All Implemented Interfaces:
com.jme3.app.state.AppState
An AppState to cause a camera to orbit a vertical axis.
-
Field Summary
Fields inherited from class jme3utilities.SimpleAppState
assetManager, cam, flyCam, guiNode, guiViewPort, inputManager, renderManager, rootNode, simpleApplication, stateManager, viewPort
Fields inherited from class com.jme3.app.state.AbstractAppState
initialized
-
Constructor Summary
ConstructorDescriptionCameraOrbitAppState
(com.jme3.renderer.Camera camera, String ccwSignalName, String cwSignalName) Instantiate an enabled AppState. -
Method Summary
Modifier and TypeMethodDescriptionDetermine the signal name for orbiting in the counter-clockwise (+Y) direction.jme3utilities.math.ReadXZ
center()
Determine the center location.Determine the signal name for orbiting in the clockwise (-Y) direction.float
rate()
Determine the rate of orbiting.void
setCenter
(jme3utilities.math.ReadXZ desiredCenter) Alter the center of the orbit.void
setRate
(float desiredRate) Alter the rate of orbiting.void
update
(float tpf) Callback invoked once per frame while the state is attached and enabled.Methods inherited from class jme3utilities.ui.AcorusAppState
getActionApplication, getSignals, getSpeed, initialize
Methods inherited from class jme3utilities.SimpleAppState
refreshCachedFields, render, stateDetached
Methods inherited from class jme3utilities.NamedAppState
cleanup, getInfluence, hasInfluenceOver, influence, isEnabled, isInitialized, postRender, setEnabled, stateAttached, stopInfluencing, toString
Methods inherited from class com.jme3.app.state.AbstractAppState
getId, setId
-
Field Details
-
logger
message logger for this class
-
-
Constructor Details
-
CameraOrbitAppState
public CameraOrbitAppState(com.jme3.renderer.Camera camera, String ccwSignalName, String cwSignalName) Instantiate an enabled AppState.- Parameters:
camera
- which camera to control (not null)ccwSignalName
- the signal name to orbit in the +Y direction (not null, not empty)cwSignalName
- the signal name to orbit in the -Y direction (not null, not empty)
-
-
Method Details
-
ccwSignalName
Determine the signal name for orbiting in the counter-clockwise (+Y) direction.- Returns:
- the name (not null, not empty)
-
center
public jme3utilities.math.ReadXZ center()Determine the center location.- Returns:
- a location vector (not null)
-
cwSignalName
Determine the signal name for orbiting in the clockwise (-Y) direction.- Returns:
- the name (not null, not empty)
-
rate
public float rate()Determine the rate of orbiting.- Returns:
- the angular rate (in radians/second, ≥0, default=1)
-
setCenter
public void setCenter(jme3utilities.math.ReadXZ desiredCenter) Alter the center of the orbit.- Parameters:
desiredCenter
- the desired center (in world coordinates, not null, default=0,0)
-
setRate
public void setRate(float desiredRate) Alter the rate of orbiting.- Parameters:
desiredRate
- the desired angular rate (in radians/second, ≥0)
-
update
public void update(float tpf) Callback invoked once per frame while the state is attached and enabled.- Specified by:
update
in interfacecom.jme3.app.state.AppState
- Overrides:
update
in classjme3utilities.NamedAppState
- Parameters:
tpf
- time interval between frames (in seconds, ≥0)
-