All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LineSegmentMethods.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Geometry.h"
6 #include "VectorMathDecl.h"
7 #include "PolylineInterpolationParams.h"
8 #include <vector>
9 
10 namespace Eegeo
11 {
12  namespace Geometry
13  {
14  namespace LineSegments
15  {
16  double DistanceLineSegmentToPoint(const dv3& lineSegmentStart, const dv3& lineSegmentEnd, const dv3& point, double& out_param);
17  double DistanceSqrLineSegmentToPoint(const dv3& lineSegmentStart, const dv3& lineSegmentEnd, const dv3& point, double& out_param);
18 
19 
20  float DistanceLineSegmentToPoint(const v3& lineSegmentStart, const v3& lineSegmentEnd, const v3& point, float& out_param);
21  float DistanceSqrLineSegmentToPoint(const v3& lineSegmentStart, const v3& lineSegmentEnd, const v3& point, float& out_param);
22  float DistanceBetweenLineSegments(const v3& startA, const v3& endA, const v3& startB, const v3& endB, float& out_paramA, float& paramB);
23  float DistanceSqrBetweenLineSegments(const v3& startA, const v3& endA, const v3& startB, const v3& endB, float& out_paramA, float& paramB);
24  float ProjectPointOntoLineSegment(const v3& lineSegmentStart, const v3& lineSegmentEnd, const v3& point);
25 
26  bool IntersectsSphere(const v3& lineSegmentStart, const v3& lineSegmentEnd, const v3& sphereCentre, float sphereRadiusSq);
27 
32  PolylineInterpolationParams GetPolylineInterpolationParams(const std::vector<double>& polylineParams, const double t);
33 
34  std::vector<double> BuildPolylineParams(const std::vector<dv3>& polylinePoints, double& out_polylineLength);
35 
36  std::vector<float> BuildPolylineParams(const std::vector<v3>& polylinePoints, float& out_polylineLength);
37  }
38  }
39 }