Ejemplo n.º 1
0
        /// <summary>
        /// Animates to.
        /// </summary>
        /// <param name="newPosition">The new position.</param>
        /// <param name="newDirection">The new direction.</param>
        /// <param name="newUpDirection">The new up direction.</param>
        /// <param name="animationTime">The animation time.</param>
        public void AnimateTo(
            Point3D newPosition,
            Vector3D newDirection,
            Vector3D newUpDirection,
            double animationTime)
        {
            if (animationTime == 0)
            {
                Position      = newPosition;
                LookDirection = newDirection;
                UpDirection   = newUpDirection;
                aniTime       = 0;
            }
            else
            {
#if NETFX_CORE
                targetPosition      = newPosition;
                targetLookDirection = newDirection;
                targetUpDirection   = newUpDirection;
#else
                targetPosition      = newPosition.ToVector3();
                targetLookDirection = newDirection.ToVector3();
                targetUpDirection   = newUpDirection.ToVector3();
#endif
                oldPosition = CameraInternal.Position;
                oldLookDir  = CameraInternal.LookDirection;
                oldUpDir    = CameraInternal.UpDirection;
                aniTime     = animationTime;
                accumTime   = 1;
                prevTicks   = Stopwatch.GetTimestamp();
                OnUpdateAnimation(0);
            }
        }