summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/XWeaponTrail/Scripts/SplineControlPoint.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-03-10 14:07:40 +0800
committerchai <chaifix@163.com>2022-03-10 14:07:40 +0800
commit22891bf59032ba88262824255a706d652031384b (patch)
tree7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/ThirdParty/XWeaponTrail/Scripts/SplineControlPoint.cs
parent8b04ea73e540067f83870b61d89db4868fea5e8a (diff)
* move folder
Diffstat (limited to 'Assets/ThirdParty/XWeaponTrail/Scripts/SplineControlPoint.cs')
-rw-r--r--Assets/ThirdParty/XWeaponTrail/Scripts/SplineControlPoint.cs123
1 files changed, 0 insertions, 123 deletions
diff --git a/Assets/ThirdParty/XWeaponTrail/Scripts/SplineControlPoint.cs b/Assets/ThirdParty/XWeaponTrail/Scripts/SplineControlPoint.cs
deleted file mode 100644
index 9f8602c6..00000000
--- a/Assets/ThirdParty/XWeaponTrail/Scripts/SplineControlPoint.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-using UnityEngine;
-using System.Collections;
-
-
-namespace XftWeapon {
- public class SplineControlPoint
- {
- public Vector3 Position;
- public Vector3 Normal;
-
- public int ControlPointIndex = -1;
- public int SegmentIndex = -1;
-
- public float Dist;
-
- protected Spline mSpline;
-
-
- public SplineControlPoint NextControlPoint
- {
- get
- {
- return mSpline.NextControlPoint(this);
- }
- }
-
- public SplineControlPoint PreviousControlPoint
- {
- get
- {
- return mSpline.PreviousControlPoint(this);
- }
- }
-
- public Vector3 NextPosition
- {
- get
- {
- return mSpline.NextPosition(this);
- }
- }
-
-
- public Vector3 PreviousPosition
- {
- get
- {
- return mSpline.PreviousPosition(this);
-
- }
- }
-
-
- public Vector3 NextNormal
- {
- get
- {
- return mSpline.NextNormal(this);
- }
- }
-
-
- public Vector3 PreviousNormal
- {
- get { return mSpline.PreviousNormal(this); }
- }
-
- public bool IsValid
- {
- get
- {
- return (NextControlPoint != null);
- }
- }
-
-
- Vector3 GetNext2Position()
- {
- SplineControlPoint cp = NextControlPoint;
- if (cp != null)
- return cp.NextPosition;
- return NextPosition;
- }
-
-
- Vector3 GetNext2Normal()
- {
- SplineControlPoint cp = NextControlPoint;
- if (cp != null)
- return cp.NextNormal;
-
-
- return Normal;
- }
-
-
- public Vector3 Interpolate(float localF)
- {
- localF = Mathf.Clamp01(localF);
-
- return Spline.CatmulRom(PreviousPosition, Position, NextPosition, GetNext2Position(), localF);
-
- }
-
-
- public Vector3 InterpolateNormal(float localF)
- {
- localF = Mathf.Clamp01(localF);
-
- return Spline.CatmulRom(PreviousNormal, Normal, NextNormal, GetNext2Normal(), localF);
- }
-
-
- public void Init(Spline owner)
- {
- mSpline = owner;
- SegmentIndex = -1;
- }
-
- }
-}
-
-