Renamed neighbor_dist properties / getters / setters for the navigation server.

This commit is contained in:
Relintai 2023-06-12 08:37:57 +02:00
parent 6b95f31b70
commit de1763d40d
22 changed files with 44 additions and 44 deletions

View File

@ -112,7 +112,7 @@
Sets the maximum speed of the agent. Must be positive.
</description>
</method>
<method name="agent_set_neighbor_dist">
<method name="agent_set_neighbor_distance">
<return type="void" />
<argument index="0" name="agent" type="RID" />
<argument index="1" name="dist" type="float" />

View File

@ -186,7 +186,7 @@
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
A bitfield determining all navigation map layers the [NavigationAgent] belongs to. On path requests the agent will ignore navmeshes without at least one matching layer.
</member>
<member name="neighbor_dist" type="float" setter="set_neighbor_dist" getter="get_neighbor_dist" default="0.0">
<member name="neighbor_distance" type="float" setter="set_neighbor_distance" getter="get_neighbor_distance" default="0.0">
The distance to search for other agents.
</member>
<member name="path_desired_distance" type="float" setter="set_path_desired_distance" getter="get_path_desired_distance" default="1.0">
@ -202,7 +202,7 @@
Additional information to return with the navigation path.
</member>
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0">
The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_dist]).
The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_distance]).
Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size.
</member>
<member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="1.0">

View File

@ -186,7 +186,7 @@
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
A bitfield determining all navigation map layers the [NavigationAgent2D] belongs to. On path requests the agent will ignore navmeshes without at least one matching layer.
</member>
<member name="neighbor_dist" type="float" setter="set_neighbor_dist" getter="get_neighbor_dist" default="0.0">
<member name="neighbor_distance" type="float" setter="set_neighbor_distance" getter="get_neighbor_distance" default="0.0">
The distance to search for other agents.
</member>
<member name="path_desired_distance" type="float" setter="set_path_desired_distance" getter="get_path_desired_distance" default="1.0">
@ -199,7 +199,7 @@
Additional information to return with the navigation path.
</member>
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="0.0">
The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_dist]).
The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_distance]).
Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size.
</member>
<member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="1.0">

View File

@ -127,7 +127,7 @@
Sets the maximum speed of the agent. Must be positive.
</description>
</method>
<method name="agent_set_neighbor_dist">
<method name="agent_set_neighbor_distance">
<return type="void" />
<argument index="0" name="agent" type="RID" />
<argument index="1" name="dist" type="float" />

View File

@ -36290,7 +36290,7 @@ msgstr ""
msgid ""
"The radius of the avoidance agent. This is the \"body\" of the avoidance "
"agent and not the avoidance maneuver starting radius (which is controlled by "
"[member neighbor_dist]).\n"
"[member neighbor_distance]).\n"
"Does not affect normal pathfinding. To change an actor's pathfinding radius "
"bake [NavigationMesh] resources with a different [member NavigationMesh."
"agent_radius] property and use different navigation maps for each actor size."
@ -36401,7 +36401,7 @@ msgstr ""
msgid ""
"The radius of the avoidance agent. This is the \"body\" of the avoidance "
"agent and not the avoidance maneuver starting radius (which is controlled by "
"[member neighbor_dist]).\n"
"[member neighbor_distance]).\n"
"Does not affect normal pathfinding."
msgstr ""

View File

@ -36370,7 +36370,7 @@ msgstr ""
msgid ""
"The radius of the avoidance agent. This is the \"body\" of the avoidance "
"agent and not the avoidance maneuver starting radius (which is controlled by "
"[member neighbor_dist]).\n"
"[member neighbor_distance]).\n"
"Does not affect normal pathfinding. To change an actor's pathfinding radius "
"bake [NavigationMesh] resources with a different [member NavigationMesh."
"agent_radius] property and use different navigation maps for each actor size."
@ -36484,7 +36484,7 @@ msgstr ""
msgid ""
"The radius of the avoidance agent. This is the \"body\" of the avoidance "
"agent and not the avoidance maneuver starting radius (which is controlled by "
"[member neighbor_dist]).\n"
"[member neighbor_distance]).\n"
"Does not affect normal pathfinding."
msgstr ""

