Public Member Functions |
|
| PathFinder (NavMesh nav_mesh) |
| void | add_to_clist (Node *nd) |
| | This function adds a node to the closed list.
|
| void | add_to_olist (Node *nd) |
| | This function adds a node to the open list heap.
|
| int | calc_cost_frm_src (Node *nd) |
| | This function calculates the cost of each node by finding out the number of node traversals required to reach the source node.
|
| int | calc_heuristic (Node *nd) |
| | This function calculates the heuristic of the nodes using Manhattan method.
|
| void | calc_node_score (Node *nd) |
| | This function calculates the score of each node.
|
| void | find_path (Node *src_node, Node *dest_node) |
| | This function initializes the pathfinding process by accepting the source and destination nodes.
|
| void | generate_path () |
| | This function performs the pathfinding process using the A* algorithm.
|
| void | identify_neighbors (Node *nd) |
| | This function traverses through the 8 neigbors of the parent node and then adds the neighbors to the _open_list based on A* criteria.
|
| bool | is_diagonal_node (Node *nd) |
| | This function checks if the traversal from a node is diagonal.
|
| void | remove_from_clist (int r, int c) |
| | This function removes a node from the closed list.
|
| void | remove_from_olist () |
| | This function removes a node from the open list.
|
Public Attributes |
|
vector< Node * > | _closed_list |
|
Node * | _dest_node |
|
NavMesh | _grid |
|
vector< Node * > | _open_list |
|
Node * | _src_node |
This class implements pathfinding using A* algorithm.
It also uses a Binary Heap search to search the open list. The heuristics are calculated using the manhattan method.
Definition at line 36 of file aiPathFinder.h.