00001 00013 00015 00016 #ifndef _PATHFIND_H 00017 #define _PATHFIND_H 00018 00019 #include "globals.h" 00020 #include "aiCharacter.h" 00021 #include "aiPathFinder.h" 00022 #include "boundingSphere.h" 00023 00024 class AICharacter; 00025 00032 00034 00035 class PathFind { 00036 public: 00037 AICharacter *_ai_char; 00038 PathFinder *_path_finder_obj; 00039 00040 NavMesh _nav_mesh; 00041 NavMesh _stage_mesh; 00042 00043 int _grid_size; 00044 NodePath _path_find_target; 00045 LVecBase3f _prev_position; 00046 PT(GeomNode) _parent; 00047 LineSegs *_pen; 00048 vector<int> _previous_obstacles; 00049 bool _dynamic_avoid; 00050 vector<NodePath> _dynamic_obstacle; 00051 00052 PathFind(AICharacter *ai_ch); 00053 ~PathFind(); 00054 00055 void clear_path(); 00056 void trace_path(Node* src); 00057 00058 void create_nav_mesh(const char* navmesh_filename); 00059 void assign_neighbor_nodes(const char* navmesh_filename); 00060 void do_dynamic_avoid(); 00061 void clear_previous_obstacles(); 00062 00063 void set_path_find(const char* navmesh_filename); 00064 void path_find(LVecBase3f pos, string type = "normal"); 00065 void path_find(NodePath target, string type = "normal"); 00066 void add_obstacle_to_mesh(NodePath obstacle); 00067 void dynamic_avoid(NodePath obstacle); 00068 }; 00069 00070 #endif 00071