View File

@ -322,7 +322,7 @@ bool FORWARD_1_C(agent_get_avoidance_enabled, RID, p_agent, rid_to_rid);
void FORWARD_2(agent_set_map, RID, p_agent, RID, p_map, rid_to_rid, rid_to_rid);
void FORWARD_2(agent_set_neighbor_dist, RID, p_agent, real_t, p_dist, rid_to_rid, real_to_real);
void FORWARD_2(agent_set_neighbor_distance, RID, p_agent, real_t, p_dist, rid_to_rid, real_to_real);
void FORWARD_2(agent_set_max_neighbors, RID, p_agent, int, p_count, rid_to_rid, int_to_int);

View File

@ -186,7 +186,7 @@ public:
/// time of the simulation. If the number is too
/// low, the simulation will not be safe.
/// Must be non-negative.
virtual void agent_set_neighbor_dist(RID p_agent, real_t p_dist);
virtual void agent_set_neighbor_distance(RID p_agent, real_t p_dist);
/// The maximum number of other agents this
/// agent takes into account in the navigation.

View File

@ -730,7 +730,7 @@ COMMAND_2(agent_set_map, RID, p_agent, RID, p_map) {
}
}
COMMAND_2(agent_set_neighbor_dist, RID, p_agent, real_t, p_dist) {
COMMAND_2(agent_set_neighbor_distance, RID, p_agent, real_t, p_dist) {
NavAgent *agent = agent_owner.getornull(p_agent);
ERR_FAIL_COND(agent == nullptr);

View File

@ -185,7 +185,7 @@ public:
virtual bool agent_get_use_3d_avoidance(RID p_agent) const;
COMMAND_2(agent_set_map, RID, p_agent, RID, p_map);
virtual RID agent_get_map(RID p_agent) const;
COMMAND_2(agent_set_neighbor_dist, RID, p_agent, real_t, p_dist);
COMMAND_2(agent_set_neighbor_distance, RID, p_agent, real_t, p_dist);
COMMAND_2(agent_set_max_neighbors, RID, p_agent, int, p_count);
COMMAND_2(agent_set_time_horizon_agents, RID, p_agent, real_t, p_time_horizon);
COMMAND_2(agent_set_time_horizon_obstacles, RID, p_agent, real_t, p_time_horizon);

View File

@ -79,7 +79,7 @@ public:
virtual RID agent_get_map(RID p_agent) const { return RID(); }
virtual void agent_set_avoidance_enabled(RID p_agent, bool p_enabled) {}
virtual bool agent_get_avoidance_enabled(RID p_agent) const { return false; }
virtual void agent_set_neighbor_dist(RID p_agent, real_t p_dist) {}
virtual void agent_set_neighbor_distance(RID p_agent, real_t p_dist) {}
virtual void agent_set_max_neighbors(RID p_agent, int p_count) {}
virtual void agent_set_time_horizon_agents(RID p_agent, real_t p_time_horizon) {}
virtual void agent_set_time_horizon_obstacles(RID p_agent, real_t p_time_horizon) {}

View File

@ -83,7 +83,7 @@ public:
virtual bool agent_get_avoidance_enabled(RID p_agent) const { return false; }
virtual void agent_set_use_3d_avoidance(RID p_agent, bool p_enabled) {}
virtual bool agent_get_use_3d_avoidance(RID p_agent) const { return false; }
virtual void agent_set_neighbor_dist(RID p_agent, real_t p_dist) {}
virtual void agent_set_neighbor_distance(RID p_agent, real_t p_dist) {}
virtual void agent_set_max_neighbors(RID p_agent, int p_count) {}
virtual void agent_set_time_horizon_agents(RID p_agent, real_t p_time_horizon) {}
virtual void agent_set_time_horizon_obstacles(RID p_agent, real_t p_time_horizon) {}

View File

@ -57,8 +57,8 @@ void NavigationAgent2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_navigation", "navigation"), &NavigationAgent2D::set_navigation_node);
ClassDB::bind_method(D_METHOD("get_navigation"), &NavigationAgent2D::get_navigation_node);
ClassDB::bind_method(D_METHOD("set_neighbor_dist", "neighbor_dist"), &NavigationAgent2D::set_neighbor_dist);
ClassDB::bind_method(D_METHOD("get_neighbor_dist"), &NavigationAgent2D::get_neighbor_dist);
ClassDB::bind_method(D_METHOD("set_neighbor_distance", "neighbor_distance"), &NavigationAgent2D::set_neighbor_distance);
ClassDB::bind_method(D_METHOD("get_neighbor_distance"), &NavigationAgent2D::get_neighbor_distance);
ClassDB::bind_method(D_METHOD("set_max_neighbors", "max_neighbors"), &NavigationAgent2D::set_max_neighbors);
ClassDB::bind_method(D_METHOD("get_max_neighbors"), &NavigationAgent2D::get_max_neighbors);
@ -130,7 +130,7 @@ void NavigationAgent2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "avoidance_enabled"), "set_avoidance_enabled", "get_avoidance_enabled");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "velocity", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_velocity", "get_velocity");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.1,500,0.01"), "set_radius", "get_radius");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "neighbor_dist", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_neighbor_dist", "get_neighbor_dist");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "neighbor_distance", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_neighbor_distance", "get_neighbor_distance");
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_neighbors", PROPERTY_HINT_RANGE, "1,10000,1,or_greater"), "set_max_neighbors", "get_max_neighbors");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_horizon_agents", PROPERTY_HINT_RANGE, "0.0,10,0.01,or_greater,suffix:s"), "set_time_horizon_agents", "get_time_horizon_agents");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_horizon_obstacles", PROPERTY_HINT_RANGE, "0.0,10,0.01,or_greater,suffix:s"), "set_time_horizon_obstacles", "get_time_horizon_obstacles");
@ -293,7 +293,7 @@ NavigationAgent2D::NavigationAgent2D() {
navigation_finished = true;
agent = Navigation2DServer::get_singleton()->agent_create();
set_neighbor_dist(500.0);
set_neighbor_distance(500.0);
set_max_neighbors(10);
set_time_horizon_agents(1.0);
set_time_horizon_obstacles(0.0);
@ -529,9 +529,9 @@ void NavigationAgent2D::set_radius(real_t p_radius) {
Navigation2DServer::get_singleton()->agent_set_radius(agent, radius);
}
void NavigationAgent2D::set_neighbor_dist(real_t p_dist) {
neighbor_dist = p_dist;
Navigation2DServer::get_singleton()->agent_set_neighbor_dist(agent, neighbor_dist);
void NavigationAgent2D::set_neighbor_distance(real_t p_dist) {
neighbor_distance = p_dist;
Navigation2DServer::get_singleton()->agent_set_neighbor_distance(agent, neighbor_distance);
}
void NavigationAgent2D::set_max_neighbors(int p_count) {

View File

@ -57,7 +57,7 @@ class NavigationAgent2D : public Node {
real_t path_desired_distance;
real_t target_desired_distance;
real_t radius;
real_t neighbor_dist;
real_t neighbor_distance;
int max_neighbors;
real_t time_horizon_agents;
real_t time_horizon_obstacles;
@ -166,9 +166,9 @@ public:
return radius;
}
void set_neighbor_dist(real_t p_dist);
real_t get_neighbor_dist() const {
return neighbor_dist;
void set_neighbor_distance(real_t p_dist);
real_t get_neighbor_distance() const {
return neighbor_distance;
}
void set_max_neighbors(int p_count);

View File

@ -168,7 +168,7 @@ NavigationObstacle2D::NavigationObstacle2D() {
fake_agent = Navigation2DServer::get_singleton()->agent_create();
// change properties of the fake agent so it can act as fake obstacle with a radius
Navigation2DServer::get_singleton()->agent_set_neighbor_dist(fake_agent, 0.0);
Navigation2DServer::get_singleton()->agent_set_neighbor_distance(fake_agent, 0.0);
Navigation2DServer::get_singleton()->agent_set_max_neighbors(fake_agent, 0);
Navigation2DServer::get_singleton()->agent_set_time_horizon_agents(fake_agent, 0.0);
Navigation2DServer::get_singleton()->agent_set_time_horizon_obstacles(fake_agent, 0.0);

View File

@ -71,8 +71,8 @@ void NavigationAgent::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_navigation_map", "navigation_map"), &NavigationAgent::set_navigation_map);
ClassDB::bind_method(D_METHOD("get_navigation_map"), &NavigationAgent::get_navigation_map);
ClassDB::bind_method(D_METHOD("set_neighbor_dist", "neighbor_dist"), &NavigationAgent::set_neighbor_dist);
ClassDB::bind_method(D_METHOD("get_neighbor_dist"), &NavigationAgent::get_neighbor_dist);
ClassDB::bind_method(D_METHOD("set_neighbor_distance", "neighbor_distance"), &NavigationAgent::set_neighbor_distance);
ClassDB::bind_method(D_METHOD("get_neighbor_distance"), &NavigationAgent::get_neighbor_distance);
ClassDB::bind_method(D_METHOD("set_max_neighbors", "max_neighbors"), &NavigationAgent::set_max_neighbors);
ClassDB::bind_method(D_METHOD("get_max_neighbors"), &NavigationAgent::get_max_neighbors);
@ -145,7 +145,7 @@ void NavigationAgent::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "velocity", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_velocity", "get_velocity");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "0.01,100,0.01,or_greater,suffix:m"), "set_height", "get_height");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.01,100,0.01,or_greater,suffix:m"), "set_radius", "get_radius");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "neighbor_dist", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_neighbor_dist", "get_neighbor_dist");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "neighbor_distance", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_neighbor_distance", "get_neighbor_distance");
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_neighbors", PROPERTY_HINT_RANGE, "1,10000,1"), "set_max_neighbors", "get_max_neighbors");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_horizon_agents", PROPERTY_HINT_RANGE, "0.0,10,0.01,or_greater,suffix:s"), "set_time_horizon_agents", "get_time_horizon_agents");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_horizon_obstacles", PROPERTY_HINT_RANGE, "0.0,10,0.01,or_greater,suffix:s"), "set_time_horizon_obstacles", "get_time_horizon_obstacles");
@ -319,7 +319,7 @@ NavigationAgent::NavigationAgent() {
agent = NavigationServer::get_singleton()->agent_create();
NavigationServer::get_singleton()->agent_set_neighbor_dist(agent, neighbor_dist);
NavigationServer::get_singleton()->agent_set_neighbor_distance(agent, neighbor_distance);
NavigationServer::get_singleton()->agent_set_max_neighbors(agent, max_neighbors);
NavigationServer::get_singleton()->agent_set_time_horizon_agents(agent, time_horizon_agents);
NavigationServer::get_singleton()->agent_set_time_horizon_obstacles(agent, time_horizon_obstacles);
@ -506,9 +506,9 @@ void NavigationAgent::set_use_3d_avoidance(bool p_use_3d_avoidance) {
property_list_changed_notify();
}
void NavigationAgent::set_neighbor_dist(real_t p_dist) {
neighbor_dist = p_dist;
NavigationServer::get_singleton()->agent_set_neighbor_dist(agent, neighbor_dist);
void NavigationAgent::set_neighbor_distance(real_t p_dist) {
neighbor_distance = p_dist;
NavigationServer::get_singleton()->agent_set_neighbor_distance(agent, neighbor_distance);
}
void NavigationAgent::set_max_neighbors(int p_count) {

View File

@ -64,7 +64,7 @@ class NavigationAgent : public Node {
real_t height;
real_t radius;
real_t path_height_offset;
real_t neighbor_dist;
real_t neighbor_distance;
int max_neighbors;
real_t time_horizon_agents;
real_t time_horizon_obstacles;
@ -191,9 +191,9 @@ public:
void set_use_3d_avoidance(bool p_use_3d_avoidance);
bool get_use_3d_avoidance() const { return use_3d_avoidance; }
void set_neighbor_dist(real_t p_dist);
real_t get_neighbor_dist() const {
return neighbor_dist;
void set_neighbor_distance(real_t p_dist);
real_t get_neighbor_distance() const {
return neighbor_distance;
}
void set_max_neighbors(int p_count);

View File

@ -198,7 +198,7 @@ NavigationObstacle::NavigationObstacle() {
fake_agent = NavigationServer::get_singleton()->agent_create();
// change properties of the fake agent so it can act as fake obstacle with a radius
NavigationServer::get_singleton()->agent_set_neighbor_dist(fake_agent, 0.0);
NavigationServer::get_singleton()->agent_set_neighbor_distance(fake_agent, 0.0);
NavigationServer::get_singleton()->agent_set_max_neighbors(fake_agent, 0);
NavigationServer::get_singleton()->agent_set_time_horizon_agents(fake_agent, 0.0);
NavigationServer::get_singleton()->agent_set_time_horizon_obstacles(fake_agent, 0.0);

View File

@ -106,7 +106,7 @@ void Navigation2DServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("agent_get_avoidance_enabled", "agent"), &Navigation2DServer::agent_get_avoidance_enabled);
ClassDB::bind_method(D_METHOD("agent_set_map", "agent", "map"), &Navigation2DServer::agent_set_map);
ClassDB::bind_method(D_METHOD("agent_get_map", "agent"), &Navigation2DServer::agent_get_map);
ClassDB::bind_method(D_METHOD("agent_set_neighbor_dist", "agent", "dist"), &Navigation2DServer::agent_set_neighbor_dist);
ClassDB::bind_method(D_METHOD("agent_set_neighbor_distance", "agent", "dist"), &Navigation2DServer::agent_set_neighbor_distance);
ClassDB::bind_method(D_METHOD("agent_set_max_neighbors", "agent", "count"), &Navigation2DServer::agent_set_max_neighbors);
ClassDB::bind_method(D_METHOD("agent_set_time_horizon_agents", "agent", "time_horizon"), &Navigation2DServer::agent_set_time_horizon_agents);
ClassDB::bind_method(D_METHOD("agent_set_time_horizon_obstacles", "agent", "time_horizon"), &Navigation2DServer::agent_set_time_horizon_obstacles);

View File

@ -193,7 +193,7 @@ public:
/// time of the simulation. If the number is too
/// low, the simulation will not be safe.
/// Must be non-negative.
virtual void agent_set_neighbor_dist(RID p_agent, real_t p_dist) = 0;
virtual void agent_set_neighbor_distance(RID p_agent, real_t p_dist) = 0;
/// The maximum number of other agents this
/// agent takes into account in the navigation.

View File

@ -128,7 +128,7 @@ void NavigationServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("agent_set_map", "agent", "map"), &NavigationServer::agent_set_map);
ClassDB::bind_method(D_METHOD("agent_get_map", "agent"), &NavigationServer::agent_get_map);
ClassDB::bind_method(D_METHOD("agent_set_neighbor_dist", "agent", "dist"), &NavigationServer::agent_set_neighbor_dist);
ClassDB::bind_method(D_METHOD("agent_set_neighbor_distance", "agent", "dist"), &NavigationServer::agent_set_neighbor_distance);
ClassDB::bind_method(D_METHOD("agent_set_max_neighbors", "agent", "count"), &NavigationServer::agent_set_max_neighbors);
ClassDB::bind_method(D_METHOD("agent_set_time_horizon_agents", "agent", "time_horizon"), &NavigationServer::agent_set_time_horizon_agents);
ClassDB::bind_method(D_METHOD("agent_set_time_horizon_obstacles", "agent", "time_horizon"), &NavigationServer::agent_set_time_horizon_obstacles);

View File

@ -212,7 +212,7 @@ public:
/// time of the simulation. If the number is too
/// low, the simulation will not be safe.
/// Must be non-negative.
virtual void agent_set_neighbor_dist(RID p_agent, real_t p_dist) = 0;
virtual void agent_set_neighbor_distance(RID p_agent, real_t p_dist) = 0;
/// The maximum number of other agents this
/// agent takes into account in the navigation.