Panda3D
 All Classes Functions Variables Enumerations
pathFind.h
1 
2 ////////////////////////////////////////////////////////////////////////
3 // Filename : pathFind.h
4 // Created by : Deepak, John, Navin
5 // Date : 12 Oct 09
6 ////////////////////////////////////////////////////////////////////
7 //
8 // PANDA 3D SOFTWARE
9 // Copyright (c) Carnegie Mellon University. All rights reserved.
10 //
11 // All use of this software is subject to the terms of the revised BSD
12 // license. You should have received a copy of this license along
13 // with this source code in a file named "LICENSE."
14 //
15 ////////////////////////////////////////////////////////////////////
16 
17 #ifndef _PATHFIND_H
18 #define _PATHFIND_H
19 
20 #include "aiGlobals.h"
21 #include "aiCharacter.h"
22 #include "aiPathFinder.h"
23 #include "boundingSphere.h"
24 
25 class AICharacter;
26 
27 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
28 //
29 // Class : PathFind
30 // Description : This class contains all the members and functions that are required to form an interface between
31 // the AIBehaviors class and the PathFinder class. An object (pointer) of this class is provided in the
32 // AIBehaviors class. It is only via this object that the user can activate pathfinding.
33 
34 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
35 
36 class EXPCL_PANDAAI PathFind {
37 public:
38  AICharacter *_ai_char;
39  PathFinder *_path_finder_obj;
40 
41  NavMesh _nav_mesh;
42  NavMesh _stage_mesh;
43 
44  int _grid_size;
45  NodePath _path_find_target;
46  LVecBase3 _prev_position;
47  PT(GeomNode) _parent;
48  LineSegs *_pen;
49  vector<int> _previous_obstacles;
50  bool _dynamic_avoid;
51  vector<NodePath> _dynamic_obstacle;
52 
53  PathFind(AICharacter *ai_ch);
54  ~PathFind();
55 
56  void clear_path();
57  void trace_path(Node* src);
58 
59  void create_nav_mesh(const char* navmesh_filename);
60  void assign_neighbor_nodes(const char* navmesh_filename);
61  void do_dynamic_avoid();
62  void clear_previous_obstacles();
63 
64  void set_path_find(const char* navmesh_filename);
65  void path_find(LVecBase3 pos, string type = "normal");
66  void path_find(NodePath target, string type = "normal");
67  void add_obstacle_to_mesh(NodePath obstacle);
68  void dynamic_avoid(NodePath obstacle);
69 };
70 
71 #endif
72 
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
This class is used to assign the nodes on the mesh.
Definition: meshNode.h:18
This class implements pathfinding using A* algorithm.
Definition: aiPathFinder.h:36
Encapsulates creation of a series of connected or disconnected line segments or points, for drawing paths or rays.
Definition: lineSegs.h:36
This class contains all the members and functions that are required to form an interface between the ...
Definition: pathFind.h:36
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165
A node that holds Geom objects, renderable pieces of geometry.
Definition: geomNode.h:37