Class CurveLookAtController
java.lang.Object
com.ardor3d.scenegraph.controller.interpolation.CurveLookAtController
- All Implemented Interfaces:
SpatialController<Spatial>
,Serializable
public class CurveLookAtController
extends Object
implements SpatialController<Spatial>, Serializable
CurveLookAtController class rotates a spatial to 'look at' a curve.
This class assumes the given delegate curve interpolation controller is already added to a spatial and is getting automatically updated as part of the main loop. Therefore this class doesn't call update on the delegate controller.
- See Also:
-
Constructor Summary
ConstructorDescriptionCurveLookAtController
(CurveInterpolationController curveController) Creates a new instance ofCurveLookAtController
, withVector3.UNIT_Y
as the world up vector.CurveLookAtController
(CurveInterpolationController curveController, ReadOnlyVector3 worldUp) Creates a new instance ofCurveLookAtController
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
setLocalRotation
(boolean localRotation) void
setWorldUp
(ReadOnlyVector3 worldUp) void
-
Constructor Details
-
CurveLookAtController
Creates a new instance ofCurveLookAtController
, withVector3.UNIT_Y
as the world up vector.- Parameters:
curveController
- The curve interpolation controller that does the work of finding the correct position to look at, can not benull
.
-
CurveLookAtController
Creates a new instance ofCurveLookAtController
.- Parameters:
curveController
- The curve interpolation controller that does the work of finding the correct position to look at, can not benull
.worldUp
- The world up vector, can not benull
.
-
-
Method Details
-
update
- Specified by:
update
in interfaceSpatialController<Spatial>
- Parameters:
time
- The time in seconds between the last call to update and the current onecaller
- The spatial currently executing this controller.
-
setWorldUp
- Parameters:
worldUp
- The world up vector, can not benull
.
-
setLocalRotation
public void setLocalRotation(boolean localRotation) - Parameters:
localRotation
-true
to update local rotation,false
to update world rotation.- See Also:
-
isLocalRotation
public boolean isLocalRotation()- Returns:
true
if the local rotation is being updated,false
if the world rotation is.- See Also:
-