|
@@ -33,6 +33,10 @@
|
|
|
#include "scene/resources/navigation_mesh_source_geometry_data_3d.h"
|
|
|
#include "servers/navigation_server_3d.h"
|
|
|
|
|
|
+RID NavigationRegion3D::get_rid() const {
|
|
|
+ return region;
|
|
|
+}
|
|
|
+
|
|
|
void NavigationRegion3D::set_enabled(bool p_enabled) {
|
|
|
if (enabled == p_enabled) {
|
|
|
return;
|
|
@@ -154,7 +158,7 @@ real_t NavigationRegion3D::get_travel_cost() const {
|
|
|
}
|
|
|
|
|
|
RID NavigationRegion3D::get_region_rid() const {
|
|
|
- return region;
|
|
|
+ return get_rid();
|
|
|
}
|
|
|
|
|
|
void NavigationRegion3D::_notification(int p_what) {
|
|
@@ -275,6 +279,8 @@ PackedStringArray NavigationRegion3D::get_configuration_warnings() const {
|
|
|
}
|
|
|
|
|
|
void NavigationRegion3D::_bind_methods() {
|
|
|
+ ClassDB::bind_method(D_METHOD("get_rid"), &NavigationRegion3D::get_rid);
|
|
|
+
|
|
|
ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navigation_mesh"), &NavigationRegion3D::set_navigation_mesh);
|
|
|
ClassDB::bind_method(D_METHOD("get_navigation_mesh"), &NavigationRegion3D::get_navigation_mesh);
|
|
|
|
|
@@ -410,6 +416,9 @@ NavigationRegion3D::NavigationRegion3D() {
|
|
|
NavigationServer3D::get_singleton()->region_set_owner_id(region, get_instance_id());
|
|
|
NavigationServer3D::get_singleton()->region_set_enter_cost(region, get_enter_cost());
|
|
|
NavigationServer3D::get_singleton()->region_set_travel_cost(region, get_travel_cost());
|
|
|
+ NavigationServer3D::get_singleton()->region_set_navigation_layers(region, navigation_layers);
|
|
|
+ NavigationServer3D::get_singleton()->region_set_use_edge_connections(region, use_edge_connections);
|
|
|
+ NavigationServer3D::get_singleton()->region_set_enabled(region, enabled);
|
|
|
|
|
|
#ifdef DEBUG_ENABLED
|
|
|
NavigationServer3D::get_singleton()->connect(SNAME("map_changed"), callable_mp(this, &NavigationRegion3D::_navigation_map_changed));
|