diff options
Diffstat (limited to 'doc/classes/AStarGrid2D.xml')
-rw-r--r-- | doc/classes/AStarGrid2D.xml | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/doc/classes/AStarGrid2D.xml b/doc/classes/AStarGrid2D.xml index 8dde3748d7..cba783246f 100644 --- a/doc/classes/AStarGrid2D.xml +++ b/doc/classes/AStarGrid2D.xml @@ -69,6 +69,20 @@ [b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty [PackedVector3Array] and will print an error message. </description> </method> + <method name="get_point_position" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="id" type="Vector2i" /> + <description> + Returns the position of the point associated with the given [param id]. + </description> + </method> + <method name="get_point_weight_scale" qualifiers="const"> + <return type="float" /> + <param index="0" name="id" type="Vector2i" /> + <description> + Returns the weight scale of the point associated with the given [param id]. + </description> + </method> <method name="is_dirty" qualifiers="const"> <return type="bool" /> <description> @@ -103,6 +117,16 @@ <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="set_point_weight_scale"> + <return type="void" /> + <param index="0" name="id" type="Vector2i" /> + <param index="1" name="weight_scale" type="float" /> + <description> + Sets the [param weight_scale] for the point with the given [param id]. The [param weight_scale] is multiplied by the result of [method _compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point. + [b]Note:[/b] Calling [method update] is not needed after the call of this function. </description> </method> <method name="update"> @@ -124,6 +148,7 @@ </member> <member name="jumping_enabled" type="bool" setter="set_jumping_enabled" getter="is_jumping_enabled" default="false"> Enables or disables jumping to skip up the intermediate points and speeds up the searching algorithm. + [b]Note:[/b] Currently, toggling it on disables the consideration of weight scaling in pathfinding. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The offset of the grid which will be applied to calculate the resulting point position returned by [method get_point_path]. If changed, [method update] needs to be called before finding the next path. @@ -134,20 +159,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 +186,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) |