Package icyllis.modernui.animation
Class AnticipateOvershootInterpolator
java.lang.Object
icyllis.modernui.animation.AnticipateOvershootInterpolator
- All Implemented Interfaces:
TimeInterpolator
An interpolator where the change starts backward then flings forward and overshoots
the target value and finally goes back to the final value.
-
Field Summary
Fields inherited from interface icyllis.modernui.animation.TimeInterpolator
ACCELERATE, ACCELERATE_DECELERATE, ANTICIPATE, ANTICIPATE_OVERSHOOT, BOUNCE, DECELERATE, DECELERATE_CUBIC, DECELERATE_QUINTIC, LINEAR, OVERSHOOT, SINE, VISCOUS_FLUID
-
Constructor Summary
ConstructorDescriptionAnticipateOvershootInterpolator
(float tension) AnticipateOvershootInterpolator
(float tension, float extraTension) -
Method Summary
-
Constructor Details
-
AnticipateOvershootInterpolator
public AnticipateOvershootInterpolator()- See Also:
-
AnticipateOvershootInterpolator
public AnticipateOvershootInterpolator(float tension) - Parameters:
tension
- Amount of anticipation/overshoot. When tension equals 0.0f, there is no anticipation/overshoot and the interpolator becomes a simple acceleration/deceleration interpolator.
-
AnticipateOvershootInterpolator
public AnticipateOvershootInterpolator(float tension, float extraTension) - Parameters:
tension
- Amount of anticipation/overshoot. When tension equals 0.0f, there is no anticipation/overshoot and the interpolator becomes a simple acceleration/deceleration interpolator.extraTension
- Amount by which to multiply the tension. For instance, to get the same overshoot as an OvershootInterpolator with a tension of 2.0f, you would use an extraTension of 1.5f.
-
-
Method Details
-
getInterpolation
public float getInterpolation(float t) Description copied from interface:TimeInterpolator
Get interpolation value. This interpolated value is then multiplied by the change in value of an animation to derive the animated value at the current elapsed animation time.- Specified by:
getInterpolation
in interfaceTimeInterpolator
- Parameters:
t
- [0.0, 1.0] determined by timeline, 0.0 represents the start and 1.0 represents the end- Returns:
- the interpolated value. this value can be more than 1.0 for those overshoot their targets, or less than 0 for those undershoot their targets.
-