EdgeSampler.cs 821 B

123456789101112131415161718192021222324252627
  1. using System.Collections.Generic;
  2. using DotRecast.Core;
  3. using static DotRecast.Core.RcMath;
  4. namespace DotRecast.Detour.Extras.Jumplink
  5. {
  6. public class EdgeSampler
  7. {
  8. public readonly GroundSegment start = new GroundSegment();
  9. public readonly List<GroundSegment> end = new List<GroundSegment>();
  10. public readonly Trajectory trajectory;
  11. public readonly RcVec3f ax = new RcVec3f();
  12. public readonly RcVec3f ay = new RcVec3f();
  13. public readonly RcVec3f az = new RcVec3f();
  14. public EdgeSampler(JumpEdge edge, Trajectory trajectory)
  15. {
  16. this.trajectory = trajectory;
  17. ax = edge.sq.Subtract(edge.sp);
  18. ax.Normalize();
  19. az.Set(ax.z, 0, -ax.x);
  20. az.Normalize();
  21. ay.Set(0, 1, 0);
  22. }
  23. }
  24. }