public final class Animation
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
KEYFRAMESONLY
Use no interpolation between keyframes.
|
static int |
LINEAR
Use linear interpolation between keyframes.
|
static int |
USE_CLAMPING
Use clamping when the interpolation reaches the end of a sub-sequence.
|
static int |
USE_WRAPPING
Use wrapping when the interpolation reaches the end of a sub-sequence.
|
Constructor and Description |
---|
Animation(int keyframeCount)
Creates a new animation sequence that consist of keyframeCount keyframes.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyFrame(Mesh keyFrame)
Add a keyframe to a animation sequence.
|
int |
createSubSequence(java.lang.String name)
Creates a new sub-sequence.
|
Mesh[] |
getKeyFrames()
Returns the key frames of an animation as an array of Mesh.
|
java.lang.String |
getName(int seq)
Returns the name of a sequence.
|
int |
getSequence(java.lang.String name)
Returns a sequence index for a given name.
|
int[] |
getSequenceBorders(int seq)
Gets the position of the start and the end frame of a sequence.
|
int |
getSequenceCount()
Returns the number of sequences used.
|
void |
remove(int seq)
Removes data of a sequence from an animation.
|
void |
setCaching(boolean usesCache)
If enabled, animations will be processed faster, you'll get a higher
frame rate.
|
void |
setClampingMode(int mode)
Sets the clamping mode for animations.
|
void |
setInterpolationMethod(int method)
Sets the method that should be used to interpolate vertices between
keyframes.
|
void |
strip()
Removes triangle information from this animation's meshes.
|
public static final int LINEAR
public static final int KEYFRAMESONLY
public static final int USE_WRAPPING
public static final int USE_CLAMPING
public Animation(int keyframeCount)
keyframeCount
- the number of keyframes for this animationpublic void setCaching(boolean usesCache)
usesCache
- should we?public void strip()
public void remove(int seq)
seq
- the sequencepublic java.lang.String getName(int seq)
seq
- a sequencepublic int[] getSequenceBorders(int seq)
seq
- the sequencepublic int getSequence(java.lang.String name)
name
- the sequence's namepublic Mesh[] getKeyFrames()
public int createSubSequence(java.lang.String name)
name
- the name of this sequencepublic int getSequenceCount()
public void setClampingMode(int mode)
mode
- the clamping modeUSE_WRAPPING
,
USE_CLAMPING
public void addKeyFrame(Mesh keyFrame)
keyFrame
- the mesh of this keyframeObject3D.calcBoundingBox()
,
Object3D.getMesh()
,
Object3D.calcNormals()
,
Mesh.cloneMesh(boolean)
public void setInterpolationMethod(int method)
method
- the methodLINEAR
,
KEYFRAMESONLY