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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClass
<? extends ComplexSpatialController> void
getControllerValues
(HashMap<String, Object> store) double
Returns the current maximum time for this controller.double
Returns the current minimum time of this controllerReturns the current repeat type of this controller.double
getSpeed()
boolean
isActive()
Returns if this Controller is active or not.boolean
boolean
boolean
void
read
(InputCapsule capsule) void
setActive
(boolean active) Sets the active flag of this controller.void
setControllerValues
(HashMap<String, Object> values) void
setMaxTime
(double maxTime) Sets the maximum time for this controllervoid
setMinTime
(double minTime) Sets the minimum time of this controllervoid
setRepeatType
(ComplexSpatialController.RepeatType repeatType) Sets the repeat type of this controller.void
setSpeed
(double speed) Sets the speed of this controllerabstract void
void
write
(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:
true
if therepeat type
isclamp
,false
otherwise.
-
isRepeatTypeWrap
public boolean isRepeatTypeWrap()- Returns:
true
if therepeat type
iswrap
,false
otherwise.
-
isRepeatTypeCycle
public boolean isRepeatTypeCycle()- Returns:
true
if therepeat type
iscycle
,false
otherwise.
-
update
- Specified by:
update
in 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:
write
in interfaceSavable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-
getClassTag
- Specified by:
getClassTag
in interfaceSavable
-
getControllerValues
-
setControllerValues
-