Skip to content

Commit fcde7d0

Browse files
committed
Add navigation path query parameter limits
Adds navigation path query parameter limits.
1 parent 1f56d96 commit fcde7d0

23 files changed

+703
-1
lines changed

doc/classes/NavigationAgent2D.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@
7575
Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
7676
</description>
7777
</method>
78+
<method name="get_path_length" qualifiers="const">
79+
<return type="float" />
80+
<description>
81+
Returns the length of the path.
82+
</description>
83+
</method>
7884
<method name="get_rid" qualifiers="const">
7985
<return type="RID" />
8086
<description>
@@ -191,6 +197,19 @@
191197
<member name="path_postprocessing" type="int" setter="set_path_postprocessing" getter="get_path_postprocessing" enum="NavigationPathQueryParameters2D.PathPostProcessing" default="0">
192198
The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm].
193199
</member>
200+
<member name="path_return_max_length" type="float" setter="set_path_return_max_length" getter="get_path_return_max_length" default="0.0">
201+
The maximum allowed length of the returned path in world units. A path will be clipped when going over this length.
202+
</member>
203+
<member name="path_return_max_radius" type="float" setter="set_path_return_max_radius" getter="get_path_return_max_radius" default="0.0">
204+
The maximum allowed radius in world units that the returned path can be distant from the path start. The path will be clipped when going over this radius.
205+
[b]Note:[/b] This will perform a sphere clip considering only the actual navigation mesh path points with the first path position being the sphere's center.
206+
</member>
207+
<member name="path_search_max_distance" type="float" setter="set_path_search_max_distance" getter="get_path_search_max_distance" default="0.0">
208+
The maximum distance a searched polygon can be away from the start polygon before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest so far to the target position. A value of [code]0[/code] or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
209+
</member>
210+
<member name="path_search_max_polygons" type="int" setter="set_path_search_max_polygons" getter="get_path_search_max_polygons" default="4096">
211+
The maximum amount of polygons that are searched before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest so far to the target position. A value of [code]0[/code] or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
212+
</member>
194213
<member name="pathfinding_algorithm" type="int" setter="set_pathfinding_algorithm" getter="get_pathfinding_algorithm" enum="NavigationPathQueryParameters2D.PathfindingAlgorithm" default="0">
195214
The pathfinding algorithm used in the path query.
196215
</member>

doc/classes/NavigationAgent3D.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@
7575
Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
7676
</description>
7777
</method>
78+
<method name="get_path_length" qualifiers="const">
79+
<return type="float" />
80+
<description>
81+
Returns the length of the path.
82+
</description>
83+
</method>
7884
<method name="get_rid" qualifiers="const">
7985
<return type="RID" />
8086
<description>
@@ -197,6 +203,19 @@
197203
<member name="path_postprocessing" type="int" setter="set_path_postprocessing" getter="get_path_postprocessing" enum="NavigationPathQueryParameters3D.PathPostProcessing" default="0">
198204
The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm].
199205
</member>
206+
<member name="path_return_max_length" type="float" setter="set_path_return_max_length" getter="get_path_return_max_length" default="0.0">
207+
The maximum allowed length of the returned path in world units. A path will be clipped when going over this length.
208+
</member>
209+
<member name="path_return_max_radius" type="float" setter="set_path_return_max_radius" getter="get_path_return_max_radius" default="0.0">
210+
The maximum allowed radius in world units that the returned path can be distant from the path start. The path will be clipped when going over this radius.
211+
[b]Note:[/b] This will perform a sphere clip considering only the actual navigation mesh path points with the first path position being the sphere's center.
212+
</member>
213+
<member name="path_search_max_distance" type="float" setter="set_path_search_max_distance" getter="get_path_search_max_distance" default="0.0">
214+
The maximum distance a searched polygon can be away from the start polygon before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest so far to the target position. A value of [code]0[/code] or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
215+
</member>
216+
<member name="path_search_max_polygons" type="int" setter="set_path_search_max_polygons" getter="get_path_search_max_polygons" default="4096">
217+
The maximum amount of polygons that are searched before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest so far to the target position. A value of [code]0[/code] or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
218+
</member>
200219
<member name="pathfinding_algorithm" type="int" setter="set_pathfinding_algorithm" getter="get_pathfinding_algorithm" enum="NavigationPathQueryParameters3D.PathfindingAlgorithm" default="0">
201220
The pathfinding algorithm used in the path query.
202221
</member>

