Esempio n. 1
0
        public double?nextDouble(double interpolant)
        {
            double newValue = (1 - interpolant) * propertyAccessor.getDouble().Value + interpolant * this.End;

            if (Math.Abs(newValue - propertyAccessor.getDouble().Value) < minEpsilon)
            {
                this.stop();
                if (this.endCenterOnSurface)
                {
                    orbitView.setViewOutOfFocus(true);
                }
                return(null);
            }
            return(newValue);
        }
        public static void setEyePoint(Globe globe, BasicOrbitView view, Vec4 newEyePoint)
        {
            if (globe == null)
            {
                var msg = Logging.getMessage("nullValue.GlobeIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }

            if (view == null)
            {
                var msg = Logging.getMessage("nullValue.ViewIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }

            if (newEyePoint == null)
            {
                var msg = Logging.getMessage("nullValue.PointIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }

            // Translate the view's modelview matrix to the specified new eye point, and compute the new center point by
            // assuming that the view's zoom distance does not change.
            var translation = view.getModelviewMatrix().extractEyePoint().subtract3(newEyePoint);
            var modelview   = view.getModelviewMatrix().multiply(Matrix.fromTranslation(translation));
            var eyePoint    = modelview.extractEyePoint();
            var forward     = modelview.extractForwardVector();
            var centerPoint = eyePoint.add3(forward.multiply3(view.getZoom()));

            // Set the view's properties from the new modelview matrix.
            var parameters = modelview.extractViewingParameters(centerPoint, view.getRoll(), globe);

            view.setCenterPosition((Position)parameters.getValue(AVKey.ORIGIN));
            view.setHeading((Angle)parameters.getValue(AVKey.HEADING));
            view.setPitch((Angle)parameters.getValue(AVKey.TILT));
            view.setRoll((Angle)parameters.getValue(AVKey.ROLL));
            view.setZoom((double)parameters.getValue(AVKey.RANGE));
            view.setViewOutOfFocus(true);
        }