Package gov.nasa.worldwindx.examples.kml
Class KMLOrbitViewController
- java.lang.Object
-
- gov.nasa.worldwindx.examples.kml.KMLViewController
-
- gov.nasa.worldwindx.examples.kml.KMLOrbitViewController
-
public class KMLOrbitViewController extends KMLViewController
View controller to animate aOrbitViewto look at a KML feature.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classKMLOrbitViewController.EyePositionAnimatorA position animator that will compute anOrbitViewcenter position based on an eye position and orientation.
-
Field Summary
Fields Modifier and Type Field Description protected longMAX_LENGTH_MILLISMaximum time for animation, in milliseconds.protected longMIN_LENGTH_MILLISMinimum time for animation, in milliseconds.protected OrbitVieworbitViewThe view to animate.-
Fields inherited from class gov.nasa.worldwindx.examples.kml.KMLViewController
DEFAULT_VIEW_ALTITUDE, viewAltitude, wwd
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedKMLOrbitViewController(WorldWindow wwd)Create the view controller.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PositioncomputeCenterPosition(Position eyePosition, Vec4 forward, Angle pitch, int altitudeMode)Compute a center position from an eye position and an orientation.protected FlyToOrbitViewAnimatorcreateFlyToOrbitViewAnimator(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 voidgoTo(KMLCamera camera)Animate the view to the position described by a KMLCamera.protected voidgoTo(KMLLookAt lookAt)Animate the view to the position described by a KMLLookAt.-
Methods inherited from class gov.nasa.worldwindx.examples.kml.KMLViewController
create, findMaxAltitude, getViewAltitude, goTo, goTo, goToDefaultGroundOverlayView, goToDefaultPlacemarkView, goToDefaultView, goToDefaultView, setViewAltitude
-
-
-
-
Field Detail
-
MIN_LENGTH_MILLIS
protected final long MIN_LENGTH_MILLIS
Minimum time for animation, in milliseconds.- See Also:
- Constant Field Values
-
MAX_LENGTH_MILLIS
protected final long MAX_LENGTH_MILLIS
Maximum 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 ofOrbitView.
-
-
Method Detail
-
goTo
protected void goTo(KMLLookAt lookAt)
Animate the view to the position described by a KMLLookAt.- Specified by:
goToin classKMLViewController- Parameters:
lookAt- KML LookAt that describes the desired view.
-
goTo
protected void goTo(KMLCamera camera)
Animate the view to the position described by a KMLCamera.- Specified by:
goToin classKMLViewController- Parameters:
camera- KML Camera that describes the desired 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 ofeyePosition. (WorldWind.CLAMP_TO_GROUND,WorldWind.RELATIVE_TO_GROUND, orWorldWind.ABSOLUTE).- Returns:
- An animator to animate an OrbitView to the desired eye position and orientation.
-
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 ofeyePosition.- Returns:
- The center position of the view.
-
-