com.md5importer.interfaces.control
Interface IBlendController

All Superinterfaces:
IController
All Known Implementing Classes:
BlendController

public interface IBlendController
extends IController

IBlendController defines the interface of a logic control unit that is responsible for blending its maintained IMD5Node from its current skeleton position to the first frame of the given target IMD5Anim.

IBlendController requires external invocations to perform the update operation that blends maintained node toward the given animation.

IBlendController takes in an IMD5Anim to blend to, the IController that controls the given target animation and a blend duration. It internally sets the given animation as the active animation for the node and deactivates the animation controller to prevent the node being updated by the animation during the blending process. It then activates the controller back up again after the process is completed.

IBlendController does not operate on the previous active animation of the maintained node. However, it is advised to deactivate the IMD5AnimController of the previous active animation to save CPU time if the animation is not shared by other IMD5Node instances.

IBlendController uses ReentrantLock to provide thread safety on the blend method. This prevents the recording of the current skeleton position before blending produce incorrect information. The same lock is also used for the update method to prevent interleave thread invocations when the data is being recorded. However, it is advised to only invoke update method within a single thread.


Method Summary
 void blend(IMD5Anim anim, IMD5AnimController animController, float duration)
          Blend the maintained node from its current skeleton position to the first frame of the given animation in given duration.
 
Methods inherited from interface com.md5importer.interfaces.control.IController
isActive, setActive, update
 

Method Detail

blend

void blend(IMD5Anim anim,
           IMD5AnimController animController,
           float duration)
Blend the maintained node from its current skeleton position to the first frame of the given animation in given duration.

Parameters:
anim - The IMD5Anim to blend to.
animController - The IMD5AnimController of the target animation.
duration - The Float blending duration.