/// <summary> /// Initializes a new instance of the <see cref="Path3D" /> class. /// </summary> /// <param name="start"> /// The starting point in a 3D plane /// </param> /// <param name="end"> /// The ending point in a 3D plane /// </param> /// <param name="duration"> /// The time in miliseconds that the animator must play this path /// </param> /// <param name="function"> /// The animation function /// </param> /// <exception cref="ArgumentOutOfRangeException"> /// Duration is less than zero /// </exception> public Path3D(Float3D start, Float3D end, ulong duration, AnimationFunctions.Function function) : this( new Path(start.X, end.X, duration, function), new Path(start.Y, end.Y, duration, function), new Path(start.Z, end.Z, duration, function)) { }
/// <summary> /// Continue the last paths with a new one /// </summary> /// <param name="paths">Array of paths</param> /// <param name="endX">Horizontal value of the next point to follow</param> /// <param name="endY">Vertical value of the next point to follow</param> /// <param name="duration">Duration of the animation</param> /// <param name="delay">Starting delay</param> /// <param name="function">Animation controller function</param> /// <returns>An array of paths including the newly created one</returns> public static Path2D[] ContinueTo(this Path2D[] paths, float endX, float endY, ulong duration, ulong delay, AnimationFunctions.Function function) { return (paths.Concat(new[] { new Path2D(paths.Last().End, new Float2D(endX, endY), duration, delay, function) }) .ToArray()); }
/// <summary> /// Initializes a new instance of the <see cref="Path" /> class. /// </summary> /// <param name="start"> /// The starting value /// </param> /// <param name="end"> /// The ending value /// </param> /// <param name="duration"> /// The time in miliseconds that the animator must play this path /// </param> /// <param name="delay"> /// The time in miliseconds that the animator must wait before playing this path /// </param> /// <param name="function"> /// The animation function /// </param> /// <exception cref="ArgumentOutOfRangeException"> /// Duration is less than zero /// </exception> public Path(float start, float end, ulong duration, ulong delay, AnimationFunctions.Function function) { Start = start; End = end; Function = function ?? AnimationFunctions.Linear; Duration = duration; Delay = delay; }
/// <summary> /// Continue the last paths with a new one /// </summary> /// <param name="paths">Array of paths</param> /// <param name="end">Next point to follow</param> /// <param name="duration">Duration of the animation</param> /// <param name="function">Animation controller function</param> /// <returns>An array of paths including the newly created one</returns> public static Path2D[] ContinueTo(this Path2D[] paths, Float2D end, ulong duration, AnimationFunctions.Function function) { return(paths.Concat(new[] { new Path2D(paths.Last().End, end, duration, function) }).ToArray()); }
public Path(float start, float end, ulong duration, ulong delay, AnimationFunctions.Function function) { this.Start = start; this.End = end; this.Function = function ?? new AnimationFunctions.Function(AnimationFunctions.Liner); this.Duration = duration; this.Delay = delay; }
/// <summary> /// Initializes a new instance of the <see cref="Path2D" /> class. /// </summary> /// <param name="startX"> /// The starting horizontal value /// </param> /// <param name="endX"> /// The ending horizontal value /// </param> /// <param name="startY"> /// The starting vertical value /// </param> /// <param name="endY"> /// The ending vertical value /// </param> /// <param name="duration"> /// The time in miliseconds that the animator must play this path /// </param> /// <param name="function"> /// The animation function /// </param> /// <exception cref="ArgumentOutOfRangeException"> /// Duration is less than zero /// </exception> public Path2D( float startX, float endX, float startY, float endY, ulong duration, AnimationFunctions.Function function) : this(new Path(startX, endX, duration, function), new Path(startY, endY, duration, function)) { }
/// <summary> /// Initializes a new instance of the <see cref="Path3D" /> class. /// </summary> /// <param name="startX"> /// The starting horizontal value /// </param> /// <param name="endX"> /// The ending horizontal value /// </param> /// <param name="startY"> /// The starting vertical value /// </param> /// <param name="endY"> /// The ending vertical value /// </param> /// <param name="startZ"> /// The starting depth value /// </param> /// <param name="endZ"> /// The ending depth value /// </param> /// <param name="duration"> /// The time in miliseconds that the animator must play this path /// </param> /// <param name="delay"> /// The time in miliseconds that the animator must wait before playing this path /// </param> /// <param name="function"> /// The animation function /// </param> /// <exception cref="ArgumentOutOfRangeException"> /// Duration is less than zero /// </exception> public Path3D( float startX, float endX, float startY, float endY, float startZ, float endZ, ulong duration, ulong delay, AnimationFunctions.Function function) : this( new Path(startX, endX, duration, delay, function), new Path(startY, endY, duration, delay, function), new Path(startZ, endZ, duration, delay, function)) { }
/// <summary> /// Continue the path with a new one /// </summary> /// <param name="path">The path to continue</param> /// <param name="endX">Horizontal value of the next point to follow</param> /// <param name="endY">Vertical value of the next point to follow</param> /// <param name="duration">Duration of the animation</param> /// <param name="delay">Starting delay</param> /// <param name="function">Animation controller function</param> /// <returns>An array of paths including the newly created one</returns> public static Path2D[] ContinueTo(this Path2D path, float endX, float endY, ulong duration, ulong delay, AnimationFunctions.Function function) { return(path.ToArray().ContinueTo(endX, endY, duration, delay, function)); }
/// <summary> /// Continue the path with a new one /// </summary> /// <param name="path">The path to continue</param> /// <param name="end">Next point to follow</param> /// <param name="duration">Duration of the animation</param> /// <param name="function">Animation controller function</param> /// <returns>An array of paths including the newly created one</returns> public static Path2D[] ContinueTo(this Path2D path, Float2D end, ulong duration, AnimationFunctions.Function function) { return(path.ToArray().ContinueTo(end, duration, function)); }
/// <summary> /// Continue the path with a new one /// </summary> /// <param name="path">The path to continue</param> /// <param name="endX">Horizontal value of the next point to follow</param> /// <param name="endY">Vertical value of the next point to follow</param> /// <param name="endZ">Depth value of the next point to follow</param> /// <param name="duration">Duration of the animation</param> /// <param name="function">Animation controller function</param> /// <returns>An array of paths including the newly created one</returns> public static Path3D[] ContinueTo(this Path3D path, float endX, float endY, float endZ, ulong duration, AnimationFunctions.Function function) { return(path.ToArray().ContinueTo(endX, endY, endZ, duration, function)); }
/// <summary> /// Initializes a new instance of the <see cref="Path" /> class. /// </summary> /// <param name="start"> /// The starting value /// </param> /// <param name="end"> /// The ending value /// </param> /// <param name="duration"> /// The time in miliseconds that the animator must play this path /// </param> /// <param name="function"> /// The animation function /// </param> /// <exception cref="ArgumentOutOfRangeException"> /// Duration is less than zero /// </exception> public Path(float start, float end, ulong duration, AnimationFunctions.Function function) : this(start, end, duration, 0, function) { }
/// <summary> /// Initializes a new instance of the <see cref="Path2D" /> class. /// </summary> /// <param name="start"> /// The starting point or location /// </param> /// <param name="end"> /// The ending point or location /// </param> /// <param name="duration"> /// The time in miliseconds that the animator must play this path /// </param> /// <param name="delay"> /// The time in miliseconds that the animator must wait before playing this path /// </param> /// <param name="function"> /// The animation function /// </param> /// <exception cref="ArgumentOutOfRangeException"> /// Duration is less than zero /// </exception> public Path2D(Float2D start, Float2D end, ulong duration, ulong delay, AnimationFunctions.Function function) : this( new Path(start.X, end.X, duration, delay, function), new Path(start.Y, end.Y, duration, delay, function)) { }
public static Path2D[] ContinueTo(this Path2D[] paths, float endX, float endY, ulong duration, ulong delay, AnimationFunctions.Function function) { return(((IEnumerable <Path2D>)paths).Concat <Path2D>((IEnumerable <Path2D>) new Path2D[1] { new Path2D(((IEnumerable <Path2D>)paths).Last <Path2D>().End, new Float2D(endX, endY), duration, delay, function) }).ToArray <Path2D>()); }
public static Path2D[] ContinueTo(this Path2D[] paths, Float2D end, ulong duration, AnimationFunctions.Function function) { return(((IEnumerable <Path2D>)paths).Concat <Path2D>((IEnumerable <Path2D>) new Path2D[1] { new Path2D(((IEnumerable <Path2D>)paths).Last <Path2D>().End, end, duration, function) }).ToArray <Path2D>()); }
public static Path[] ContinueTo(this Path[] paths, float end, ulong duration, ulong delay, AnimationFunctions.Function function) { return(((IEnumerable <Path>)paths).Concat <Path>((IEnumerable <Path>) new Path[1] { new Path(((IEnumerable <Path>)paths).Last <Path>().End, end, duration, delay, function) }).ToArray <Path>()); }