Enum Class SmoothVectors

java.lang.Object
java.lang.Enum<SmoothVectors>
jme3utilities.wes.SmoothVectors
All Implemented Interfaces:
Serializable, Comparable<SmoothVectors>, Constable

public enum SmoothVectors extends Enum<SmoothVectors>
Enumerate and implement some smoothing 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 Constants
    Enum Constant
    Description
    acyclic linear (Lerp) smoothing
    cyclic linear (Lerp) smoothing
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.jme3.math.Vector3f[]
    lerp(float[] times, com.jme3.math.Vector3f[] samples, float width, com.jme3.math.Vector3f[] storeResult)
    Smooth the vectors in an acyclic time sequence using linear (Lerp) smoothing.
    static com.jme3.math.Vector3f[]
    loopLerp(int last, float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, float width, com.jme3.math.Vector3f[] storeResult)
    Smooth the vectors in a cyclic time sequence using linear (Lerp) smoothing.
    com.jme3.math.Vector3f[]
    smooth(float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, float width, com.jme3.math.Vector3f[] storeResult)
    Smooth the vectors in a time sequence using this technique.
    Returns the enum constant of this class with the specified name.
    static SmoothVectors[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

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

    • Lerp

      public static final SmoothVectors Lerp
      acyclic linear (Lerp) smoothing
    • LoopLerp

      public static final SmoothVectors LoopLerp
      cyclic linear (Lerp) smoothing
  • Method Details

    • values

      public static SmoothVectors[] 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

      public static SmoothVectors valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • smooth

      public com.jme3.math.Vector3f[] smooth(float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, float width, com.jme3.math.Vector3f[] storeResult)
      Smooth the vectors 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 vectors (either storeResult or a new instance)
    • lerp

      public static com.jme3.math.Vector3f[] lerp(float[] times, com.jme3.math.Vector3f[] samples, float width, com.jme3.math.Vector3f[] storeResult)
      Smooth the vectors in an acyclic time sequence using linear (Lerp) smoothing.
      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 (distinct from samples, modified if not null)
      Returns:
      array of smoothed vectors (either storeResult or a new instance)
    • loopLerp

      public static com.jme3.math.Vector3f[] loopLerp(int last, float[] times, float cycleTime, com.jme3.math.Vector3f[] samples, float width, com.jme3.math.Vector3f[] storeResult)
      Smooth the vectors in a cyclic time sequence using linear (Lerp) smoothing.
      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 (distinct from samples, modified if not null)
      Returns:
      array of smoothed vectors (either storeResult or a new instance)