43 #ifndef ILQGAMES_GEOMETRY_POLYLINE2_H 44 #define ILQGAMES_GEOMETRY_POLYLINE2_H 46 #include <ilqgames/geometry/line_segment2.h> 47 #include <ilqgames/utils/types.h> 49 #include <glog/logging.h> 61 void AddPoint(
const Point2& point);
64 float Length()
const {
return length_; }
69 Point2 ClosestPoint(
const Point2& query,
bool* is_vertex =
nullptr,
71 float* signed_squared_distance =
nullptr,
72 bool* is_endpoint =
nullptr)
const;
77 Point2 PointAt(
float route_pos,
bool* is_vertex =
nullptr,
79 bool* is_endpoint =
nullptr)
const;
82 const std::vector<LineSegment2>& Segments()
const {
return segments_; }
85 std::vector<LineSegment2> segments_;
86 std::vector<float> cumulative_lengths_;