com.jmex.model.ogrexml.anim
Class MeshAnimationController

java.lang.Object
  extended by com.jme.scene.Controller
      extended by com.jmex.model.ogrexml.anim.MeshAnimationController
All Implemented Interfaces:
Savable, java.io.Serializable

public class MeshAnimationController
extends Controller
implements Savable

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jme.scene.Controller
RT_CLAMP, RT_CYCLE, RT_WRAP
 
Constructor Summary
MeshAnimationController()
          Used only for Saving/Loading models (all parameters of the non-default constructor are restored from the saved model, but the object must be constructed beforehand)
MeshAnimationController(OgreMesh[] meshes, MeshAnimationController sourceControl)
          Copy constructor.
MeshAnimationController(OgreMesh[] meshes, Skeleton skeleton, java.util.Map<java.lang.String,Animation> anims)
           
 
Method Summary
 java.lang.String getActiveAnimation()
           
 float getAnimationLength(java.lang.String name)
          Returns the length of the animation in seconds.
 java.util.Collection<java.lang.String> getAnimationNames()
           
 Bone getBone(java.lang.String name)
          Returns a bone with the specified name.
 float getCurTime()
           
 java.util.Collection<java.lang.String> getList()
          Deprecated. The name of this method incorrectly implies that a List is returned. Use the method getAnimationNames instead.
(package private)  OgreMesh[] getMeshList()
           
(package private)  Skeleton getSkeleton()
           
 boolean isHardwareSkinning()
           
 void read(JMEImporter e)
           
(package private)  void reset()
           
(package private)  void resetToBind()
           
 boolean setAnimation(java.lang.String name)
          Sets the currently active animation.
 void setCurTime(float time)
          Sets the time of the animation.
 void setFrameSkip(int framesToSkip)
          Enables frameskip LOD.
 void setTime(float time)
          Deprecated. Use setCurTime
 void update(float tpf)
          Defined by extending classes, update is a signal to Controller that it should update whatever object(s) it is controlling.
 void write(JMEExporter e)
           
 
Methods inherited from class com.jme.scene.Controller
getClassTag, getControllerValues, getMaxTime, getMinTime, getRepeatType, getSpeed, isActive, setActive, setControllerValues, setMaxTime, setMinTime, setRepeatType, setSpeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jme.util.export.Savable
getClassTag
 

Constructor Detail

MeshAnimationController

public MeshAnimationController(OgreMesh[] meshes,
                               Skeleton skeleton,
                               java.util.Map<java.lang.String,Animation> anims)

MeshAnimationController

public MeshAnimationController(OgreMesh[] meshes,
                               MeshAnimationController sourceControl)
Copy constructor. The mesh data has to be unique, and copied through OgreMesh.cloneFromMesh. The rest is handled automatically by this call.


MeshAnimationController

public MeshAnimationController()
Used only for Saving/Loading models (all parameters of the non-default constructor are restored from the saved model, but the object must be constructed beforehand)

Method Detail

getBone

public Bone getBone(java.lang.String name)
Returns a bone with the specified name. Use this method to gain access to the bone, to manually control it's transforms.


setAnimation

public boolean setAnimation(java.lang.String name)
Sets the currently active animation. Use the animation name "" to set the model into bind pose.


getAnimationLength

public float getAnimationLength(java.lang.String name)
Returns the length of the animation in seconds. Returns -1 if the animation is not defined.


getActiveAnimation

public java.lang.String getActiveAnimation()
Returns:
The name of the currently active animation

getList

@Deprecated
public java.util.Collection<java.lang.String> getList()
Deprecated. The name of this method incorrectly implies that a List is returned. Use the method getAnimationNames instead.

See Also:
getAnimationNames();

getAnimationNames

public java.util.Collection<java.lang.String> getAnimationNames()
Returns:
Collection of list of all animations that are defined

setFrameSkip

public void setFrameSkip(int framesToSkip)
Enables frameskip LOD. This technique is mostly only effective when software skinning is used.

Parameters:
framesToSkip - One frame will be played out of the framesToSkip number.

setTime

public void setTime(float time)
Deprecated. Use setCurTime

See Also:
setCurTime(float)

setCurTime

public void setCurTime(float time)
Sets the time of the animation. If it's greater than getAnimationLength(getActiveAnimation()), the time will be appropriately clamped/wraped depending on the repeatMode.


getSkeleton

Skeleton getSkeleton()

getMeshList

OgreMesh[] getMeshList()

reset

void reset()

resetToBind

void resetToBind()

isHardwareSkinning

public boolean isHardwareSkinning()
Returns:
True if hardware skinning will be used.

update

public void update(float tpf)
Description copied from class: Controller
Defined by extending classes, update is a signal to Controller that it should update whatever object(s) it is controlling.

Specified by:
update in class Controller
Parameters:
tpf - The time in seconds between the last call to update and the current one

getCurTime

public float getCurTime()

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class Controller
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class Controller
Throws:
java.io.IOException