Package jme3utilities.wes
Enum Class TweenRotations
- All Implemented Interfaces:
Serializable,Comparable<TweenRotations>,Constable
Enumerate and implement some interpolation techniques on time sequences of
unit quaternions.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptioncyclic normalized linear (Nlerp) interpolationcyclic spherical linear (Slerp) or "great arc" interpolation using shortcutscyclic spherical linear (Slerp) or "great arc" interpolationcyclic cubic-spline interpolation based on the Squad functionacyclic normalized linear (Nlerp) interpolationacyclic spherical linear (Slerp) or "great arc" interpolation using shortcutsacyclic spherical linear (Slerp) or "great arc" interpolationacyclic cubic-spline interpolation based on the Squad function -
Method Summary
Modifier and TypeMethodDescriptioncom.jme3.math.Quaternioninterpolate(float time, float[] times, float cycleTime, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in a time sequence using this technique.com.jme3.math.Quaternioninterpolate(float time, RotationCurve curve, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in a time sequence using this technique and some precomputed parameters.com.jme3.math.Quaternionlerp(float time, float[] times, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in an acyclic time sequence using linear (Nlerp/Slerp) interpolation.com.jme3.math.QuaternionloopLerp(float time, int lastIndex, float[] times, float cycleTime, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in a cyclic time sequence using linear (Nlerp/Slerp) interpolation.static com.jme3.math.QuaternionloopSpline(float time, int lastIndex, float[] times, float cycleTime, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in a cyclic time sequence using cubic-spline interpolation based on the Squad function.precompute(float[] times, float cycleTime, com.jme3.math.Quaternion[] samples) Generate a rotation curve.static com.jme3.math.Quaternionspline(float time, float[] times, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in an acyclic time sequence using cubic-spline interpolation based on the Squad function.static TweenRotationsReturns the enum constant of this class with the specified name.static TweenRotations[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LoopNlerp
cyclic normalized linear (Nlerp) interpolation -
LoopQuickSlerp
cyclic spherical linear (Slerp) or "great arc" interpolation using shortcuts -
LoopSlerp
cyclic spherical linear (Slerp) or "great arc" interpolation -
LoopSpline
cyclic cubic-spline interpolation based on the Squad function -
Nlerp
acyclic normalized linear (Nlerp) interpolation -
QuickSlerp
acyclic spherical linear (Slerp) or "great arc" interpolation using shortcuts -
Slerp
acyclic spherical linear (Slerp) or "great arc" interpolation -
Spline
acyclic cubic-spline interpolation based on the Squad function
-
-
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
-
interpolate
public com.jme3.math.Quaternion interpolate(float time, float[] times, float cycleTime, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions 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[lastIndex])samples- function values (not null, unaffected, same length as times, each norm=1)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated unit quaternion (either storeResult or a new instance)
-
interpolate
public com.jme3.math.Quaternion interpolate(float time, RotationCurve curve, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in a time sequence using this technique and some precomputed parameters.- Parameters:
time- parameter valuecurve- curve parameters (not null, unaffected)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated unit quaternion (either storeResult or a new instance)
-
lerp
public com.jme3.math.Quaternion lerp(float time, float[] times, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in an acyclic time sequence using linear (Nlerp/Slerp) interpolation. Nlerp is essentially what AnimControl uses to interpolate rotations 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 norm=1)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated unit quaternion (either storeResult or a new instance)
-
loopLerp
public com.jme3.math.Quaternion loopLerp(float time, int lastIndex, float[] times, float cycleTime, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in a cyclic time sequence using linear (Nlerp/Slerp) interpolation.- Parameters:
time- parameter value (≥0, ≤cycleTime)lastIndex- (index of the last point to use, ≥1)times- (not null, unaffected, in strictly ascending order, times[0]==0)cycleTime- cycle time (>times[lastIndex])samples- function values (not null, unaffected, each norm=1)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated unit quaternion (either storeResult or a new instance)
-
loopSpline
public static com.jme3.math.Quaternion loopSpline(float time, int lastIndex, float[] times, float cycleTime, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in a cyclic time sequence using cubic-spline interpolation based on the Squad function.- Parameters:
time- parameter value (≥0, ≤cycleTime)lastIndex- (index of the last point to use, ≥1)times- (not null, unaffected, in strictly ascending order, times[0]==0)cycleTime- cycle time (>times[lastIndex])samples- function values (not null, unaffected, each norm=1)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated unit quaternion (either storeResult or a new instance)
-
precompute
Generate a rotation curve.- 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
-
spline
public static com.jme3.math.Quaternion spline(float time, float[] times, com.jme3.math.Quaternion[] samples, com.jme3.math.Quaternion storeResult) Interpolate among unit quaternions in an acyclic time sequence using cubic-spline interpolation based on the Squad function.- 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, norm=1)storeResult- storage for the result (modified if not null)- Returns:
- an interpolated unit quaternion (either storeResult or a new instance)
-