com.md5importer.interfaces.model
Interface IMD5Anim

All Superinterfaces:
IObservable, com.jme.util.export.Savable
All Known Implementing Classes:
MD5Anim

public interface IMD5Anim
extends IObservable, com.jme.util.export.Savable

IMD5Anim defines the interface of a data structure that represents a completely loaded MD5 animation unit. It internally utilizes IFrame instances to actually maintain the joint position data.

IMD5Anim operates on the previous and next frame indices set by external controller unit. It provide various retrieval methods related to frames based on current set indices.

IMD5Anim is defined as an observable unit that can be monitored by various IObserver instances. These observers should be notified when the frame indices of the animation are modified through the setIndices method. This implies that the notifyUpdate method should be invoked after the indices have been set completely in an update cycle.

IMD5Anim uses ReentrantLock to guard setIndices and all the frame related retrieval methods to guarantees the compound action for setting the next and previous frame indices is performed atomically.


Method Summary
 IMD5Anim clone()
          Clone this animation.
 float getAnimationTime()
          Retrieve the total time of a complete cycle of this animation.
 int getFrameCount()
          Retrieve the total number of frames.
 java.lang.String[] getJointIDs()
          Retrieve the IDs of joints of this animation.
 java.lang.String getName()
          Retrieve the name of this animation.
 IFrame getNextFrame()
          Retrieve the next frame.
 int getNextIndex()
          Retrieve the next frame index number.
 float getNextTime()
          Retrieve the starting time of the next frame.
 float getPercentage()
          Get the complete percentage of the current cycle.
 IFrame getPreviousFrame()
          Retrieve the previous frame.
 int getPreviousIndex()
          Retrieve the previous frame index number.
 float getPreviousTime()
          Retrieve the starting time of the previous frame.
 float getTime()
          Retrieve the elapsed time since last frame change.
 void setIndices(int prev, int next, float time)
          Set the frame indices with given values.
 
Methods inherited from interface com.md5importer.interfaces.IObservable
notifyUpdate, register, unregister
 
Methods inherited from interface com.jme.util.export.Savable
getClassTag, read, write
 

Method Detail

setIndices

void setIndices(int prev,
                int next,
                float time)
Set the frame indices with given values. The given values are automatically clamped between 0 and the last frame index.

Parameters:
prev - The Integer previous frame index.
next - The Integer next frame index.
time - The The Float elapsed time since last set.

getAnimationTime

float getAnimationTime()
Retrieve the total time of a complete cycle of this animation.

Returns:
The Float complete cycle time.

getFrameCount

int getFrameCount()
Retrieve the total number of frames.

Returns:
The Integer number of frames.

getPercentage

float getPercentage()
Get the complete percentage of the current cycle.

Returns:
The Float percentage value.

getPreviousFrame

IFrame getPreviousFrame()
Retrieve the previous frame.

Returns:
The previous IFrame.

getPreviousIndex

int getPreviousIndex()
Retrieve the previous frame index number.

Returns:
The Integer index number.

getPreviousTime

float getPreviousTime()
Retrieve the starting time of the previous frame.

Returns:
The Float starting time.

getNextFrame

IFrame getNextFrame()
Retrieve the next frame.

Returns:
The next IFrame.

getNextIndex

int getNextIndex()
Retrieve the next frame index number.

Returns:
The Integer index number.

getNextTime

float getNextTime()
Retrieve the starting time of the next frame.

Returns:
The Float starting time.

getJointIDs

java.lang.String[] getJointIDs()
Retrieve the IDs of joints of this animation.

Returns:
The array of String IDs.

getName

java.lang.String getName()
Retrieve the name of this animation.

Returns:
The String name.

getTime

float getTime()
Retrieve the elapsed time since last frame change.

Returns:
The Float time value.

clone

IMD5Anim clone()
Clone this animation.

Returns:
The cloned IMD5Anim instance.