com.jme.input.controls.controller
Class ThrottleController
java.lang.Object
com.jme.scene.Controller
com.jme.input.controls.controller.ThrottleController
- All Implemented Interfaces:
- Savable, java.io.Serializable
public class ThrottleController
- extends Controller
ThrottleController manages forward and backward thrust on a Spatial
spatial - the object throttle is being applied to
forward - the GameControl that effects forward thrust
maxForwardThrottle - the maximum throttle that can be achieved in a
forward motion
reverse - the GameControl that effects reverse thrust
maxReverseThrottle - the maximum throttle that can be achieved in a
reverse motion
deadZone - the area on both sides of 0.0f that automatically gets
counted as 0.0f (for Joystick throttles with high sens.)
multiplier - the multiplier that defines how quickly maximum thrust
can be achieved
degradation - the multiplier that defines how quickly the thrust will
degrade back to zero
alwaysDegrade - if this is true, even when using a key/button to increase
throttle it will continually degrade toward 0.0f
axis - the axis on the spatial the throttle should be applied to
- Author:
- Matthew D. Hicks
- See Also:
- Serialized Form
Methods inherited from class com.jme.scene.Controller |
getClassTag, getControllerValues, getMaxTime, getMinTime, getRepeatType, getSpeed, isActive, read, setActive, setControllerValues, setMaxTime, setMinTime, setRepeatType, setSpeed, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThrottleController
public ThrottleController(Spatial spatial,
GameControl forward,
float maxForwardThrottle,
GameControl reverse,
float maxReverseThrottle,
float deadZone,
float multiplier,
float degradation,
boolean alwaysDegrade,
Axis axis)
getForward
public GameControl getForward()
getReverse
public GameControl getReverse()
getCurrentThrottle
public float getCurrentThrottle()
getThrust
public float getThrust()
update
public void update(float time)
- Description copied from class:
Controller
- Defined by extending classes,
update
is a signal to
Controller that it should update whatever object(s) it is controlling.
- Specified by:
update
in class Controller
- Parameters:
time
- The time in seconds between the last call to update and the
current one