diff options
Diffstat (limited to 'scene/2d/navigation_obstacle_2d.h')
-rw-r--r-- | scene/2d/navigation_obstacle_2d.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scene/2d/navigation_obstacle_2d.h b/scene/2d/navigation_obstacle_2d.h index 9cffc2c0c3..a5603f059f 100644 --- a/scene/2d/navigation_obstacle_2d.h +++ b/scene/2d/navigation_obstacle_2d.h @@ -40,8 +40,12 @@ class NavigationObstacle2D : public Node { Node2D *parent_node2d = nullptr; RID agent; + bool estimate_radius = true; + real_t radius = 1.0; + protected: static void _bind_methods(); + void _validate_property(PropertyInfo &p_property) const override; void _notification(int p_what); public: @@ -52,10 +56,21 @@ public: return agent; } + void set_estimate_radius(bool p_estimate_radius); + bool is_radius_estimated() const { + return estimate_radius; + } + void set_radius(real_t p_radius); + real_t get_radius() const { + return radius; + } + TypedArray<String> get_configuration_warnings() const override; private: - void update_agent_shape(); + void initialize_agent(); + void reevaluate_agent_radius(); + real_t estimate_agent_radius() const; }; #endif |