AStar2D¶
Inherits: RefCounted < Object
An implementation of A* for finding the shortest path between two vertices on a connected graph in 2D space.
Description¶
An implementation of the A* algorithm, used to find the shortest path between two vertices on a connected graph in 2D space.
See AStar3D for a more thorough explanation on how to use this class. AStar2D is a wrapper for AStar3D that enforces 2D coordinates.
Methods¶
_compute_cost ( int from_id, int to_id ) virtual const |
|
_estimate_cost ( int from_id, int to_id ) virtual const |
|
void |
add_point ( int id, Vector2 position, float weight_scale=1.0 ) |
are_points_connected ( int id, int to_id, bool bidirectional=true ) const |
|
void |
clear ( ) |
void |
connect_points ( int id, int to_id, bool bidirectional=true ) |
void |
disconnect_points ( int id, int to_id, bool bidirectional=true ) |
get_available_point_id ( ) const |
|
get_closest_point ( Vector2 to_position, bool include_disabled=false ) const |
|
get_closest_position_in_segment ( Vector2 to_position ) const |
|
get_id_path ( int from_id, int to_id ) |
|
get_point_capacity ( ) const |
|
get_point_connections ( int id ) |
|
get_point_count ( ) const |
|
get_point_ids ( ) |
|
get_point_path ( int from_id, int to_id ) |
|
get_point_position ( int id ) const |
|
get_point_weight_scale ( int id ) const |
|
is_point_disabled ( int id ) const |
|
void |
remove_point ( int id ) |
void |
reserve_space ( int num_nodes ) |
void |
set_point_disabled ( int id, bool disabled=true ) |
void |
set_point_position ( int id, Vector2 position ) |
void |
set_point_weight_scale ( int id, float weight_scale ) |
Method Descriptions¶
float _compute_cost ( int from_id, int to_id ) virtual const
Called when computing the cost between two connected points.
Note that this function is hidden in the default AStar2D class.
float _estimate_cost ( int from_id, int to_id ) virtual const
Called when estimating the cost between a point and the path's ending point.
Note that this function