protected void setEyePosition( AnimationController animControl, View view, Position position, ViewInputAttributes.ActionAttributes attrib) { MoveToPositionAnimator posAnimator = (MoveToPositionAnimator) animControl.get(VIEW_ANIM_POSITION); double smoothing = attrib.getSmoothingValue(); if (!(attrib.isEnableSmoothing() && this.isEnableSmoothing())) smoothing = 0.0; if (smoothing != 0.0) { double elevation = ((FlyViewLimits) view.getViewPropertyLimits()) .limitEyeElevation(position, view.getGlobe()); if (elevation != position.getElevation()) { position = new Position(position, elevation); } if (posAnimator == null) { posAnimator = new MoveToPositionAnimator( view.getEyePosition(), position, smoothing, OrbitViewPropertyAccessor.createEyePositionAccessor(view)); animControl.put(VIEW_ANIM_POSITION, posAnimator); } else { posAnimator.setEnd(position); posAnimator.start(); } } view.firePropertyChange(AVKey.VIEW, null, view); }
/** * Set the roll in a view. * * @param view View to modify. * @param animControl Animator controller for the view. * @param roll new roll value. * @param attrib action that caused the roll to change. */ protected void setRoll( View view, AnimationController animControl, Angle roll, ViewInputAttributes.ActionAttributes attrib) { double smoothing = attrib.getSmoothingValue(); if (!(attrib.isEnableSmoothing() && this.isEnableSmoothing())) smoothing = 0.0; AngleAnimator angleAnimator = new RotateToAngleAnimator( view.getRoll(), roll, smoothing, ViewPropertyAccessor.createRollAccessor(view)); animControl.put(VIEW_ANIM_ROLL, angleAnimator); }
protected void onResetPitch(ViewInputAttributes.ActionAttributes actionAttribs) { View view = this.getView(); if (view == null) // include this test to ensure any derived implementation performs it { return; } double smoothing = actionAttribs.getSmoothingValue(); if (!(actionAttribs.isEnableSmoothing() && this.isEnableSmoothing())) smoothing = 0.0; this.gotoAnimControl.put( VIEW_ANIM_PITCH, new RotateToAngleAnimator( view.getPitch(), Angle.POS90, smoothing, ViewPropertyAccessor.createPitchAccessor(view))); view.firePropertyChange(AVKey.VIEW, null, view); }