Class ComplexSpatialController<T extends Spatial>
java.lang.Object
com.ardor3d.scenegraph.controller.ComplexSpatialController<T>
- All Implemented Interfaces:
SpatialController<T>,Savable,Serializable
- Direct Known Subclasses:
InterpolationController,KeyframeController,ParticleController
public abstract class ComplexSpatialController<T extends Spatial>
extends Object
implements SpatialController<T>, Serializable, Savable
ComplexSpatialController provides a base class for creation of controllers to modify nodes and render
states over time. The base controller provides a repeat type, min and max time, as well as speed. Subclasses of this
will provide the update method that takes the time between the last call and the current one and modifies an object
in a application specific way.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends ComplexSpatialController> voidgetControllerValues(HashMap<String, Object> store) doubleReturns the current maximum time for this controller.doubleReturns the current minimum time of this controllerReturns the current repeat type of this controller.doublegetSpeed()booleanisActive()Returns if this Controller is active or not.booleanbooleanbooleanvoidread(InputCapsule capsule) voidsetActive(boolean active) Sets the active flag of this controller.voidsetControllerValues(HashMap<String, Object> values) voidsetMaxTime(double maxTime) Sets the maximum time for this controllervoidsetMinTime(double minTime) Sets the minimum time of this controllervoidsetRepeatType(ComplexSpatialController.RepeatType repeatType) Sets the repeat type of this controller.voidsetSpeed(double speed) Sets the speed of this controllerabstract voidvoidwrite(OutputCapsule capsule)
-
Constructor Details
-
ComplexSpatialController
public ComplexSpatialController()
-
-
Method Details
-
getSpeed
public double getSpeed()- Returns:
- The speed of this controller. Speed is 1 by default.
-
setSpeed
public void setSpeed(double speed) Sets the speed of this controller- Parameters:
speed- The new speed
-
getMaxTime
public double getMaxTime()Returns the current maximum time for this controller.- Returns:
- This controller's maximum time.
-
setMaxTime
public void setMaxTime(double maxTime) Sets the maximum time for this controller- Parameters:
maxTime- The new maximum time
-
getMinTime
public double getMinTime()Returns the current minimum time of this controller- Returns:
- This controller's minimum time
-
setMinTime
public void setMinTime(double minTime) Sets the minimum time of this controller- Parameters:
minTime- The new minimum time.
-
getRepeatType
Returns the current repeat type of this controller.- Returns:
- The current repeat type
-
setRepeatType
Sets the repeat type of this controller. The default isComplexSpatialController.RepeatType.CLAMP.- Parameters:
repeatType- The new repeat type, can not benull.
-
setActive
public void setActive(boolean active) Sets the active flag of this controller. Note: updates on controllers are still called even if this flag is set to false. It is the responsibility of the extending class to check isActive if it wishes to be turn-off-able.- Parameters:
active- The new active state.
-
isActive
public boolean isActive()Returns if this Controller is active or not.- Returns:
- True if this controller is set to active, false if not.
-
isRepeatTypeClamp
public boolean isRepeatTypeClamp()- Returns:
trueif therepeat typeisclamp,falseotherwise.
-
isRepeatTypeWrap
public boolean isRepeatTypeWrap()- Returns:
trueif therepeat typeiswrap,falseotherwise.
-
isRepeatTypeCycle
public boolean isRepeatTypeCycle()- Returns:
trueif therepeat typeiscycle,falseotherwise.
-
update
- Specified by:
updatein interfaceSpatialController<T extends Spatial>- Parameters:
time- The time in seconds between the last call to update and the current onecaller- The spatial currently executing this controller.
-
write
- Specified by:
writein interfaceSavable- Throws:
IOException
-
read
- Specified by:
readin interfaceSavable- Throws:
IOException
-
getClassTag
- Specified by:
getClassTagin interfaceSavable
-
getControllerValues
-
setControllerValues
-