Panda3D

aiWorld.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 aiWorld.h
10 * @author Deepak, John, Navin
11 * @date 2009-09-08
12 */
13
14 #ifndef _AIWORLD_H
15 #define _AIWORLD_H
16
17 #include "aiGlobals.h"
18 #include "aiCharacter.h"
19 #include "flock.h"
20
21 class AICharacter;
22 class Flock;
23
24 /**
25 * A class that implements the virtual AI world which keeps track of the AI
26 * characters active at any given time. It contains a linked list of AI
27 * characters, obstactle data and unique name for each character. It also
28 * updates each characters state. The AI characters can also be added to the
29 * world as flocks.
30 */
31 class EXPCL_PANDAAI AIWorld {
32 private:
33 typedef std::vector<PT(AICharacter)> AICharPool;
34 AICharPool _ai_char_pool;
35 NodePath _render;
36 public:
37 std::vector<NodePath> _obstacles;
38 typedef std::vector<Flock*> FlockPool;
39 FlockPool _flock_pool;
40 void remove_ai_char_from_flock(std::string name);
41
42 PUBLISHED:
43 AIWorld(NodePath render);
44 ~AIWorld();
45
46 void add_ai_char(AICharacter *ai_ch);
47 void remove_ai_char(std::string name);
48
49 void add_flock(Flock *flock);
50 void flock_off(unsigned int flock_id);
51 void flock_on(unsigned int flock_id);
52 void remove_flock(unsigned int flock_id);
53 Flock get_flock(unsigned int flock_id);
54
55 void add_obstacle(NodePath obstacle);
56 void remove_obstacle(NodePath obstacle);
57
58 void print_list();
59 void update();
60 };
61
62 #endif
aiCharacter.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
aiGlobals.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
AICharacter
Definition: aiCharacter.h:29
AIWorld
A class that implements the virtual AI world which keeps track of the AI characters active at any giv...
Definition: aiWorld.h:31
Flock
This class is used to define the flock attributes and the AI characters which are part of the flock.
Definition: flock.h:26
NodePath
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:159
flock.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.