Curve.cs 723 B

1234567891011121314151617181920212223242526272829303132
  1. using UnityEngine;
  2. namespace ARLocation
  3. {
  4. /// <summary>
  5. /// A struct holding a pair of point/tangent values.
  6. /// </summary>
  7. public struct CurvePointData
  8. {
  9. public Vector3 point;
  10. public Vector3 tangent;
  11. }
  12. public abstract class Curve
  13. {
  14. public abstract Vector3 GetPoint(float u);
  15. public abstract CurvePointData GetPointAndTangent(float u);
  16. public abstract Vector3[] Sample(int n);
  17. public abstract float EstimateLength(int n = 100);
  18. public abstract float GetParameterForLength(float s);
  19. public abstract Vector3 GetPointAtLength(float s);
  20. public abstract CurvePointData GetPointAndTangentAtLength(float s);
  21. }
  22. }