Browse Source

Merge pull request #70056 from Chaosus/docs_astargrid

Yuri Rubinsky 2 years ago
parent
commit
4e5714c23a
1 changed files with 6 additions and 3 deletions
  1. 6 3
      doc/classes/AStarGrid2D.xml

+ 6 - 3
doc/classes/AStarGrid2D.xml

@@ -103,6 +103,7 @@
 			<param index="1" name="solid" type="bool" default="true" />
 			<description>
 				Disables or enables the specified point for pathfinding. Useful for making an obstacle. By default, all points are enabled.
+				[b]Note:[/b] Calling [method update] is not needed after the call of this function.
 			</description>
 		</method>
 		<method name="update">
@@ -134,20 +135,22 @@
 	</members>
 	<constants>
 		<constant name="HEURISTIC_EUCLIDEAN" value="0" enum="Heuristic">
-			The Euclidean heuristic to be used for the pathfinding using the following formula:
+			The [url=https://en.wikipedia.org/wiki/Euclidean_distance]Euclidean heuristic[/url] to be used for the pathfinding using the following formula:
 			[codeblock]
 			dx = abs(to_id.x - from_id.x)
 			dy = abs(to_id.y - from_id.y)
 			result = sqrt(dx * dx + dy * dy)
 			[/codeblock]
+			[b]Note:[/b] This is also the internal heuristic used in [AStar3D] and [AStar2D] by default (with the inclusion of possible z-axis coordinate).
 		</constant>
 		<constant name="HEURISTIC_MANHATTAN" value="1" enum="Heuristic">
-			The Manhattan heuristic to be used for the pathfinding using the following formula:
+			The [url=https://en.wikipedia.org/wiki/Taxicab_geometry]Manhattan heuristic[/url] to be used for the pathfinding using the following formula:
 			[codeblock]
 			dx = abs(to_id.x - from_id.x)
 			dy = abs(to_id.y - from_id.y)
 			result = dx + dy
 			[/codeblock]
+			[b]Note:[/b] This heuristic is intended to be used with 4-side orthogonal movements, provided by setting the [member diagonal_mode] to [constant DIAGONAL_MODE_NEVER].
 		</constant>
 		<constant name="HEURISTIC_OCTILE" value="2" enum="Heuristic">
 			The Octile heuristic to be used for the pathfinding using the following formula:
@@ -159,7 +162,7 @@
 			[/codeblock]
 		</constant>
 		<constant name="HEURISTIC_CHEBYSHEV" value="3" enum="Heuristic">
-			The Chebyshev heuristic to be used for the pathfinding using the following formula:
+			The [url=https://en.wikipedia.org/wiki/Chebyshev_distance]Chebyshev heuristic[/url] to be used for the pathfinding using the following formula:
 			[codeblock]
 			dx = abs(to_id.x - from_id.x)
 			dy = abs(to_id.y - from_id.y)