Exemple #1
0
        public Point2 Interpolate(Point2 target, Single t)
        {
            var width  = Tweening.Lerp(this.x, target.x, t);
            var height = Tweening.Lerp(this.y, target.y, t);

            return(new Point2(width, height));
        }
Exemple #2
0
        /// <summary>
        /// Interpolates between this value and the specified value.
        /// </summary>
        /// <param name="target">The target value.</param>
        /// <param name="t">A value between 0.0 and 1.0 representing the interpolation factor.</param>
        /// <returns>The interpolated value.</returns>
        public Size2D Interpolate(Size2D target, Single t)
        {
            var width  = Tweening.Lerp(this.width, target.width, t);
            var height = Tweening.Lerp(this.height, target.height, t);

            return(new Size2D(width, height));
        }
Exemple #3
0
        /// <summary>
        /// Interpolates between this value and the specified value.
        /// </summary>
        /// <param name="target">The target value.</param>
        /// <param name="t">A value between 0.0 and 1.0 representing the interpolation factor.</param>
        /// <returns>The interpolated value.</returns>
        public Vector2 Interpolate(Vector2 target, Single t)
        {
            var x = Tweening.Lerp(this.x, target.x, t);
            var y = Tweening.Lerp(this.y, target.y, t);

            return(new Vector2(x, y));
        }
Exemple #4
0
        public Circle Interpolate(Circle target, Single t)
        {
            var x      = Tweening.Lerp(this.x, target.x, t);
            var y      = Tweening.Lerp(this.y, target.y, t);
            var radius = Tweening.Lerp(this.radius, target.radius, t);

            return(new Circle(x, y, radius));
        }
Exemple #5
0
        /// <summary>
        /// Interpolates between this value and the specified value.
        /// </summary>
        /// <param name="target">The target value.</param>
        /// <param name="t">A value between 0.0 and 1.0 representing the interpolation factor.</param>
        /// <returns>The interpolated value.</returns>
        public Size3 Interpolate(Size3 target, Single t)
        {
            var width  = Tweening.Lerp(this.width, target.width, t);
            var height = Tweening.Lerp(this.height, target.height, t);
            var depth  = Tweening.Lerp(this.depth, target.depth, t);

            return(new Size3(width, height, depth));
        }
Exemple #6
0
        public RectangleD Interpolate(RectangleD target, Single t)
        {
            var x      = Tweening.Lerp(this.x, target.x, t);
            var y      = Tweening.Lerp(this.y, target.y, t);
            var width  = Tweening.Lerp(this.width, target.width, t);
            var height = Tweening.Lerp(this.height, target.height, t);

            return(new RectangleD(x, y, width, height));
        }
Exemple #7
0
        public Radians Interpolate(Radians target, Single t)
        {
            var angle = Tweening.Lerp(this.value, target.value, t);

            return(new Radians(angle));
        }