Panda3D
Loading...
Searching...
No Matches
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 */
26class AIBehaviors;
27class AIWorld;
28
29class 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 std::string get_name();
50
51PUBLISHED:
52 double get_mass();
53 void set_mass(double m);
54
55 LVecBase3 get_velocity();
56
57 double get_max_force();
58 void set_max_force(double max_force);
59
60 NodePath get_node_path();
61 void set_node_path(NodePath np);
62
63 AIBehaviors * get_ai_behaviors();
64
65 // This function is used to enable or disable the guides for path finding.
66 void set_pf_guide(bool pf_guide);
67
68 explicit AICharacter(std::string model_name, NodePath model_np, double mass, double movt_force, double max_force);
70
71 MAKE_PROPERTY(name, get_name);
72};
73
74#endif
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
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition nodePath.h:159
A base class for all things that want to be reference-counted.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.