aboutsummaryrefslogtreecommitdiff
path: root/scene/resources/polygon_path_finder.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--scene/resources/polygon_path_finder.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/scene/resources/polygon_path_finder.h b/scene/resources/polygon_path_finder.h
index 31253e317..002ce709e 100644
--- a/scene/resources/polygon_path_finder.h
+++ b/scene/resources/polygon_path_finder.h
@@ -31,15 +31,18 @@ class PolygonPathFinder : public Resource {
if (a>b) {
SWAP(a,b);
}
+ points[0] = a;
+ points[1] = b;
}
};
Vector2 outside_point;
+ Rect2 bounds;
Vector<Point> points;
Set<Edge> edges;
- bool _is_point_inside(const Vector2& p_point);
+ bool _is_point_inside(const Vector2& p_point) const;
void _set_data(const Dictionary& p_data);
Dictionary _get_data() const;
@@ -52,6 +55,12 @@ public:
void setup(const Vector<Vector2>& p_points, const Vector<int>& p_connections);
Vector<Vector2> find_path(const Vector2& p_from, const Vector2& p_to);
+ bool is_point_inside(const Vector2& p_point) const;
+ Vector2 get_closest_point(const Vector2& p_point) const;
+ Vector<Vector2> get_intersections(const Vector2& p_from, const Vector2& p_to) const;
+ Rect2 get_bounds() const;
+
+
PolygonPathFinder();
};