Package jme3utilities.wes
Enum TweenVectors
- java.lang.Object
-
- java.lang.Enum<TweenVectors>
-
- jme3utilities.wes.TweenVectors
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TweenVectors>
public enum TweenVectors extends java.lang.Enum<TweenVectors>
Enumerate and implement some interpolation techniques on time sequences of Vector3f values.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CatmullRomSplineacyclic uniform Catmull-Rom cubic-spline interpolationCentripetalSplineacyclic centripetal Catmull-Rom cubic-spline interpolationFdcSplineacyclic finite-difference cubic-spline interpolationLerpacyclic linear (Lerp) interpolationLoopCatmullRomSplinecyclic uniform Catmull-Rom cubic-spline interpolationLoopCentripetalSplinecyclic centripetal Catmull-Rom cubic-spline interpolationLoopFdcSplinecyclic finite-difference cubic-spline interpolationLoopLerpcyclic linear (Lerp) interpolation
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.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.VectorCurveprecompute(float[] times, float cycleTime, com.jme3.math.Vector3f[] samples)Precompute a curve from vectors in a time sequence.static TweenVectorsvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static TweenVectors[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CatmullRomSpline
public static final TweenVectors CatmullRomSpline
acyclic uniform Catmull-Rom cubic-spline interpolation
-
CentripetalSpline
public static final TweenVectors CentripetalSpline
acyclic centripetal Catmull-Rom cubic-spline interpolation
-
FdcSpline
public static final TweenVectors FdcSpline
acyclic finite-difference cubic-spline interpolation
-
Lerp
public static final TweenVectors Lerp
acyclic linear (Lerp) interpolation
-
LoopCatmullRomSpline
public static final TweenVectors LoopCatmullRomSpline
cyclic uniform Catmull-Rom cubic-spline interpolation
-
LoopCentripetalSpline
public static final TweenVectors LoopCentripetalSpline
cyclic centripetal Catmull-Rom cubic-spline interpolation
-
LoopFdcSpline
public static final TweenVectors LoopFdcSpline
cyclic finite-difference cubic-spline interpolation
-
LoopLerp
public static final TweenVectors LoopLerp
cyclic linear (Lerp) interpolation
-
-
Method Detail
-
values
public static TweenVectors[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TweenVectors c : TweenVectors.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TweenVectors valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- 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
public VectorCurve precompute(float[] times, float cycleTime, com.jme3.math.Vector3f[] samples)
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
-
-