Package jme3utilities.wes
Class TweenTransforms
- java.lang.Object
-
- jme3utilities.wes.TweenTransforms
-
- All Implemented Interfaces:
java.lang.Cloneable
public class TweenTransforms extends java.lang.Object implements java.lang.CloneableTweening techniques for time sequences of JME transforms.
-
-
Constructor Summary
Constructors Constructor Description TweenTransforms()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TweenTransformsclone()Create a deep copy of this object.TweenRotationsgetTweenRotations()Read the technique for rotations.TweenVectorsgetTweenScales()Read the technique for scales.TweenVectorsgetTweenTranslations()Read the technique for translations.com.jme3.math.Transforminterpolate(float time, float[] times, float duration, com.jme3.math.Vector3f[] translations, com.jme3.math.Quaternion[] rotations, com.jme3.math.Vector3f[] scales, com.jme3.math.Transform fallback, com.jme3.math.Transform storeResult)Interpolate between keyframes using these techniques.com.jme3.math.Transforminterpolate(float time, com.jme3.anim.TransformTrack track, float duration, com.jme3.math.Transform storeResult)Interpolate between keyframes in a TransformTrack using these techniques.com.jme3.math.Transforminterpolate(float time, com.jme3.animation.Track track, float duration, com.jme3.math.Transform fallback, com.jme3.math.Transform storeResult)Interpolate between keyframes in a bone/spatial track using these techniques.com.jme3.animation.Trackresample(com.jme3.animation.Track oldTrack, float[] newTimes, float duration)Copy a bone/spatial track, resampling at the specified times using these techniques.com.jme3.animation.TrackresampleAtRate(com.jme3.animation.Track oldTrack, float sampleRate, float duration)Copy a bone/spatial track, resampling it at the specified rate using these techniques.com.jme3.animation.TrackresampleToNumber(com.jme3.animation.Track oldTrack, int numSamples, float duration)Copy a bone/spatial track, resampling to the specified number of samples using these techniques.voidsetTweenRotations(TweenRotations newTechnique)Alter the technique for rotations.voidsetTweenScales(TweenVectors newTechnique)Alter the technique for scales.voidsetTweenTranslations(TweenVectors newTechnique)Alter the technique for translations.com.jme3.math.Transformtransform(com.jme3.animation.Track track, float time, float duration, com.jme3.math.Transform fallback, com.jme3.math.Transform storeResult)Calculate the transform for the specified time and bone/spatial track using these techniques.
-
-
-
Method Detail
-
getTweenRotations
public TweenRotations getTweenRotations()
Read the technique for rotations.- Returns:
- enum (not null)
-
getTweenScales
public TweenVectors getTweenScales()
Read the technique for scales.- Returns:
- enum (not null)
-
getTweenTranslations
public TweenVectors getTweenTranslations()
Read the technique for translations.- Returns:
- enum (not null)
-
interpolate
public com.jme3.math.Transform interpolate(float time, com.jme3.animation.Track track, float duration, com.jme3.math.Transform fallback, com.jme3.math.Transform storeResult)Interpolate between keyframes in a bone/spatial track using these techniques.- Parameters:
time- (in seconds, ≥0, ≤duration)track- input bone/spatial track (not null, unaffected)duration- animation duration (in seconds, >0)fallback- values to use for missing track data (may be null, unaffected)storeResult- storage for the result (modified if not null)- Returns:
- transform (either storeResult or a new instance)
-
interpolate
public com.jme3.math.Transform interpolate(float time, com.jme3.anim.TransformTrack track, float duration, com.jme3.math.Transform storeResult)Interpolate between keyframes in a TransformTrack using these techniques.- Parameters:
time- (in seconds)track- the input track (not null, unaffected)duration- the animation-clip duration (in seconds) NOT the track duration!storeResult- storage for the result (modified if not null)- Returns:
- the transform (either storeResult or a new instance)
-
interpolate
public com.jme3.math.Transform interpolate(float time, float[] times, float duration, com.jme3.math.Vector3f[] translations, com.jme3.math.Quaternion[] rotations, com.jme3.math.Vector3f[] scales, com.jme3.math.Transform fallback, com.jme3.math.Transform storeResult)Interpolate between keyframes using these techniques.- Parameters:
time- (in seconds, ≥0, ≤duration)times- keyframe times (in seconds, not null, unaffected)duration- animation duration (in seconds, >0)translations- (may be null, unaffected, same length as times)rotations- (may be null, unaffected, same length as times)scales- (may be null, unaffected, same length as times)fallback- values to use for missing track data (may be null, unaffected)storeResult- storage for the result (modified if not null)- Returns:
- transform (either storeResult or a new instance)
-
resample
public com.jme3.animation.Track resample(com.jme3.animation.Track oldTrack, float[] newTimes, float duration)Copy a bone/spatial track, resampling at the specified times using these techniques.- Parameters:
oldTrack- input bone/spatial track (not null, unaffected)newTimes- sample times (not null, alias created)duration- animation duration (in seconds, ≥0)- Returns:
- a new instance
-
resampleAtRate
public com.jme3.animation.Track resampleAtRate(com.jme3.animation.Track oldTrack, float sampleRate, float duration)Copy a bone/spatial track, resampling it at the specified rate using these techniques.- Parameters:
oldTrack- input bone/spatial track (not null, unaffected)sampleRate- sample rate (in frames per second, >0)duration- animation duration (in seconds, ≥0)- Returns:
- a new instance
-
resampleToNumber
public com.jme3.animation.Track resampleToNumber(com.jme3.animation.Track oldTrack, int numSamples, float duration)Copy a bone/spatial track, resampling to the specified number of samples using these techniques.- Parameters:
oldTrack- input bone/spatial track (not null, unaffected)numSamples- number of samples (≥2)duration- animation duration (in seconds, >0)- Returns:
- a new instance
-
setTweenRotations
public void setTweenRotations(TweenRotations newTechnique)
Alter the technique for rotations.- Parameters:
newTechnique- (not null)
-
setTweenScales
public void setTweenScales(TweenVectors newTechnique)
Alter the technique for scales.- Parameters:
newTechnique- (not null)
-
setTweenTranslations
public void setTweenTranslations(TweenVectors newTechnique)
Alter the technique for translations.- Parameters:
newTechnique- (not null)
-
transform
public com.jme3.math.Transform transform(com.jme3.animation.Track track, float time, float duration, com.jme3.math.Transform fallback, com.jme3.math.Transform storeResult)Calculate the transform for the specified time and bone/spatial track using these techniques.- Parameters:
track- input bone/spatial track (not null, unaffected)time- animation time input (in seconds)duration- (in seconds)fallback- values to use for missing track data (may be null, unaffected)storeResult- storage for the result (modified if not null)- Returns:
- a transform (either storeResult or a new instance)
-
clone
public TweenTransforms clone() throws java.lang.CloneNotSupportedException
Create a deep copy of this object.- Overrides:
clonein classjava.lang.Object- Returns:
- a new object, equivalent to this one
- Throws:
java.lang.CloneNotSupportedException- if superclass isn't cloneable
-
-