Class RMInterpolator

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    RMInterpolator.Bounce, RMInterpolator.Periodic

    public class RMInterpolator
    extends java.lang.Object
    implements java.lang.Cloneable
    This class provides functionality to interpolate between two numbers given a ratio between 0-1.
    • Field Detail

      • EASE_OUT

        public static RMInterpolator EASE_OUT
        Ease Out interpolator.
      • EASE_BOTH

        public static RMInterpolator EASE_BOTH
        Ease Both interpolator.
      • EASE_IN_CUBIC

        public static RMInterpolator EASE_IN_CUBIC
        Ease In interpolator.
      • EASE_OUT_CUBIC

        public static RMInterpolator EASE_OUT_CUBIC
        Ease Out interpolator.
      • EASE_BOTH_CUBIC

        public static RMInterpolator EASE_BOTH_CUBIC
        Ease Both interpolator.
      • RANDOM

        public static RMInterpolator RANDOM
        Random interpolator. Object will get a random value at every frame, bounded by the start & end values.
      • ONE_SHOT

        public static RMInterpolator ONE_SHOT
        One Shot interpolator.
    • Constructor Detail

      • RMInterpolator

        public RMInterpolator()
        Creates a new interpolator.
      • RMInterpolator

        public RMInterpolator​(RMInterpolator.Direction aDirection)
        Creates a new interpolator with given direction.
    • Method Detail

      • getInterpolator

        public static RMInterpolator getInterpolator​(java.lang.String aName)
        Returns a shared interpolator for given name.
      • getNewInterpolator

        public static RMInterpolator getNewInterpolator​(java.lang.String aName)
        Returns a new interpolator instance for a given name.
      • getValue

        public double getValue​(double aRatio)
        Returns an interpolated value for 0 & 1 given a ratio.
      • getValue

        public double getValue​(double aRatio,
                               double aStart,
                               double anEnd)
        Returns a value given a ratio and start/end values.
      • getRatio

        public double getRatio​(double aRatio)
        Returns a new ratio given normal ratio.
      • interpolate

        public double interpolate​(double aRatio,
                                  double aStart,
                                  double aEnd)
        Direction In interpolation.
      • interpolateOut

        public double interpolateOut​(double aRatio,
                                     double aStart,
                                     double aEnd)
        Direction Out interpolation.
      • interpolateBoth

        public double interpolateBoth​(double aRatio,
                                      double aStart,
                                      double anEnd)
        Direction Both interpolation.
      • getName

        public java.lang.String getName()
        Returns the name of this interpolator.
      • toString

        public java.lang.String toString()
        Returns a string representation of this interpolator.
        Overrides:
        toString in class java.lang.Object
      • isShared

        public boolean isShared()
        Returns true if there's only a single shared instance of this interpolator.
      • clone

        public RMInterpolator clone()
        Standard clone implementation.
        Overrides:
        clone in class java.lang.Object
      • getInterpolatorCount

        public static int getInterpolatorCount()
        Returns number of shared common interpolators.
      • getInterpolator

        public static RMInterpolator getInterpolator​(int anIndex)
        Returns the individual common interpolator at given index.