Add navigation path simplification

Adds navigation path simplification for NavigationServer and NavigationAgent.
This commit is contained in:
smix8
2024-04-09 04:27:54 +02:00
parent b2f425fe68
commit 1c134f4a3d
25 changed files with 330 additions and 0 deletions

View File

@ -25,6 +25,13 @@
<member name="pathfinding_algorithm" type="int" setter="set_pathfinding_algorithm" getter="get_pathfinding_algorithm" enum="NavigationPathQueryParameters3D.PathfindingAlgorithm" default="0">
The pathfinding algorithm used in the path query.
</member>
<member name="simplify_epsilon" type="float" setter="set_simplify_epsilon" getter="get_simplify_epsilon" default="0.0">
The path simplification amount in worlds units.
</member>
<member name="simplify_path" type="bool" setter="set_simplify_path" getter="get_simplify_path" default="false">
If [code]true[/code] a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation.
Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields".
</member>
<member name="start_position" type="Vector3" setter="set_start_position" getter="get_start_position" default="Vector3(0, 0, 0)">
The pathfinding start position in global coordinates.
</member>