Class RMInterpolator
java.lang.Object
com.inductiveautomation.rm.graphics.RMInterpolator
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
RMInterpolator.Bounce
,RMInterpolator.Periodic
This class provides functionality to interpolate between two numbers given a ratio between 0-1.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Parameterizable bounce interpolator class.static enum
static class
An Interpolator subclass that can be used for periodic (ie looping) motion. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic RMInterpolator
Bounce interpolator.static RMInterpolator
Ease Both interpolator.static RMInterpolator
Ease Both interpolator.static RMInterpolator
Ease In interpolator.static RMInterpolator
Ease In interpolator.static RMInterpolator
Ease Out interpolator.static RMInterpolator
Ease Out interpolator.static RMInterpolator
Linear interpolator.static RMInterpolator
One Shot interpolator.static RMInterpolator
Random interpolator. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new interpolator.RMInterpolator
(RMInterpolator.Direction aDirection) Creates a new interpolator with given direction. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Standard clone implementation.Returns the interpolator direction.static RMInterpolator
getInterpolator
(int anIndex) Returns the individual common interpolator at given index.static RMInterpolator
getInterpolator
(String aName) Returns a shared interpolator for given name.static int
Returns number of shared common interpolators.getName()
Returns the name of this interpolator.static RMInterpolator
getNewInterpolator
(String aName) Returns a new interpolator instance for a given name.double
getRatio
(double aRatio) Returns a new ratio given normal ratio.double
getValue
(double aRatio) Returns an interpolated value for 0 & 1 given a ratio.double
getValue
(double aRatio, double aStart, double anEnd) Returns a value given a ratio and start/end values.double
interpolate
(double aRatio, double aStart, double aEnd) Direction In interpolation.double
interpolateBoth
(double aRatio, double aStart, double anEnd) Direction Both interpolation.double
interpolateOut
(double aRatio, double aStart, double aEnd) Direction Out interpolation.boolean
isShared()
Returns true if there's only a single shared instance of this interpolator.toString()
Returns a string representation of this interpolator.
-
Field Details
-
LINEAR
Linear interpolator. -
EASE_IN
Ease In interpolator. -
EASE_OUT
Ease Out interpolator. -
EASE_BOTH
Ease Both interpolator. -
EASE_IN_CUBIC
Ease In interpolator. -
EASE_OUT_CUBIC
Ease Out interpolator. -
EASE_BOTH_CUBIC
Ease Both interpolator. -
RANDOM
Random interpolator. Object will get a random value at every frame, bounded by the start & end values. -
BOUNCE
Bounce interpolator. -
ONE_SHOT
One Shot interpolator.
-
-
Constructor Details
-
RMInterpolator
public RMInterpolator()Creates a new interpolator. -
RMInterpolator
Creates a new interpolator with given direction.
-
-
Method Details
-
getInterpolator
Returns a shared interpolator for given name. -
getNewInterpolator
Returns a new interpolator instance for a given name. -
getDirection
Returns the interpolator direction. -
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
Returns the name of this interpolator. -
toString
Returns a string representation of this interpolator. -
clone
Standard clone implementation. -
getInterpolatorCount
public static int getInterpolatorCount()Returns number of shared common interpolators. -
getInterpolator
Returns the individual common interpolator at given index.
-