summaryrefslogtreecommitdiffstats
path: root/modules/navigation/nav_region.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/navigation/nav_region.h')
-rw-r--r--modules/navigation/nav_region.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/modules/navigation/nav_region.h b/modules/navigation/nav_region.h
index a9cfc53c7e..c015802b92 100644
--- a/modules/navigation/nav_region.h
+++ b/modules/navigation/nav_region.h
@@ -34,13 +34,14 @@
#include "nav_base.h"
#include "nav_utils.h"
+#include "core/os/rw_lock.h"
#include "scene/resources/navigation_mesh.h"
class NavRegion : public NavBase {
+ RWLock region_rwlock;
+
NavMap *map = nullptr;
Transform3D transform;
- Ref<NavigationMesh> mesh;
- Vector<gd::Edge::Connection> connections;
bool enabled = true;
bool use_edge_connections = true;
@@ -52,6 +53,10 @@ class NavRegion : public NavBase {
real_t surface_area = 0.0;
+ RWLock navmesh_rwlock;
+ Vector<Vector3> pending_navmesh_vertices;
+ Vector<Vector<int>> pending_navmesh_polygons;
+
public:
NavRegion() {
type = NavigationUtilities::PathSegmentType::PATH_SEGMENT_TYPE_REGION;
@@ -79,22 +84,14 @@ public:
return transform;
}
- void set_mesh(Ref<NavigationMesh> p_mesh);
- const Ref<NavigationMesh> get_mesh() const {
- return mesh;
- }
-
- Vector<gd::Edge::Connection> &get_connections() {
- return connections;
- }
- int get_connections_count() const;
- Vector3 get_connection_pathway_start(int p_connection_id) const;
- Vector3 get_connection_pathway_end(int p_connection_id) const;
+ void set_navigation_mesh(Ref<NavigationMesh> p_navigation_mesh);
LocalVector<gd::Polygon> const &get_polygons() const {
return polygons;
}
+ Vector3 get_closest_point_to_segment(const Vector3 &p_from, const Vector3 &p_to, bool p_use_collision) const;
+ gd::ClosestPointQueryResult get_closest_point_info(const Vector3 &p_point) const;
Vector3 get_random_point(uint32_t p_navigation_layers, bool p_uniformly) const;
real_t get_surface_area() const { return surface_area; };