21typedef std::vector<Node *> NodeArray;
22typedef std::vector<NodeArray> NavMesh;
31class EXPCL_PANDAAI PathFinder {
35 std::vector<Node*> _open_list;
36 std::vector<Node*> _closed_list;
54 PathFinder(NavMesh nav_mesh);
Node * find_in_mesh(NavMesh nav_mesh, LVecBase3 pos, int grid_size)
This function allows the user to pass a position and it returns the corresponding node on the navigat...
This class is used to assign the nodes on the mesh.
void remove_from_clist(int r, int c)
This function removes a node from the closed list.
bool is_diagonal_node(Node *nd)
This function checks if the traversal from a node is diagonal.
void add_to_clist(Node *nd)
This function adds a node to the closed list.
int calc_cost_frm_src(Node *nd)
This function calculates the cost of each node by finding out the number of node traversals required ...
void add_to_olist(Node *nd)
This function adds a node to the open list heap.
void generate_path()
This function performs the pathfinding process using the A* algorithm.
int calc_heuristic(Node *nd)
This function calculates the heuristic of the nodes using Manhattan method.
void identify_neighbors(Node *nd)
This function traverses through the 8 neigbors of the parent node and then adds the neighbors to the ...
void calc_node_score(Node *nd)
This function calculates the score of each node.
void remove_from_olist()
This function removes a node from the open list.
void find_path(Node *src_node, Node *dest_node)
This function initializes the pathfinding process by accepting the source and destination nodes.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.