Package gov.nasa.worldwind.animation
Class MoveToDoubleAnimator
- java.lang.Object
-
- gov.nasa.worldwind.animation.BasicAnimator
-
- gov.nasa.worldwind.animation.DoubleAnimator
-
- gov.nasa.worldwind.animation.MoveToDoubleAnimator
-
- All Implemented Interfaces:
Animator
- Direct Known Subclasses:
OrbitViewMoveToZoomAnimator
public class MoveToDoubleAnimator extends DoubleAnimator
Animates the value to the specified end position, using the specified smoothing, until the value is within the specified minEpsilon of the end value. For each frame the animator interpolates between the current value and the target(end) value using(1.0-smoothing)
as the interpolant, until the difference between the current value and the target(end) value is less than theminEpsilon
value.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
minEpsilon
The amount of delta between the end value and the current value that is required to stop the animation.protected double
smoothing
The amount of smoothing.-
Fields inherited from class gov.nasa.worldwind.animation.DoubleAnimator
begin, end, propertyAccessor
-
Fields inherited from class gov.nasa.worldwind.animation.BasicAnimator
interpolator
-
-
Constructor Summary
Constructors Constructor Description MoveToDoubleAnimator(java.lang.Double end, double smoothing, double minEpsilon, PropertyAccessor.DoubleAccessor propertyAccessor)
Construct aMoveToDoubleAnimator
MoveToDoubleAnimator(java.lang.Double end, double smoothing, PropertyAccessor.DoubleAccessor propertyAccessor)
Construct aMoveToDoubleAnimator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
next()
Set the value to the next value in the animation.java.lang.Double
nextDouble(double interpolant)
Get the next value using the given interpolantto perform a linear interplation.-
Methods inherited from class gov.nasa.worldwind.animation.DoubleAnimator
getBegin, getEnd, getPropertyAccessor, setBegin, setEnd, setImpl
-
Methods inherited from class gov.nasa.worldwind.animation.BasicAnimator
flagLastStateInvalid, hasNext, isLastStateValid, isStopOnInvalidState, set, setStopOnInvalidState, start, stop
-
-
-
-
Field Detail
-
minEpsilon
protected double minEpsilon
The amount of delta between the end value and the current value that is required to stop the animation. Defaults to .001.
-
smoothing
protected double smoothing
The amount of smoothing. A number between 0 and 1. The higher the number the greater the smoothing.
-
-
Constructor Detail
-
MoveToDoubleAnimator
public MoveToDoubleAnimator(java.lang.Double end, double smoothing, PropertyAccessor.DoubleAccessor propertyAccessor)
Construct aMoveToDoubleAnimator
- Parameters:
end
- The target value, the value to animate to.smoothing
- The smoothing factor. A number between 0 and 1. The higher the number the greater the smoothing.propertyAccessor
- The accessor used to access the animated value.
-
MoveToDoubleAnimator
public MoveToDoubleAnimator(java.lang.Double end, double smoothing, double minEpsilon, PropertyAccessor.DoubleAccessor propertyAccessor)
Construct aMoveToDoubleAnimator
- Parameters:
end
- The target value, the value to animate to.smoothing
- smoothing The smoothing factor. A number between 0 and 1. The higher the number the greater the smoothing.minEpsilon
- The minimum difference between the current value and the target value that triggers the end of the animation. Defaults to .001.propertyAccessor
- The double accessor used to access the animated value.
-
-
Method Detail
-
next
public void next()
Set the value to the next value in the animation. This interpolates between the current value and the target value using1.0-smoothing
as the interpolant.- Specified by:
next
in interfaceAnimator
- Overrides:
next
in classBasicAnimator
-
nextDouble
public java.lang.Double nextDouble(double interpolant)
Get the next value using the given interpolantto perform a linear interplation. between the current value and the target(end) value.- Overrides:
nextDouble
in classDoubleAnimator
- Parameters:
interpolant
- The inerpolant to be used to perform the interpolation. A number between 0 and 1.- Returns:
- the interpolated value.
-
-