30class EXPCL_PANDAAI PathFind {
40 LVecBase3 _prev_position;
43 std::vector<int> _previous_obstacles;
45 std::vector<NodePath> _dynamic_obstacle;
59 void path_find(LVecBase3 pos, std::string type =
"normal");
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A node that holds Geom objects, renderable pieces of geometry.
Encapsulates creation of a series of connected or disconnected line segments or points,...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
This class is used to assign the nodes on the mesh.
void path_find(LVecBase3 pos, std::string type="normal")
This function checks for the source and target in the navigation mesh for its availability and then f...
void add_obstacle_to_mesh(NodePath obstacle)
This function allows the user to dynamically add obstacles to the game environment.
void create_nav_mesh(const char *navmesh_filename)
This function recreates the navigation mesh from the .csv file.
void dynamic_avoid(NodePath obstacle)
This function starts the pathfinding obstacle navigation for the passed in obstacle.
void clear_path()
Helper function to restore the path and mesh to its initial state.
void trace_path(Node *src)
This function is the function which sends the path information one by one to the path follower so tha...
void set_path_find(const char *navmesh_filename)
This function starts the path finding process after reading the given navigation mesh.
void clear_previous_obstacles()
Helper function to reset the collisions if the obstacle is not on the node anymore.
void do_dynamic_avoid()
This function does the updation of the collisions to the mesh based on the new positions of the obsta...
void assign_neighbor_nodes(const char *navmesh_filename)
This function assigns the neighbor nodes for each main node present in _nav_mesh.
This class implements pathfinding using A* algorithm.