public FlyToOrbitViewAnimator(OrbitView orbitView, Interpolator interpolator, int altitudeMode, PositionAnimator centerAnimator, DoubleAnimator zoomAnimator, AngleAnimator headingAnimator, AngleAnimator pitchAnimator, AngleAnimator rollAnimator) : base(interpolator, centerAnimator, zoomAnimator, headingAnimator, pitchAnimator, rollAnimator) { this.orbitView = (BasicOrbitView)orbitView; this.centerAnimator = centerAnimator; this.zoomAnimator = (ViewElevationAnimator)zoomAnimator; this.headingAnimator = headingAnimator; this.pitchAnimator = pitchAnimator; this.rollAnimator = rollAnimator; if (interpolator == null) { this.interpolator = new ScheduledInterpolator(10000); } this.altitudeMode = altitudeMode; }
public static FlyToOrbitViewAnimator createFlyToOrbitViewAnimator( OrbitView orbitView, Position beginCenterPos, Position endCenterPos, Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch, double beginZoom, double endZoom, long timeToMove, int altitudeMode) { OnSurfacePositionAnimator centerAnimator = new OnSurfacePositionAnimator(orbitView.getGlobe(), new ScheduledInterpolator(timeToMove), beginCenterPos, endCenterPos, OrbitViewPropertyAccessor.createCenterPositionAccessor( orbitView), altitudeMode); // Create an elevation animator with ABSOLUTE altitude mode because the OrbitView altitude mode applies to the // center position, not the zoom. ViewElevationAnimator zoomAnimator = new ViewElevationAnimator(orbitView.getGlobe(), beginZoom, endZoom, beginCenterPos, endCenterPos, WorldWind.ABSOLUTE, OrbitViewPropertyAccessor.createZoomAccessor(orbitView)); centerAnimator.useMidZoom = zoomAnimator.getUseMidZoom(); AngleAnimator headingAnimator = new AngleAnimator( new ScheduledInterpolator(timeToMove), beginHeading, endHeading, ViewPropertyAccessor.createHeadingAccessor(orbitView)); AngleAnimator pitchAnimator = new AngleAnimator( new ScheduledInterpolator(timeToMove), beginPitch, endPitch, ViewPropertyAccessor.createPitchAccessor(orbitView)); FlyToOrbitViewAnimator panAnimator = new FlyToOrbitViewAnimator(orbitView, new ScheduledInterpolator(timeToMove), altitudeMode, centerAnimator, zoomAnimator, headingAnimator, pitchAnimator, null); return(panAnimator); }