Package jme3utilities.wes
Enum Class TweenVectors
- All Implemented Interfaces:
Serializable,Comparable<TweenVectors>,Constable
Enumerate and implement some interpolation techniques on time sequences of
Vector3f values.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionacyclic uniform Catmull-Rom cubic-spline interpolationacyclic centripetal Catmull-Rom cubic-spline interpolationacyclic finite-difference cubic-spline interpolationacyclic linear (Lerp) interpolationcyclic uniform Catmull-Rom cubic-spline interpolationcyclic centripetal Catmull-Rom cubic-spline interpolationcyclic finite-difference cubic-spline interpolationcyclic linear (Lerp) interpolation -
Method Summary
Modifier and TypeMethodDescriptioncom.jme3.math.Vector3fcubicSpline(float time, float[] times, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in an acyclic time sequence using cubic-spline interpolation.com.jme3.math.Vector3finterpolate(float time, float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in a time sequence using this technique.com.jme3.math.Vector3finterpolate(float time, VectorCurve curve, com.jme3.math.Vector3f storeResult) Interpolate among vectors in a time sequence using this technique and precomputed parameters.static com.jme3.math.Vector3flerp(float time, float[] times, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in an acyclic time sequence using linear (Lerp) interpolation.com.jme3.math.Vector3floopCubicSpline(float time, int last, float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in a cyclic time sequence using cubic-spline interpolation.static com.jme3.math.Vector3floopLerp(float time, int last, float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in a cyclic time sequence using linear (Lerp) interpolation.precompute(float[] times, float cycleTime, com.jme3.math.Vector3f[] samples) Precompute a curve from vectors in a time sequence.static TweenVectorsReturns the enum constant of this class with the specified name.static TweenVectors[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CatmullRomSpline
acyclic uniform Catmull-Rom cubic-spline interpolation -
CentripetalSpline
acyclic centripetal Catmull-Rom cubic-spline interpolation -
FdcSpline
acyclic finite-difference cubic-spline interpolation -
Lerp
acyclic linear (Lerp) interpolation -
LoopCatmullRomSpline
cyclic uniform Catmull-Rom cubic-spline interpolation -
LoopCentripetalSpline
cyclic centripetal Catmull-Rom cubic-spline interpolation -
LoopFdcSpline
cyclic finite-difference cubic-spline interpolation -
LoopLerp
cyclic linear (Lerp) interpolation
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
cubicSpline
public com.jme3.math.Vector3f cubicSpline(float time, float[] times, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in an acyclic time sequence using cubic-spline interpolation.- Parameters:
time- (≥times[0])times- (not null, unaffected, length>0, in strictly ascending order)samples- function values (not null, unaffected, same length as times)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated vector (either storeResult or a new instance)
-
interpolate
public com.jme3.math.Vector3f interpolate(float time, float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in a time sequence using this technique.- Parameters:
time- parameter valuetimes- (not null, unaffected, length>0, in strictly ascending order)cycleTime- end time for looping (≥times[last])samples- function values (not null, unaffected, same length as times)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated vector (either storeResult or a new instance)
-
interpolate
public com.jme3.math.Vector3f interpolate(float time, VectorCurve curve, com.jme3.math.Vector3f storeResult) Interpolate among vectors in a time sequence using this technique and precomputed parameters.- Parameters:
time- parameter valuecurve- curve parameters (not null, unaffected)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated vector (either storeResult or a new instance)
-
lerp
public static com.jme3.math.Vector3f lerp(float time, float[] times, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in an acyclic time sequence using linear (Lerp) interpolation. This is essentially what AnimControl uses to interpolate translations and scales in bone tracks.- Parameters:
time- parameter value (≥times[0])times- (not null, unaffected, length>0, in strictly ascending order)samples- function values (not null, unaffected, same length as times, each not null)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated vector (either storeResult or a new instance)
-
loopCubicSpline
public com.jme3.math.Vector3f loopCubicSpline(float time, int last, float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in a cyclic time sequence using cubic-spline interpolation.- Parameters:
time- parameter value (≥0, ≤cycleTime)last- (index of the last point, ≥1)times- (not null, unaffected, in strictly ascending order, times[0]==0)cycleTime- cycle time (>times[last])samples- function values (not null, unaffected)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated vector (either storeResult or a new instance)
-
loopLerp
public static com.jme3.math.Vector3f loopLerp(float time, int last, float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, com.jme3.math.Vector3f storeResult) Interpolate among vectors in a cyclic time sequence using linear (Lerp) interpolation.- Parameters:
time- parameter value (≥0, ≤cycleTime)last- (index of the last point, ≥1)times- (not null, unaffected, in strictly ascending order, times[0]==0)cycleTime- cycle time (>times[last])samples- function values (not null, unaffected, each not null)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated vector (either storeResult or a new instance)
-
precompute
Precompute a curve from vectors in a time sequence.- Parameters:
times- (not null, unaffected, length>0, in strictly ascending order)cycleTime- end time of loop (≥times[lastIndex])samples- function values (not null, unaffected, same length as times, each norm==1)- Returns:
- a new instance
-