aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/AnimTest/Animation/BezierPath.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2022-07-17 20:26:28 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2022-07-17 20:26:28 +0200
commit9d786ab096ed36ea384e03ee5cea498790e31eec (patch)
treeadee54b5b90a35238d5794e9ffd3ebcf65798a06 /Samples/AnimTest/Animation/BezierPath.cs
parent57daad000aa31c7bcfa1f76b90d40da5a21da041 (diff)
wip
Diffstat (limited to 'Samples/AnimTest/Animation/BezierPath.cs')
-rw-r--r--Samples/AnimTest/Animation/BezierPath.cs34
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);
+ }
+ }
+}
+