NASA World Wind

gov.nasa.worldwindx.examples.kml
Class KMLOrbitViewController

java.lang.Object
  extended by gov.nasa.worldwindx.examples.kml.KMLViewController
      extended by gov.nasa.worldwindx.examples.kml.KMLOrbitViewController

public class KMLOrbitViewController
extends KMLViewController

View controller to animate a OrbitView to look at a KML feature.


Nested Class Summary
protected  class KMLOrbitViewController.EyePositionAnimator
          A position animator that will compute an OrbitView center position based on an eye position and orientation.
 
Field Summary
protected  long MAX_LENGTH_MILLIS
          Maximum time for animation, in milliseconds.
protected  long MIN_LENGTH_MILLIS
          Minimum time for animation, in milliseconds.
protected  OrbitView orbitView
          The view to animate.
 
Fields inherited from class gov.nasa.worldwindx.examples.kml.KMLViewController
DEFAULT_VIEW_ALTITUDE, viewAltitude, wwd
 
Constructor Summary
protected KMLOrbitViewController(WorldWindow wwd)
          Create the view controller.
 
Method Summary
protected  Position computeCenterPosition(Position eyePosition, Vec4 forward, Angle pitch, int altitudeMode)
          Compute a center position from an eye position and an orientation.
protected  FlyToOrbitViewAnimator createFlyToOrbitViewAnimator(OrbitView orbitView, Position eyePosition, Angle heading, Angle pitch, Angle roll, long timeToMove, int altitudeMode)
          Create an animator to animate an orbit view to an eye position and orientation.
protected  void goTo(KMLCamera camera)
          Animate the view to the position described by a KML Camera.
protected  void goTo(KMLLookAt lookAt)
          Animate the view to the position described by a KML LookAt.
 
Methods inherited from class gov.nasa.worldwindx.examples.kml.KMLViewController
create, findMaxAltitude, getViewAltitude, goTo, goTo, goToDefaultGroundOverlayView, goToDefaultPlacemarkView, goToDefaultView, goToDefaultView, setViewAltitude
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LENGTH_MILLIS

protected final long MAX_LENGTH_MILLIS
Maximum time for animation, in milliseconds.

See Also:
Constant Field Values

MIN_LENGTH_MILLIS

protected final long MIN_LENGTH_MILLIS
Minimum time for animation, in milliseconds.

See Also:
Constant Field Values

orbitView

protected OrbitView orbitView
The view to animate.

Constructor Detail

KMLOrbitViewController

protected KMLOrbitViewController(WorldWindow wwd)
Create the view controller.

Parameters:
wwd - WorldWindow that holds the view to animate. The WorldWindow's view must be an instance of OrbitView.
Method Detail

computeCenterPosition

protected Position computeCenterPosition(Position eyePosition,
                                         Vec4 forward,
                                         Angle pitch,
                                         int altitudeMode)
Compute a center position from an eye position and an orientation. If the view is looking at the earth, the center position is the intersection point of the globe and a ray beginning at the eye point, in the direction of the forward vector. If the view is looking at the horizon, the center position is the eye position. Otherwise, the center position is null.

Parameters:
eyePosition - The eye position.
forward - The forward vector.
pitch - View pitch.
altitudeMode - Altitude mode of eyePosition.
Returns:
The center position of the view.

createFlyToOrbitViewAnimator

protected FlyToOrbitViewAnimator createFlyToOrbitViewAnimator(OrbitView orbitView,
                                                              Position eyePosition,
                                                              Angle heading,
                                                              Angle pitch,
                                                              Angle roll,
                                                              long timeToMove,
                                                              int altitudeMode)
Create an animator to animate an orbit view to an eye position and orientation. The animator is aware of altitude mode, and will re-compute the final center position as animation runs to ensure that the calculation uses the most accurate elevation data available.

Parameters:
orbitView - View to animate.
eyePosition - Desired eye position.
heading - Desired heading.
pitch - Desired pitch.
roll - Desired roll.
timeToMove - Animation time.
altitudeMode - Altitude mode of eyePosition. (WorldWind.CLAMP_TO_GROUND, WorldWind.RELATIVE_TO_GROUND, or WorldWind.ABSOLUTE).
Returns:
An animator to animate an OrbitView to the desired eye position and orientation.

goTo

protected void goTo(KMLCamera camera)
Animate the view to the position described by a KML Camera.

Specified by:
goTo in class KMLViewController
Parameters:
camera - KML Camera that describes the desired view.

goTo

protected void goTo(KMLLookAt lookAt)
Animate the view to the position described by a KML LookAt.

Specified by:
goTo in class KMLViewController
Parameters:
lookAt - KML LookAt that describes the desired view.

NASA World Wind