|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunc.cdva.graphics.animations.Animation
public class Animation
Represents animations, and is used to actually display animations as well. Main job is to interpolate between key frames, thus an animation is defined as a base object, and a list of keyframes. Once an animation is started, it will go through all of it's keyframes, and will end after the last keyframe has been rendered.
Constructor Summary | |
---|---|
Animation()
Default constructor, data is uninitialized. |
|
Animation(java.lang.String name,
StaticListObject object,
java.util.Vector<KeyFrame> keyFrames,
boolean showBaseObject,
boolean repeat)
Animation constructor, inits an animation object. |
Method Summary | |
---|---|
void |
advanceInTime(long delta)
Advances the animation. |
Animation |
clone()
Returns a cloned copy of the animation. |
int |
getCurrentKeyFrame()
|
java.util.Vector<KeyFrame> |
getKeyFrames()
|
java.lang.String |
getName()
|
StaticListObject |
getObject()
|
long |
getRunningTime()
|
static long |
getSerialVersionUID()
|
javax.vecmath.Vector3f |
interpolateVector(long currentTime,
long nextTime,
javax.vecmath.Vector3f current,
javax.vecmath.Vector3f next)
Do the linear interpolation of a vector between two keyframes at time runningTime |
float |
interpolation(float a,
float b,
float c,
float fOfA,
float fOfB)
Linear interpolation method. |
boolean |
isRepeat()
|
boolean |
isRunning()
|
boolean |
isShowBaseObject()
|
void |
render(javax.media.opengl.GL gl)
Draws the animation. |
void |
setCurrentKeyFrame(int currentKeyFrame)
|
void |
setKeyFrames(java.util.Vector<KeyFrame> keyFrames)
|
void |
setName(java.lang.String name)
|
void |
setObject(StaticListObject object)
|
void |
setRepeat(boolean repeat)
|
void |
setRunningTime(long runningTime)
|
void |
setShowBaseObject(boolean showBaseObject)
|
void |
startAnimation()
Starts the animation. |
void |
stopAnimation()
Stops the animation. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Animation()
public Animation(java.lang.String name, StaticListObject object, java.util.Vector<KeyFrame> keyFrames, boolean showBaseObject, boolean repeat)
name
- the name to be given to the animation.object
- The object to be animated.keyFrames
- Keyframes that will be used to animate the
object.showBaseObject
- Whether the first key frame should be
shown or not.repeat
- If the animation is to be looped.Method Detail |
---|
public void startAnimation()
public void stopAnimation()
public boolean isRunning()
public void advanceInTime(long delta)
delta
- How long (in ms) to advance the rendering.public float interpolation(float a, float b, float c, float fOfA, float fOfB)
a
- current valueb
- next valuec
- value to interpolatefOfA
- resulting current valuefOfB
- resulting next value
public javax.vecmath.Vector3f interpolateVector(long currentTime, long nextTime, javax.vecmath.Vector3f current, javax.vecmath.Vector3f next)
currentTime
- time index of the current keyframenextTime
- time index of the nex keyframecurrent
- current vectornext
- next vector
public void render(javax.media.opengl.GL gl)
gl
- A gl object to be drawn to.public Animation clone()
clone
in class java.lang.Object
public boolean isShowBaseObject()
public void setShowBaseObject(boolean showBaseObject)
showBaseObject
- The showBaseModel to set.public static long getSerialVersionUID()
public int getCurrentKeyFrame()
public java.util.Vector<KeyFrame> getKeyFrames()
public StaticListObject getObject()
public boolean isRepeat()
public long getRunningTime()
public void setCurrentKeyFrame(int currentKeyFrame)
currentKeyFrame
- the currentKeyFrame to setpublic void setKeyFrames(java.util.Vector<KeyFrame> keyFrames)
keyFrames
- the keyFrames to setpublic void setObject(StaticListObject object)
object
- the object to setpublic void setRepeat(boolean repeat)
repeat
- the repeat to setpublic void setRunningTime(long runningTime)
runningTime
- the runningTime to setpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |