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); }
protected void onVerticalTranslate( double translateChange, double totalTranslateChange, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs) { this.stopGoToAnimators(); double elevChange = -(totalTranslateChange * getScaleValueElevation(deviceAttributes, actionAttribs)); View view = this.getView(); Position position = view.getEyePosition(); Position newPos = new Position(position, position.getElevation() + (elevChange)); this.setEyePosition(uiAnimControl, view, newPos, actionAttribs); view.firePropertyChange(AVKey.VIEW, null, view); }