summaryrefslogtreecommitdiff
path: root/scene/2d/navigation_agent_2d.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/navigation_agent_2d.h')
-rw-r--r--scene/2d/navigation_agent_2d.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/scene/2d/navigation_agent_2d.h b/scene/2d/navigation_agent_2d.h
index dcedc6506a..0e494a0512 100644
--- a/scene/2d/navigation_agent_2d.h
+++ b/scene/2d/navigation_agent_2d.h
@@ -41,21 +41,24 @@ class NavigationAgent2D : public Node {
Node2D *agent_parent = nullptr;
RID agent;
+ RID map_before_pause;
+ RID map_override;
- uint32_t navigable_layers = 1;
+ bool avoidance_enabled = false;
+ uint32_t navigation_layers = 1;
real_t target_desired_distance = 1.0;
- real_t radius;
- real_t neighbor_dist;
- int max_neighbors;
- real_t time_horizon;
- real_t max_speed;
+ real_t radius = 0.0;
+ real_t neighbor_dist = 0.0;
+ int max_neighbors = 0;
+ real_t time_horizon = 0.0;
+ real_t max_speed = 0.0;
real_t path_max_distance = 3.0;
Vector2 target_location;
Vector<Vector2> navigation_path;
- int nav_path_index;
+ int nav_path_index = 0;
bool velocity_submitted = false;
Vector2 prev_safe_velocity;
/// The submitted target velocity
@@ -63,7 +66,7 @@ class NavigationAgent2D : public Node {
bool target_reached = false;
bool navigation_finished = true;
// No initialized on purpose
- uint32_t update_frame_id;
+ uint32_t update_frame_id = 0;
protected:
static void _bind_methods();
@@ -77,8 +80,16 @@ public:
return agent;
}
- void set_navigable_layers(uint32_t p_layers);
- uint32_t get_navigable_layers() const;
+ void set_avoidance_enabled(bool p_enabled);
+ bool get_avoidance_enabled() const;
+
+ void set_agent_parent(Node *p_agent_parent);
+
+ 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;
void set_target_desired_distance(real_t p_dd);
real_t get_target_desired_distance() const {
@@ -139,6 +150,7 @@ public:
private:
void update_navigation();
+ void _request_repath();
void _check_distance_to_target();
};