public class ViewElevationAnimator extends DoubleAnimator
Animator
for elevation values. Calculates a mid-zoom value that
gives the effect of flying up and them back down again.Modifier and Type | Field and Description |
---|---|
protected int |
altitudeMode |
protected LatLon |
endLatLon |
protected Globe |
globe |
protected double |
midZoom |
protected double |
trueEndZoom |
protected boolean |
useMidZoom |
begin, end, propertyAccessor
interpolator
Constructor and Description |
---|
ViewElevationAnimator(Globe globe,
double beginZoom,
double endZoom,
LatLon beginLatLon,
LatLon endLatLon,
int altitudeMode,
PropertyAccessor.DoubleAccessor propertyAccessor)
Create the animator.
|
Modifier and Type | Method and Description |
---|---|
protected static double |
computeMidZoom(Globe globe,
LatLon beginLatLon,
LatLon endLatLon,
double beginZoom,
double endZoom) |
double |
getTrueEndZoom()
return the true position to end the elevation animation at.
|
boolean |
getUseMidZoom()
determines whether this Animator is using midZoom.
|
java.lang.Double |
nextDouble(double interpolant) |
protected double |
nextDouble(double interpolant,
double start,
double end)
Computes the value for the given interpolant.
|
void |
set(double interpolant)
Set the value of the field being animated based on the given interpolant.
|
void |
setEnd(java.lang.Double end)
Set the animator's end zoom level.
|
protected void |
setImpl(double interpolant)
No-op intended to be overrided by deriving classes.
|
protected boolean |
useMidZoom(double beginZoom,
double endZoom,
double midZoom)
Determines if the animation will use mid-zoom.
|
getBegin, getEnd, getPropertyAccessor, setBegin
flagLastStateInvalid, hasNext, isLastStateValid, isStopOnInvalidState, next, setStopOnInvalidState, start, stop
protected int altitudeMode
protected LatLon endLatLon
protected Globe globe
protected double midZoom
protected double trueEndZoom
protected boolean useMidZoom
public ViewElevationAnimator(Globe globe, double beginZoom, double endZoom, LatLon beginLatLon, LatLon endLatLon, int altitudeMode, PropertyAccessor.DoubleAccessor propertyAccessor)
globe
- Globe used to evaluate altitude mode and determine if mid-zoom is necessary. May be null.beginZoom
- Beginning elevation.endZoom
- Ending elevation.beginLatLon
- Beginning location.endLatLon
- Ending location.altitudeMode
- Altitude mode of ending elevation (WorldWind.CLAMP_TO_GROUND
,
WorldWind.RELATIVE_TO_GROUND
, or WorldWind.ABSOLUTE
. Altitude mode
is not used if globe
is null.propertyAccessor
- Accessor to set elevation.protected static double computeMidZoom(Globe globe, LatLon beginLatLon, LatLon endLatLon, double beginZoom, double endZoom)
public double getTrueEndZoom()
public boolean getUseMidZoom()
public java.lang.Double nextDouble(double interpolant)
nextDouble
in class DoubleAnimator
protected double nextDouble(double interpolant, double start, double end)
interpolant
- the interpolant to use for interpolatingstart
- the lower end of the interpolated range.end
- the upper end of the interpolated range.public void set(double interpolant)
set
in interface Animator
set
in class BasicAnimator
interpolant
- A value between 0 and 1.public void setEnd(java.lang.Double end)
setEnd
in class DoubleAnimator
end
- New end zoom.protected void setImpl(double interpolant)
BasicAnimator
setImpl
in class DoubleAnimator
interpolant
- A value between 0 and 1.protected boolean useMidZoom(double beginZoom, double endZoom, double midZoom)
beginZoom
- the begin zoom valueendZoom
- the end zoom valuemidZoom
- the elevation at the middle of the animation