org.jagatoo.loaders.models.collada
Interface AnimatableModel

All Known Implementing Classes:
SkeletalController

public interface AnimatableModel

A COLLADA model. This interface should be implemented by the game engine, that wants to use JAGaToo for model loading. It contains mostly methods used for controlling animations.


Method Summary
 COLLADAAction getAction(java.lang.String id)
          Get a specific action
 java.util.HashMap<java.lang.String,COLLADAAction> getActions()
           
 ColladaProtoypeModel getPrototypeModel()
          Get the prototype model (Jagatoo side) used by this model (Game engine side).
 boolean hasActions()
           
 boolean isLooping()
           
 boolean isPlaying()
           
 int numActions()
           
 void pause()
          Pause the model (stop to play an animation).
 void play(COLLADAAction action, boolean loop)
          Begin to play a particular action, whatever the model was doing (we don't mind if it was paused or what..)
 void play(java.lang.String actionId, boolean loop)
          Begin to play a particular action, whatever the model was doing (we don't mind if it was paused or what..)
 void resume()
          Pause the model (stop to play an animation).
 

Method Detail

getPrototypeModel

ColladaProtoypeModel getPrototypeModel()
Get the prototype model (Jagatoo side) used by this model (Game engine side).

Returns:
the prototype model

hasActions

boolean hasActions()
Returns:
true if this model has skeletal animations (called "actions"), or false if it's a static model.

numActions

int numActions()
Returns:
the number of actions this model has, or 0 if it isn't animated at all (static model)

getActions

java.util.HashMap<java.lang.String,COLLADAAction> getActions()
Returns:
the map of all the actions thie model has, or null if this model isn't animated.

getAction

COLLADAAction getAction(java.lang.String id)
Get a specific action

Parameters:
id - The ID string of this action
Returns:
The action which has the specified ID string.

play

void play(COLLADAAction action,
          boolean loop)
Begin to play a particular action, whatever the model was doing (we don't mind if it was paused or what..)

Parameters:
action - The action to play
loop - true if we should loop the animation

play

void play(java.lang.String actionId,
          boolean loop)
Begin to play a particular action, whatever the model was doing (we don't mind if it was paused or what..)

Parameters:
actionId - The ID String of the action to play
loop - true if we should loop the animation

pause

void pause()
Pause the model (stop to play an animation). The model will remind which animation it was playing, and where it was in this animation, so that you can resume() whenever you want.


resume

void resume()
Pause the model (stop to play an animation). The model will remind which animation it was playing, and where it was in this animation, so that you can resume() whenever you want.


isPlaying

boolean isPlaying()
Returns:
true if the model is playing an animation, or false if the model isn't playing any animation, ex : - The model has no animation - No animation has been played since the model loading - The last played animation has been ended and it wasn't looped - The model has been paused manually (pause() method).

isLooping

boolean isLooping()
Returns:
true if the model is looping. It's the case if an animation has been played with the boolean argument "loop" set to "true"