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:
  • 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

      public ComplexSpatialController.RepeatType getRepeatType()
      Returns the current repeat type of this controller.
      Returns:
      The current repeat type
    • setRepeatType

      public void setRepeatType(ComplexSpatialController.RepeatType repeatType)
      Sets the repeat type of this controller. The default is ComplexSpatialController.RepeatType.CLAMP.
      Parameters:
      repeatType - The new repeat type, can not be null.
    • 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 the repeat type is clamp, false otherwise.
    • isRepeatTypeWrap

      public boolean isRepeatTypeWrap()
      Returns:
      true if the repeat type is wrap, false otherwise.
    • isRepeatTypeCycle

      public boolean isRepeatTypeCycle()
      Returns:
      true if the repeat type is cycle, false otherwise.
    • update

      public abstract void update(double time, T caller)
      Specified by:
      update in interface SpatialController<T extends Spatial>
      Parameters:
      time - The time in seconds between the last call to update and the current one
      caller - The spatial currently executing this controller.
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Throws:
      IOException
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Throws:
      IOException
    • getClassTag

      public Class<? extends ComplexSpatialController> getClassTag()
      Specified by:
      getClassTag in interface Savable
    • getControllerValues

      public void getControllerValues(HashMap<String,Object> store)
    • setControllerValues

      public void setControllerValues(HashMap<String,Object> values)