Enum SmoothRotations

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

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

      Enum Constants 
      Enum Constant Description
      LoopNlerp
      cyclic normalized linear (Nlerp) smoothing
      Nlerp
      acyclic normalized linear (Nlerp) smoothing
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static com.jme3.math.Quaternion[] lerp​(float[] times, com.jme3.math.Quaternion[] samples, float width, com.jme3.math.Quaternion[] storeResult)
      Smooth the quaternions in an acyclic time sequence using normalized linear (Nlerp) smoothing.
      static com.jme3.math.Quaternion[] loopLerp​(int last, float[] times, float cycleTime, com.jme3.math.Quaternion[] samples, float width, com.jme3.math.Quaternion[] storeResult)
      Smooth the quaternions in a cyclic time sequence using normalized linear (Nlerp) smoothing.
      com.jme3.math.Quaternion[] smooth​(float[] times, float cycleTime, com.jme3.math.Quaternion[] samples, float width, com.jme3.math.Quaternion[] storeResult)
      Smooth the rotations in a time sequence using this technique.
      static SmoothRotations valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static SmoothRotations[] 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 SmoothRotations LoopNlerp
        cyclic normalized linear (Nlerp) smoothing
      • Nlerp

        public static final SmoothRotations Nlerp
        acyclic normalized linear (Nlerp) smoothing
    • Method Detail

      • values

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

        public static SmoothRotations 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
      • smooth

        public com.jme3.math.Quaternion[] smooth​(float[] times,
                                                 float cycleTime,
                                                 com.jme3.math.Quaternion[] samples,
                                                 float width,
                                                 com.jme3.math.Quaternion[] storeResult)
        Smooth the rotations in a time sequence using this technique.
        Parameters:
        times - (not null, unaffected, length>0, in strictly ascending order)
        cycleTime - end time for looping (≥times[last])
        samples - input function values (not null, unaffected, same length as times)
        width - width of time window (≥0, ≤cycleTime)
        storeResult - storage for the result (distinct from samples, modified if not null)
        Returns:
        array of smoothed quaternions (either storeResult or a new instance)
      • lerp

        public static com.jme3.math.Quaternion[] lerp​(float[] times,
                                                      com.jme3.math.Quaternion[] samples,
                                                      float width,
                                                      com.jme3.math.Quaternion[] storeResult)
        Smooth the quaternions in an acyclic time sequence using normalized linear (Nlerp) smoothing. TODO compare signs
        Parameters:
        times - (not null, unaffected, length>0, in strictly ascending order)
        samples - input function values (not null, unaffected, same length as times, each not null)
        width - width of time window (≥0)
        storeResult - storage for the result (modified if not null)
        Returns:
        array of smoothed quaternions (either storeResult or a new instance)
      • loopLerp

        public static com.jme3.math.Quaternion[] loopLerp​(int last,
                                                          float[] times,
                                                          float cycleTime,
                                                          com.jme3.math.Quaternion[] samples,
                                                          float width,
                                                          com.jme3.math.Quaternion[] storeResult)
        Smooth the quaternions in a cyclic time sequence using normalized linear (Nlerp) smoothing. TODO compare signs
        Parameters:
        last - (index of the last point, ≥1)
        times - (not null, unaffected, in strictly ascending order, times[0]==0)
        cycleTime - cycle time (>times[last])
        samples - input function values (not null, unaffected, each not null)
        width - width of time window (≥0, ≤cycleTime)
        storeResult - storage for the result (modified if not null)
        Returns:
        array of smoothed quaternions (either storeResult or a new instance)