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