com.md5importer.interfaces.control
Interface IMD5AnimController

All Superinterfaces:
IController
All Known Implementing Classes:
MD5AnimController

public interface IMD5AnimController
extends IController

IMD5AnimController defines the interface of a logic controller unit that is responsible for updating the given IMD5Anim instance based on given time interpolation.

IMD5AnimController contains the logic to update the frame indices of a IMD5Anim given at construction time. It updates the next and previous frame indices based on the given frame time interpolation value, the repeat type and the speed value of the controller.

IMD5AnimController requires external invocations to the update method to perform animation update operation. This operation updates the maintained animation.

IMD5AnimController only provides primitive thread safety. It guarantees the memory visibility of the most recent set operation results on both update and retrieval methods. However, there is no actual locking performed to allow maximum concurrency. This implies that the update method has to be confined within a single updating thread. In reality, it does not make any sense to update the same animation with multiple threads anyways.


Method Summary
 IMD5Anim getAnim()
          Retrieve the animation this controller controls.
 ERepeatType getRepeatType()
          Retrieve the current repeat type.
 boolean isBackward()
          Check if this animation is being played backward.
 boolean isCyleComplete()
          Check if one cycle of this animation is complete, but the new one has not yet started.
 void reset()
          Reset the controller by resetting the accumulated time to zero and resetting the animation to the first frame.
 void setRepeatType(ERepeatType type)
          Set the repeat type of this controller.
 void setSpeed(float speed)
          Set the speed of this controller.
 
Methods inherited from interface com.md5importer.interfaces.control.IController
isActive, setActive, update
 

Method Detail

setRepeatType

void setRepeatType(ERepeatType type)
Set the repeat type of this controller.

Parameters:
type - The ERepeatType value.

setSpeed

void setSpeed(float speed)
Set the speed of this controller.

Parameters:
speed - The Float speed.

getRepeatType

ERepeatType getRepeatType()
Retrieve the current repeat type.

Returns:
The ERepeatType enumeration.

getAnim

IMD5Anim getAnim()
Retrieve the animation this controller controls.

Returns:
The controlled IMD5Anim.

reset

void reset()
Reset the controller by resetting the accumulated time to zero and resetting the animation to the first frame.


isBackward

boolean isBackward()
Check if this animation is being played backward.

Returns:
True if the animation is being played backward. False forward.

isCyleComplete

boolean isCyleComplete()
Check if one cycle of this animation is complete, but the new one has not yet started.

Returns:
True if one cycle is complete. False otherwise.