PathFind Class Reference

#include <pathFind.h>

Collaboration diagram for PathFind:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PT (GeomNode) _parent
 PathFind (AICharacter *ai_ch)
 ~PathFind ()
void clear_path ()
void trace_path (Node *src)
void create_nav_mesh (const char *navmesh_filename)
void assign_neighbor_nodes (const char *navmesh_filename)
void do_dynamic_avoid ()
void clear_previous_obstacles ()
void set_path_find (const char *navmesh_filename)
void path_find (LVecBase3f pos, string type="normal")
void path_find (NodePath target, string type="normal")
void add_obstacle_to_mesh (NodePath obstacle)
void dynamic_avoid (NodePath obstacle)

Public Attributes

AICharacter_ai_char
PathFinder_path_finder_obj
NavMesh _nav_mesh
NavMesh _stage_mesh
int _grid_size
NodePath _path_find_target
LVecBase3f _prev_position
LineSegs * _pen
vector< int > _previous_obstacles
bool _dynamic_avoid
vector< NodePath > _dynamic_obstacle

Detailed Description

Class : PathFind Description : This class contains all the members and functions that are required to form an interface between the AIBehaviors class and the PathFinder class. An object (pointer) of this class is provided in the AIBehaviors class. It is only via this object that the user can activate pathfinding.

Definition at line 35 of file pathFind.h.


Constructor & Destructor Documentation

PathFind::PathFind ( AICharacter ai_ch  ) 

Definition at line 4 of file pathFind.cxx.

PathFind::~PathFind (  ) 

Definition at line 18 of file pathFind.cxx.


Member Function Documentation

void PathFind::add_obstacle_to_mesh ( NodePath  obstacle  ) 

Function : add_obstacle_to_mesh Description : This function allows the user to dynamically add obstacles to the game environment. The function will update the nodes within the bounding volume of the obstacle as non-traversable. Hence will not be considered by the pathfinding algorithm.

Definition at line 349 of file pathFind.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void PathFind::assign_neighbor_nodes ( const char *  navmesh_filename  ) 

Function : assign_neighbor_nodes Description : This function assigns the neighbor nodes for each main node present in _nav_mesh.

Definition at line 107 of file pathFind.cxx.

Here is the caller graph for this function:

void PathFind::clear_path (  ) 

Function : clear_path Description : Helper function to restore the path and mesh to its initial state

Definition at line 287 of file pathFind.cxx.

Here is the caller graph for this function:

void PathFind::clear_previous_obstacles (  ) 

Function : clear_previous_obstacles() Description : Helper function to reset the collisions if the obstacle is not on the node anymore

Definition at line 400 of file pathFind.cxx.

Here is the caller graph for this function:

void PathFind::create_nav_mesh ( const char *  navmesh_filename  ) 

Function : create_nav_mesh Description : This function recreates the navigation mesh from the .csv file

Definition at line 28 of file pathFind.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void PathFind::do_dynamic_avoid (  ) 

Function : do_dynamic_avoid() Description : This function does the updation of the collisions to the mesh based on the new positions of the obstacles.

Definition at line 384 of file pathFind.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void PathFind::dynamic_avoid ( NodePath  obstacle  ) 

Function : dynamic_avoid Description : This function starts the pathfinding obstacle navigation for the passed in obstacle.

Definition at line 414 of file pathFind.cxx.

Here is the caller graph for this function:

void PathFind::path_find ( NodePath  target,
string  type = "normal" 
)

Function : path_find (for pathfinding towards a moving target (a NodePath)) Description : This function checks for the source and target in the navigation mesh for its availability and then finds the best path via the A* algorithm Then it calls the path follower to make the object follow the path.

Definition at line 242 of file pathFind.cxx.

Here is the call graph for this function:

void PathFind::path_find ( LVecBase3f  pos,
string  type = "normal" 
)

Function : path_find (for pathfinding towards a static position) Description : This function checks for the source and target in the navigation mesh for its availability and then finds the best path via the A* algorithm Then it calls the path follower to make the object follow the path.

Definition at line 200 of file pathFind.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

PathFind::PT ( GeomNode   ) 

Here is the caller graph for this function:

void PathFind::set_path_find ( const char *  navmesh_filename  ) 

Function : set_path_find Description : This function starts the path finding process after reading the given navigation mesh.

Definition at line 173 of file pathFind.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void PathFind::trace_path ( Node src  ) 

Function : trace_path Description : This function is the function which sends the path information one by one to the path follower so that it can store the path needed to be traversed by the pathfinding object

Definition at line 316 of file pathFind.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 37 of file pathFind.h.

Definition at line 49 of file pathFind.h.

vector<NodePath> PathFind::_dynamic_obstacle

Definition at line 50 of file pathFind.h.

Definition at line 43 of file pathFind.h.

Definition at line 40 of file pathFind.h.

Definition at line 44 of file pathFind.h.

Definition at line 38 of file pathFind.h.

LineSegs* PathFind::_pen

Definition at line 47 of file pathFind.h.

Definition at line 45 of file pathFind.h.

Definition at line 48 of file pathFind.h.

Definition at line 41 of file pathFind.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator

Generated on Tue Dec 8 01:13:26 2009 for Pandai by  doxygen 1.6.1