doc/classes/NavigationPathQueryParameters2D.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@
3030
<member name="path_postprocessing" type="int" setter="set_path_postprocessing" getter="get_path_postprocessing" enum="NavigationPathQueryParameters2D.PathPostProcessing" default="0">
3131
The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm].
3232
</member>
33+
<member name="path_return_max_length" type="float" setter="set_path_return_max_length" getter="get_path_return_max_length" default="0.0">
34+
The maximum allowed length of the returned path in world units. A path will be clipped when going over this length. A value at [code]0[/code] or below counts as disabled.
35+
</member>
36+
<member name="path_return_max_radius" type="float" setter="set_path_return_max_radius" getter="get_path_return_max_radius" default="0.0">
37+
The maximum allowed radius in world units that the returned path can be distant from the path start. The path will be clipped when going over this radius. A value at [code]0[/code] or below counts as disabled.
38+
[b]Note:[/b] This will perform a circle shaped clip operation on the path with the first path position being the circle's center position.
39+
</member>
40+
<member name="path_search_max_distance" type="float" setter="set_path_search_max_distance" getter="get_path_search_max_distance" default="0.0">
41+
The maximum distance a searched polygon can be away from the start polygon before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest so far to the target position. A value of [code]0[/code] or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
42+
</member>
43+
<member name="path_search_max_polygons" type="int" setter="set_path_search_max_polygons" getter="get_path_search_max_polygons" default="4096">
44+
The maximum amount of polygons that are searched before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest so far to the target position. A value of [code]0[/code] or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
45+
</member>
3346
<member name="pathfinding_algorithm" type="int" setter="set_pathfinding_algorithm" getter="get_pathfinding_algorithm" enum="NavigationPathQueryParameters2D.PathfindingAlgorithm" default="0">
3447
The pathfinding algorithm used in the path query.
3548
</member>

doc/classes/NavigationPathQueryParameters3D.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@
3030
<member name="path_postprocessing" type="int" setter="set_path_postprocessing" getter="get_path_postprocessing" enum="NavigationPathQueryParameters3D.PathPostProcessing" default="0">
3131
The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm].
3232
</member>
33+
<member name="path_return_max_length" type="float" setter="set_path_return_max_length" getter="get_path_return_max_length" default="0.0">
34+
The maximum allowed length of the returned path in world units. A path will be clipped when going over this length. A value at [code]0[/code] or below counts as disabled.
35+
</member>
36+
<member name="path_return_max_radius" type="float" setter="set_path_return_max_radius" getter="get_path_return_max_radius" default="0.0">
37+
The maximum allowed radius in world units that the returned path can be distant from the path start. The path will be clipped when going over this radius. A value at [code]0[/code] or below counts as disabled.
38+
[b]Note:[/b] This will perform a sphere shaped clip operation on the path with the first path position being the sphere's center position.
39+
</member>
40+
<member name="path_search_max_distance" type="float" setter="set_path_search_max_distance" getter="get_path_search_max_distance" default="0.0">
41+
The maximum distance a searched polygon can be away from the start polygon before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest so far to the target position. A value of [code]0[/code] or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
42+
</member>
43+
<member name="path_search_max_polygons" type="int" setter="set_path_search_max_polygons" getter="get_path_search_max_polygons" default="4096">
44+
The maximum amount of polygons that are searched before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest so far to the target position. A value of [code]0[/code] or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
45+
</member>
3346
<member name="pathfinding_algorithm" type="int" setter="set_pathfinding_algorithm" getter="get_pathfinding_algorithm" enum="NavigationPathQueryParameters3D.PathfindingAlgorithm" default="0">
3447
The pathfinding algorithm used in the path query.
3548
</member>

doc/classes/NavigationPathQueryResult2D.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
<member name="path" type="PackedVector2Array" setter="set_path" getter="get_path" default="PackedVector2Array()">
2222
The resulting path array from the navigation query. All path array positions are in global coordinates. Without customized query parameters this is the same path as returned by [method NavigationServer2D.map_get_path].
2323
</member>
24+
<member name="path_length" type="float" setter="set_path_length" getter="get_path_length" default="0.0">
25+
Returns the length of the path.
26+
</member>
2427
<member name="path_owner_ids" type="PackedInt64Array" setter="set_path_owner_ids" getter="get_path_owner_ids" default="PackedInt64Array()">
2528
The [code]ObjectID[/code]s of the [Object]s which manage the regions and links each point of the path goes through.
2629
</member>

doc/classes/NavigationPathQueryResult3D.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
<member name="path" type="PackedVector3Array" setter="set_path" getter="get_path" default="PackedVector3Array()">
2222
The resulting path array from the navigation query. All path array positions are in global coordinates. Without customized query parameters this is the same path as returned by [method NavigationServer3D.map_get_path].
2323
</member>
24+
<member name="path_length" type="float" setter="set_path_length" getter="get_path_length" default="0.0">
25+
Returns the length of the path.
26+
</member>
2427
<member name="path_owner_ids" type="PackedInt64Array" setter="set_path_owner_ids" getter="get_path_owner_ids" default="PackedInt64Array()">
2528
The [code]ObjectID[/code]s of the [Object]s which manage the regions and links each point of the path goes through.
2629
</member>

0 commit comments

Comments
 (0)