SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
738 B

4 years ago
  1. using UnityEngine;
  2. namespace ARLocation
  3. {
  4. public sealed class LinearSpline : Spline
  5. {
  6. public LinearSpline(Vector3[] points)
  7. {
  8. Points = (Vector3[])points.Clone();
  9. CalculateSegments(100);
  10. }
  11. public override void CalculateSegments(int n)
  12. {
  13. segmentCount = (Points.Length - 1);
  14. segments = new Curve[segmentCount];
  15. lengths = new float[segmentCount];
  16. Length = 0.0f;
  17. for (var i = 0; i < segmentCount; i++)
  18. {
  19. segments[i] = new Line(Points[i], Points[i + 1]);
  20. Length += segments[i].EstimateLength();
  21. lengths[i] = Length;
  22. }
  23. }
  24. }
  25. }