|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.Controller
com.jme.curve.CurveController
public class CurveController
CurveController
defines a controller that moves a supplied
Spatial
object along a curve. Attributes of the curve are set
such as the up vector (if not set, the spacial object will roll along the
curve), the orientation precision defines how accurate the orientation of the
spatial will be.
Field Summary |
---|
Fields inherited from class com.jme.scene.Controller |
---|
RT_CLAMP, RT_CYCLE, RT_WRAP |
Constructor Summary | |
---|---|
CurveController(Curve curve,
Spatial mover)
Constructor instantiates a new CurveController object. |
|
CurveController(Curve curve,
Spatial mover,
float minTime,
float maxTime)
Constructor instantiates a new CurveController object. |
Method Summary | |
---|---|
boolean |
isAutoRotating()
isAutoRotating returns true if the object is rotating with
the curve and false if it is not. |
void |
read(JMEImporter e)
|
void |
reset()
|
void |
setAutoRotation(boolean value)
setAutoRotation determines if the object assigned to
the controller will rotate with the curve or just following the
curve. |
void |
setOrientationPrecision(float value)
setOrientationPrecision sets a precision value for the
spatials orientation. |
void |
setUpVector(Vector3f up)
setUpVector sets the locking vector for the spatials up
vector. |
void |
update(float time)
update moves a spatial along the given curve for along a
time period. |
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.scene.Controller |
---|
getClassTag, getControllerValues, getMaxTime, getMinTime, getRepeatType, getSpeed, isActive, setActive, setControllerValues, setMaxTime, setMinTime, setRepeatType, setSpeed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CurveController(Curve curve, Spatial mover)
CurveController
object.
The curve object that the controller operates on and the spatial object
that is moved is specified during construction.
curve
- the curve to operate on.mover
- the spatial to move.public CurveController(Curve curve, Spatial mover, float minTime, float maxTime)
CurveController
object.
The curve object that the controller operates on and the spatial object
that is moved is specified during construction. The game time to
start and the game time to finish is also supplied.
curve
- the curve to operate on.mover
- the spatial to move.minTime
- the time to start the controller.maxTime
- the time to end the controller.Method Detail |
---|
public void setUpVector(Vector3f up)
setUpVector
sets the locking vector for the spatials up
vector. This prevents rolling along the curve and allows for a better
tracking.
up
- the vector to lock as the spatials up vector.public void setOrientationPrecision(float value)
setOrientationPrecision
sets a precision value for the
spatials orientation. The smaller the number the higher the precision.
By default 0.1 is used, and typically does not require changing.
value
- the precision value of the spatial's orientation.public void setAutoRotation(boolean value)
setAutoRotation
determines if the object assigned to
the controller will rotate with the curve or just following the
curve.
value
- true if the object is to rotate with the curve, false
otherwise.public boolean isAutoRotating()
isAutoRotating
returns true if the object is rotating with
the curve and false if it is not.
public void update(float time)
update
moves a spatial along the given curve for along a
time period.
update
in class Controller
time
- The time in seconds between the last call to update and the
current oneController.update(float)
public void reset()
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class Controller
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class Controller
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |