public class MorphTrack extends java.lang.Object implements AnimTrack<float[]>
Modifier | Constructor and Description |
---|---|
protected |
MorphTrack()
Serialization-only.
|
|
MorphTrack(Geometry target,
float[] times,
float[] weights,
int nbMorphTargets)
Creates a morph track with the given Geometry as a target
|
Modifier and Type | Method and Description |
---|---|
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Implemented to perform deep cloning for this object, resolving
local cloned references using the specified cloner.
|
void |
getDataAtTime(double t,
float[] store)
Determine the track value for the specified time.
|
double |
getLength()
Determine the duration of the track.
|
int |
getNbMorphTargets() |
Geometry |
getTarget()
Access the target geometry.
|
float[] |
getTimes()
returns the arrays of time for this track
|
float[] |
getWeights()
return the array of weights of this track
|
java.lang.Object |
jmeClone()
Performs a regular shallow clone of the object.
|
void |
read(JmeImporter im)
De-serialize this track from the specified importer, for example when
loading from a J3O file.
|
void |
setFrameInterpolator(FrameInterpolator interpolator)
Replace the FrameInterpolator.
|
void |
setKeyframes(float[] times,
float[] weights)
Sets the times and weights for this morph track.
|
void |
setKeyframesWeight(float[] weights)
Set the weights for this morph track.
|
void |
setNbMorphTargets(float[] weights,
int nbMorphTargets)
Sets the number of morph targets and the corresponding weights.
|
void |
setTarget(Geometry target)
Replace the target geometry.
|
void |
setTimes(float[] times)
Sets the keyframes times for this Joint track
|
void |
write(JmeExporter ex)
Serialize this track to the specified exporter, for example when saving
to a J3O file.
|
protected MorphTrack()
public MorphTrack(Geometry target, float[] times, float[] weights, int nbMorphTargets)
target
- the desired target (alias created)times
- a float array with the time of each frame (alias created
-- do not modify after passing it to this constructor)weights
- the morphs for each frames (alias created -- do not
modify after passing it to this constructor)nbMorphTargets
- the desired number of morph targetspublic float[] getWeights()
public void setKeyframesWeight(float[] weights)
weights
- the weights of the morphs for each frame (alias created
-- do not modify after passing it to this setter)java.lang.IllegalStateException
- if this track does not have times setjava.lang.IllegalArgumentException
- if weights is an empty array or if
the number of weights violates the frame count constraintpublic float[] getTimes()
public void setTimes(float[] times)
times
- the keyframes times (alias created -- do not modify after
passing it to this setter)java.lang.IllegalArgumentException
- if times is emptypublic void setKeyframes(float[] times, float[] weights)
times
- a float array with the time of each frame (alias created
-- do not modify after passing it to this setter)weights
- the weights of the morphs for each frame (alias created
-- do not modify after passing it to this setter)public int getNbMorphTargets()
public void setNbMorphTargets(float[] weights, int nbMorphTargets)
weights
- the weights for each frame (alias created
-- do not modify after passing it to this setter)nbMorphTargets
- the desired number of morph targetsjava.lang.IllegalArgumentException
- if the number of weights and the new
number of morph targets violate the frame count constraintpublic double getLength()
AnimTrack
public void getDataAtTime(double t, float[] store)
AnimTrack
getDataAtTime
in interface AnimTrack<float[]>
t
- the track time (in seconds)store
- storage for the value (not null, modified)public void setFrameInterpolator(FrameInterpolator interpolator)
interpolator
- the interpolator to use (alias created)public Geometry getTarget()
public void setTarget(Geometry target)
target
- the Geometry to use as the target (alias created)public void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
public java.lang.Object jmeClone()
JmeCloneable
This method is separate from the regular clone() method so that objects might still maintain their own regular java clone() semantics (perhaps even using Cloner for those methods). However, because Java's clone() has specific features in the sense of Object's clone() implementation, it's usually best to have some path for subclasses to bypass the public clone() method that might be cloning fields and instead get at the superclass protected clone() methods. For example, through super.jmeClone() or another protected clone method that some base class eventually calls super.clone() in.
jmeClone
in interface JmeCloneable
public void cloneFields(Cloner cloner, java.lang.Object original)
JmeCloneable
Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.
cloneFields
in interface JmeCloneable
cloner
- The cloner that is performing the cloning operation. The
cloneFields method can call back into the cloner to make
clones of its subordinate fields.original
- The original object from which this object was cloned.
This is provided for the very rare case that this object needs
to refer to its original for some reason. In general, all of
the relevant values should have been transferred during the
shallow clone and this object need merely clone what it wants.