diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-08 16:05:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 16:05:38 +0200 |
commit | e4994e28179c2cd854e551201e5761317e6508ba (patch) | |
tree | f68be436beeefdeebb9293cc2ff456ed669b9b41 /modules/navigation/nav_region.h | |
parent | 07029e94f4c641df9bb33bffecb8657746f6f8ef (diff) | |
parent | cfdfd304f1ad08b0498eda97b502aaccd95f559d (diff) |
Merge pull request #61739 from smix8/navigation_region_cost_4.x
Diffstat (limited to 'modules/navigation/nav_region.h')
-rw-r--r-- | modules/navigation/nav_region.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/navigation/nav_region.h b/modules/navigation/nav_region.h index 7a6da281c0..acde5de834 100644 --- a/modules/navigation/nav_region.h +++ b/modules/navigation/nav_region.h @@ -46,6 +46,8 @@ class NavRegion : public NavRid { Transform3D transform; Ref<NavigationMesh> mesh; uint32_t layers = 1; + float enter_cost = 0.0; + float travel_cost = 1.0; Vector<gd::Edge::Connection> connections; bool polygons_dirty = true; @@ -65,6 +67,12 @@ public: return map; } + void set_enter_cost(float p_enter_cost) { enter_cost = MAX(p_enter_cost, 0.0); } + float get_enter_cost() const { return enter_cost; } + + void set_travel_cost(float p_travel_cost) { travel_cost = MAX(p_travel_cost, 0.0); } + float get_travel_cost() const { return travel_cost; } + void set_layers(uint32_t p_layers); uint32_t get_layers() const; |