NASA World Wind

gov.nasa.worldwind.animation
Class MoveToDoubleAnimator

java.lang.Object
  extended by gov.nasa.worldwind.animation.BasicAnimator
      extended by gov.nasa.worldwind.animation.DoubleAnimator
          extended by 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 the minEpsilon value.


Field Summary
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
MoveToDoubleAnimator(Double end, double smoothing, double minEpsilon, PropertyAccessor.DoubleAccessor propertyAccessor)
          Construct a MoveToDoubleAnimator
MoveToDoubleAnimator(Double end, double smoothing, PropertyAccessor.DoubleAccessor propertyAccessor)
          Construct a MoveToDoubleAnimator
 
Method Summary
 void next()
          Set the value to the next value in the animation.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(Double end,
                            double smoothing,
                            double minEpsilon,
                            PropertyAccessor.DoubleAccessor propertyAccessor)
Construct a MoveToDoubleAnimator

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.

MoveToDoubleAnimator

public MoveToDoubleAnimator(Double end,
                            double smoothing,
                            PropertyAccessor.DoubleAccessor propertyAccessor)
Construct a MoveToDoubleAnimator

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.
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 using 1.0-smoothing as the interpolant.

Specified by:
next in interface Animator
Overrides:
next in class BasicAnimator

nextDouble

public 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 class DoubleAnimator
Parameters:
interpolant - The inerpolant to be used to perform the interpolation. A number between 0 and 1.
Returns:
the interpolated value.

NASA World Wind