Class RMInterpolator.Bounce
java.lang.Object
com.inductiveautomation.rm.graphics.RMInterpolator
com.inductiveautomation.rm.graphics.RMInterpolator.Bounce
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- RMInterpolator
Parameterizable bounce interpolator class.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inductiveautomation.rm.graphics.RMInterpolator
RMInterpolator.Bounce, RMInterpolator.Direction, RMInterpolator.Periodic
-
Field Summary
FieldsFields inherited from class com.inductiveautomation.rm.graphics.RMInterpolator
BOUNCE, EASE_BOTH, EASE_BOTH_CUBIC, EASE_IN, EASE_IN_CUBIC, EASE_OUT, EASE_OUT_CUBIC, LINEAR, ONE_SHOT, RANDOM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns the name of this interpolator.double
getRatio
(double aRatio) Returns a new ratio given normal ratio.void
setBounceParameters
(int numBounces, double elasticity) Sets the interpolator parameters numBounces is the number of bounces taken before stopping at the destination.Methods inherited from class com.inductiveautomation.rm.graphics.RMInterpolator
clone, getDirection, getInterpolator, getInterpolator, getInterpolatorCount, getNewInterpolator, getValue, getValue, interpolate, interpolateBoth, interpolateOut, isShared, toString
-
Field Details
-
_numBounces
public int _numBounces -
_elasticity
public double _elasticity
-
-
Constructor Details
-
Bounce
public Bounce(int nBounces, double elasticity) Create a new Bounce interpolator.
-
-
Method Details
-
setBounceParameters
public void setBounceParameters(int numBounces, double elasticity) Sets the interpolator parameters numBounces is the number of bounces taken before stopping at the destination. elasticity is a percentage which represents how much energy is lost on each bounce. 0 means the bounce is inelastic and won't bounce at all 1 means the bounce is perfectly elastic, so each bounce will go back to the starting point -
getRatio
public double getRatio(double aRatio) Description copied from class:RMInterpolator
Returns a new ratio given normal ratio.- Overrides:
getRatio
in classRMInterpolator
-
getName
Description copied from class:RMInterpolator
Returns the name of this interpolator.- Overrides:
getName
in classRMInterpolator
-