Modifier | Constructor and Description |
---|---|
protected |
TransformTrack()
Serialization-only.
|
|
TransformTrack(HasLocalTransform target,
float[] times,
Vector3f[] translations,
Quaternion[] rotations,
Vector3f[] scales)
Creates a transform track for the given 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,
Transform transform)
Determine the track value for the specified time.
|
double |
getLength()
Determine the duration of the track.
|
Quaternion[] |
getRotations()
Copies the rotations.
|
Vector3f[] |
getScales()
Copies the scales.
|
HasLocalTransform |
getTarget()
Gives access to the target, which might be a Joint or a Spatial.
|
float[] |
getTimes()
Gives access to the keyframe times.
|
Vector3f[] |
getTranslations()
Copies the translations.
|
TransformTrack |
jmeClone()
Performs a regular shallow clone of the object.
|
void |
read(JmeImporter im)
De-serializes this track from the specified importer, for example when
loading from a J3O file.
|
void |
setFrameInterpolator(FrameInterpolator interpolator)
Replaces the frame interpolator.
|
void |
setKeyframes(float[] times,
Vector3f[] translations,
Quaternion[] rotations,
Vector3f[] scales)
Sets the translations, rotations, and/or scales.
|
void |
setKeyframesRotation(Quaternion[] rotations)
Sets the rotations.
|
void |
setKeyframesScale(Vector3f[] scales)
Sets the scales.
|
void |
setKeyframesTranslation(Vector3f[] translations)
Sets the translations.
|
void |
setTarget(HasLocalTransform target)
Replaces the target, which might be a Joint or a Spatial.
|
void |
setTimes(float[] times)
Sets the keyframe times.
|
void |
write(JmeExporter ex)
Serializes this track to the specified exporter, for example when
saving to a J3O file.
|
protected TransformTrack()
public TransformTrack(HasLocalTransform target, float[] times, Vector3f[] translations, Quaternion[] rotations, Vector3f[] scales)
target
- the target Joint or Spatial of the new tracktimes
- the time for each keyframe, or null for nonetranslations
- the translation of the target for each keyframe
(same length as times) or null for no translationrotations
- the rotation of the target for each keyframe
(same length as times) or null for no rotationscales
- the scale of the target for each keyframe
(same length as times) or null for no scalingpublic Quaternion[] getRotations()
public Vector3f[] getScales()
public float[] getTimes()
public Vector3f[] getTranslations()
public void setTimes(float[] times)
times
- the desired keyframe times (alias created, not null, not empty)public void setKeyframesTranslation(Vector3f[] translations)
translations
- the desired translation of the target for each
keyframe (not null, same length as "times")public void setKeyframesScale(Vector3f[] scales)
scales
- the desired scale of the target for each keyframe (not
null, same length as "times")public void setKeyframesRotation(Quaternion[] rotations)
rotations
- the desired rotation of the target for each keyframe
(not null, same length as "times")public void setKeyframes(float[] times, Vector3f[] translations, Quaternion[] rotations, Vector3f[] scales)
times
- the desired time for each keyframe,
or null to leave the times unchangedtranslations
- the desired translation of the target for each
keyframe (same length as times)
or null to leave the translations unchangedrotations
- the desired rotation of the target for each keyframe
(same length as times)
or null to leave the rotations unchangedscales
- the desired scale of the target for each keyframe
(same length as times)
or null to leave the scales unchangedpublic double getLength()
AnimTrack
public void getDataAtTime(double t, Transform transform)
AnimTrack
getDataAtTime
in interface AnimTrack<Transform>
t
- the track time (in seconds)transform
- storage for the value (not null, modified)public void setFrameInterpolator(FrameInterpolator interpolator)
interpolator
- the interpolator to use (alias created)public HasLocalTransform getTarget()
public void setTarget(HasLocalTransform target)
target
- the target to use (alias created)public void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
public TransformTrack 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 only clone what it wants.