unc.cdva.graphics.models
Class AnimatedObject

java.lang.Object
  extended by unc.cdva.graphics.models.AnimatedObject
All Implemented Interfaces:
Object3D

public class AnimatedObject
extends java.lang.Object
implements Object3D

Represents an object that possesses multiple animations composed of another texture/model couple and of keyframes. You start the animation by setting currentAnimation to the name of the animation, and then the animation will be displayed and updated every time the object is displayed on the screen

Author:
Guillaume Conte

Constructor Summary
AnimatedObject(StaticListObject baseObject, java.util.Hashtable<java.lang.String,Animation> animations)
          Inits an animated object
 
Method Summary
 Object3D clone()
          Clone the object (copy all the attributes)
 java.util.Hashtable<java.lang.String,Animation> getAnimations()
           
 StaticListObject getBaseObject()
           
 java.lang.String getCurrentAnimation()
           
 boolean isAnimationRunning()
           
 void render(javax.media.opengl.GL gl)
          Render an object.
 void setAnimations(java.util.Hashtable<java.lang.String,Animation> animations)
           
 void setBaseObject(StaticListObject baseObject)
           
 void setCurrentAnimation(java.lang.String animationName)
          Set and start an animation.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnimatedObject

public AnimatedObject(StaticListObject baseObject,
                      java.util.Hashtable<java.lang.String,Animation> animations)
Inits an animated object

Parameters:
baseObject - base object
animations - corresponding animations
Method Detail

setCurrentAnimation

public void setCurrentAnimation(java.lang.String animationName)
Set and start an animation. Set it to "" to stop an animation.

Parameters:
animationName - name of the animation

render

public void render(javax.media.opengl.GL gl)
Description copied from interface: Object3D
Render an object. By default the object is rendered in the first opengl basis. The transformations are performed in the rendering engine according to the data stored in the corresponding interactive item

Specified by:
render in interface Object3D
Parameters:
gl - gl context
See Also:
Object3D.render(GL)

clone

public Object3D clone()
Description copied from interface: Object3D
Clone the object (copy all the attributes)

Specified by:
clone in interface Object3D
Overrides:
clone in class java.lang.Object
Returns:
cloned object
See Also:
Object3D.clone()

getAnimations

public java.util.Hashtable<java.lang.String,Animation> getAnimations()
Returns:
the animations

getBaseObject

public StaticListObject getBaseObject()
Returns:
the baseObject

getCurrentAnimation

public java.lang.String getCurrentAnimation()
Returns:
the currentAnimation

setAnimations

public void setAnimations(java.util.Hashtable<java.lang.String,Animation> animations)
Parameters:
animations - the animations to set

setBaseObject

public void setBaseObject(StaticListObject baseObject)
Parameters:
baseObject - the baseObject to set

isAnimationRunning

public boolean isAnimationRunning()
Returns:
true if the animation is running