diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-15 00:59:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-15 00:59:37 +0200 |
commit | 4f9c46df487a2b7698ff3dde38bb6ca1259facce (patch) | |
tree | 0196164bf0096f47654d4eb361b6166908451ddf /scene/3d | |
parent | f9f3db443e1c3004f1c4418967d9c900c8923692 (diff) | |
parent | 245da150e7a3eb17435f64afd25939ad669e0901 (diff) |
Merge pull request #62052 from smix8/navigation_layer_functions_4.x
Streamline Navigation layer function names.
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/navigation_agent_3d.cpp | 22 | ||||
-rw-r--r-- | scene/3d/navigation_agent_3d.h | 6 | ||||
-rw-r--r-- | scene/3d/navigation_region_3d.cpp | 14 | ||||
-rw-r--r-- | scene/3d/navigation_region_3d.h | 4 |
4 files changed, 23 insertions, 23 deletions
diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp index 425c5df126..09d75dd284 100644 --- a/scene/3d/navigation_agent_3d.cpp +++ b/scene/3d/navigation_agent_3d.cpp @@ -65,8 +65,8 @@ void NavigationAgent3D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_path_max_distance", "max_speed"), &NavigationAgent3D::set_path_max_distance); ClassDB::bind_method(D_METHOD("get_path_max_distance"), &NavigationAgent3D::get_path_max_distance); - ClassDB::bind_method(D_METHOD("set_navigable_layers", "navigable_layers"), &NavigationAgent3D::set_navigable_layers); - ClassDB::bind_method(D_METHOD("get_navigable_layers"), &NavigationAgent3D::get_navigable_layers); + ClassDB::bind_method(D_METHOD("set_navigation_layers", "navigation_layers"), &NavigationAgent3D::set_navigation_layers); + ClassDB::bind_method(D_METHOD("get_navigation_layers"), &NavigationAgent3D::get_navigation_layers); ClassDB::bind_method(D_METHOD("set_navigation_map", "navigation_map"), &NavigationAgent3D::set_navigation_map); ClassDB::bind_method(D_METHOD("get_navigation_map"), &NavigationAgent3D::get_navigation_map); @@ -95,7 +95,7 @@ void NavigationAgent3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_max_distance", PROPERTY_HINT_RANGE, "0.01,100,0.1,suffix:m"), "set_path_max_distance", "get_path_max_distance"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ignore_y"), "set_ignore_y", "get_ignore_y"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "avoidance_enabled"), "set_avoidance_enabled", "get_avoidance_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "navigable_layers", PROPERTY_HINT_LAYERS_3D_NAVIGATION), "set_navigable_layers", "get_navigable_layers"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "navigation_layers", PROPERTY_HINT_LAYERS_3D_NAVIGATION), "set_navigation_layers", "get_navigation_layers"); ADD_SIGNAL(MethodInfo("path_changed")); ADD_SIGNAL(MethodInfo("target_reached")); @@ -214,16 +214,16 @@ void NavigationAgent3D::set_agent_parent(Node *p_agent_parent) { } } -void NavigationAgent3D::set_navigable_layers(uint32_t p_layers) { - bool layers_changed = navigable_layers != p_layers; - navigable_layers = p_layers; - if (layers_changed) { +void NavigationAgent3D::set_navigation_layers(uint32_t p_navigation_layers) { + bool navigation_layers_changed = navigation_layers != p_navigation_layers; + navigation_layers = p_navigation_layers; + if (navigation_layers_changed) { _request_repath(); } } -uint32_t NavigationAgent3D::get_navigable_layers() const { - return navigable_layers; +uint32_t NavigationAgent3D::get_navigation_layers() const { + return navigation_layers; } void NavigationAgent3D::set_navigation_map(RID p_navigation_map) { @@ -400,9 +400,9 @@ void NavigationAgent3D::update_navigation() { if (reload_path) { if (map_override.is_valid()) { - navigation_path = NavigationServer3D::get_singleton()->map_get_path(map_override, o, target_location, true, navigable_layers); + navigation_path = NavigationServer3D::get_singleton()->map_get_path(map_override, o, target_location, true, navigation_layers); } else { - navigation_path = NavigationServer3D::get_singleton()->map_get_path(agent_parent->get_world_3d()->get_navigation_map(), o, target_location, true, navigable_layers); + navigation_path = NavigationServer3D::get_singleton()->map_get_path(agent_parent->get_world_3d()->get_navigation_map(), o, target_location, true, navigation_layers); } navigation_finished = false; nav_path_index = 0; diff --git a/scene/3d/navigation_agent_3d.h b/scene/3d/navigation_agent_3d.h index 8e5cb83f6e..d0eaead3f1 100644 --- a/scene/3d/navigation_agent_3d.h +++ b/scene/3d/navigation_agent_3d.h @@ -45,7 +45,7 @@ class NavigationAgent3D : public Node { RID map_override; bool avoidance_enabled = false; - uint32_t navigable_layers = 1; + uint32_t navigation_layers = 1; real_t target_desired_distance = 1.0; real_t radius = 0.0; @@ -87,8 +87,8 @@ public: void set_agent_parent(Node *p_agent_parent); - void set_navigable_layers(uint32_t p_layers); - uint32_t get_navigable_layers() const; + void set_navigation_layers(uint32_t p_navigation_layers); + uint32_t get_navigation_layers() const; void set_navigation_map(RID p_navigation_map); RID get_navigation_map() const; diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp index dda1382814..7ef16fbc0a 100644 --- a/scene/3d/navigation_region_3d.cpp +++ b/scene/3d/navigation_region_3d.cpp @@ -65,12 +65,12 @@ bool NavigationRegion3D::is_enabled() const { return enabled; } -void NavigationRegion3D::set_layers(uint32_t p_layers) { - NavigationServer3D::get_singleton()->region_set_layers(region, p_layers); +void NavigationRegion3D::set_navigation_layers(uint32_t p_navigation_layers) { + NavigationServer3D::get_singleton()->region_set_navigation_layers(region, p_navigation_layers); } -uint32_t NavigationRegion3D::get_layers() const { - return NavigationServer3D::get_singleton()->region_get_layers(region); +uint32_t NavigationRegion3D::get_navigation_layers() const { + return NavigationServer3D::get_singleton()->region_get_navigation_layers(region); } void NavigationRegion3D::set_enter_cost(real_t p_enter_cost) { @@ -239,8 +239,8 @@ void NavigationRegion3D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationRegion3D::set_enabled); ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationRegion3D::is_enabled); - ClassDB::bind_method(D_METHOD("set_layers", "layers"), &NavigationRegion3D::set_layers); - ClassDB::bind_method(D_METHOD("get_layers"), &NavigationRegion3D::get_layers); + ClassDB::bind_method(D_METHOD("set_navigation_layers", "navigation_layers"), &NavigationRegion3D::set_navigation_layers); + ClassDB::bind_method(D_METHOD("get_navigation_layers"), &NavigationRegion3D::get_navigation_layers); ClassDB::bind_method(D_METHOD("get_region_rid"), &NavigationRegion3D::get_region_rid); @@ -255,7 +255,7 @@ void NavigationRegion3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "navmesh", PROPERTY_HINT_RESOURCE_TYPE, "NavigationMesh"), "set_navigation_mesh", "get_navigation_mesh"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enabled"), "set_enabled", "is_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "layers", PROPERTY_HINT_LAYERS_3D_NAVIGATION), "set_layers", "get_layers"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "navigation_layers", PROPERTY_HINT_LAYERS_3D_NAVIGATION), "set_navigation_layers", "get_navigation_layers"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "enter_cost"), "set_enter_cost", "get_enter_cost"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "travel_cost"), "set_travel_cost", "get_travel_cost"); diff --git a/scene/3d/navigation_region_3d.h b/scene/3d/navigation_region_3d.h index 042684c5b7..92474d1429 100644 --- a/scene/3d/navigation_region_3d.h +++ b/scene/3d/navigation_region_3d.h @@ -57,8 +57,8 @@ public: void set_enabled(bool p_enabled); bool is_enabled() const; - void set_layers(uint32_t p_layers); - uint32_t get_layers() const; + void set_navigation_layers(uint32_t p_navigation_layers); + uint32_t get_navigation_layers() const; RID get_region_rid() const; |