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

@ -947,6 +947,15 @@
If [code]true[/code] enables debug mode on the NavigationServer.
</description>
</method>
<method name="simplify_path">
<return type="PackedVector2Array" />
<param index="0" name="path" type="PackedVector2Array" />
<param index="1" name="epsilon" type="float" />
<description>
Returns a simplified version of [param path] with less critical path points removed. The simplification amount is in worlds units and controlled by [param 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".
</description>
</method>
</methods>
<signals>
<signal name="map_changed">