Enum TweenRotations

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TweenRotations>

    public enum TweenRotations
    extends java.lang.Enum<TweenRotations>
    Enumerate and implement some interpolation techniques on time sequences of unit quaternions.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      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 Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      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.
      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.
      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.
      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.
      RotationCurve precompute​(float[] times, float cycleTime, com.jme3.math.Quaternion[] samples)
      Generate a rotation curve.
      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.
      static TweenRotations valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TweenRotations[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LoopNlerp

        public static final TweenRotations LoopNlerp
        cyclic normalized linear (Nlerp) interpolation
      • LoopQuickSlerp

        public static final TweenRotations LoopQuickSlerp
        cyclic spherical linear (Slerp) or "great arc" interpolation using shortcuts
      • LoopSlerp

        public static final TweenRotations LoopSlerp
        cyclic spherical linear (Slerp) or "great arc" interpolation
      • LoopSpline

        public static final TweenRotations LoopSpline
        cyclic cubic-spline interpolation based on the Squad function
      • Nlerp

        public static final TweenRotations Nlerp
        acyclic normalized linear (Nlerp) interpolation
      • QuickSlerp

        public static final TweenRotations QuickSlerp
        acyclic spherical linear (Slerp) or "great arc" interpolation using shortcuts
      • Slerp

        public static final TweenRotations Slerp
        acyclic spherical linear (Slerp) or "great arc" interpolation
      • Spline

        public static final TweenRotations Spline
        acyclic cubic-spline interpolation based on the Squad function
    • Method Detail

      • values

        public static TweenRotations[] 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 (TweenRotations c : TweenRotations.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TweenRotations 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 name
        java.lang.NullPointerException - 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 value
        times - (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 value
        curve - 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

        public RotationCurve precompute​(float[] times,
                                        float cycleTime,
                                        com.jme3.math.Quaternion[] samples)
        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)