diff options
Diffstat (limited to 'Samples/AnimTest/Animation/BezierPath.cs')
| -rw-r--r-- | Samples/AnimTest/Animation/BezierPath.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Samples/AnimTest/Animation/BezierPath.cs b/Samples/AnimTest/Animation/BezierPath.cs new file mode 100644 index 00000000..a3126e3e --- /dev/null +++ b/Samples/AnimTest/Animation/BezierPath.cs @@ -0,0 +1,34 @@ +// Copyright (c) 2015-2021 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + +using System; +using System.Numerics; + +namespace vke +{ + public class BezierPath : Path + { + public Vector3 ControlPointStart; + public Vector3 ControlPointEnd; + + public BezierPath (Vector3 startPos, Vector3 controlPointStart, + Vector3 controlPointEnd, Vector3 endPos) + :base(startPos, endPos) + { + ControlPointStart = controlPointStart; + ControlPointEnd = controlPointEnd; + } + public BezierPath (Vector3 startPos, Vector3 endPos, Vector3 vUp) + :base(startPos, endPos) + { + ControlPointStart = startPos + vUp; + ControlPointEnd = endPos + vUp; + } + public override Vector3 GetStep (float pos) + { + return Path.CalculateBezierPoint (pos, Start, ControlPointStart, ControlPointEnd, End); + } + } +} + |