Panda3D
aiCharacter.h
1 ////////////////////////////////////////////////////////////////////////
2 // Filename : aiCharacter.h
3 // Created by : Deepak, John, Navin
4 // Date : 8 Sep 09
5 ////////////////////////////////////////////////////////////////////
6 //
7 // PANDA 3D SOFTWARE
8 // Copyright (c) Carnegie Mellon University. All rights reserved.
9 //
10 // All use of this software is subject to the terms of the revised BSD
11 // license. You should have received a copy of this license along
12 // with this source code in a file named "LICENSE."
13 //
14 ////////////////////////////////////////////////////////////////////
15 
16 #pragma warning (disable:4996)
17 #pragma warning (disable:4005)
18 #pragma warning(disable:4275)
19 
20 
21 #ifndef _AICHARACTER_H
22 #define _AICHARACTER_H
23 
24 #include "aiBehaviors.h"
25 
26 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27 //
28 // Class : AICharacter
29 // Description : This class is used for creating the ai characters. It assigns both physics and ai
30 // attributes to the character. It also has an update function which updates the physics and ai
31 // of the character. This update function is called by the AIWorld update.
32 
33 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
34 
35 class AIBehaviors;
36 class AIWorld;
37 
38 class EXPCL_PANDAAI AICharacter {
39  public:
40  double _mass;
41  double _max_force;
42  LVecBase3 _velocity;
43  LVecBase3 _steering_force;
44  string _name;
45  double _movt_force;
46  unsigned int _ai_char_flock_id;
47  AIWorld *_world;
48  AIBehaviors *_steering;
49  NodePath _window_render;
50  NodePath _ai_char_np;
51  bool _pf_guide;
52 
53  void update();
54  void set_velocity(LVecBase3 vel);
55  void set_char_render(NodePath render);
56  NodePath get_char_render();
57 
58 PUBLISHED:
59  double get_mass();
60  void set_mass(double m);
61 
62  LVecBase3 get_velocity();
63 
64  double get_max_force();
65  void set_max_force(double max_force);
66 
67  NodePath get_node_path();
68  void set_node_path(NodePath np);
69 
70  AIBehaviors * get_ai_behaviors();
71 
72  // This function is used to enable or disable the guides for path finding.
73  void set_pf_guide(bool pf_guide);
74 
75  AICharacter(string model_name, NodePath model_np, double mass, double movt_force, double max_force);
76  ~AICharacter();
77 };
78 
79 #endif
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
A class that implements the virtual AI world which keeps track of the AI characters active at any giv...
Definition: aiWorld.h:69
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165