Panda3D
flock.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 flock.h
10  * @author Deepak, John, Navin
11  * @date 2009-10-24
12  */
13 
14 #ifndef _FLOCK_H
15 #define _FLOCK_H
16 
17 #include "aiGlobals.h"
18 #include "aiCharacter.h"
19 
20 class AICharacter;
21 
22 /**
23  * This class is used to define the flock attributes and the AI characters
24  * which are part of the flock.
25  */
26 class EXPCL_PANDAAI Flock {
27 private:
28  unsigned int _flock_id;
29 
30 public:
31  // Variables which will hold the parameters of the ai character's visibilty
32  // cone.
33  double _flock_vcone_angle;
34  double _flock_vcone_radius;
35 
36  // Variables to specify weights of separation, cohesion and alignment
37  // behaviors and thus create variable flock behavior.
38  unsigned int _separation_wt;
39  unsigned int _cohesion_wt;
40  unsigned int _alignment_wt;
41 
42  // This vector will hold all the ai characters which belong to this flock.
43  typedef std::vector<PT(AICharacter)> AICharList;
44  AICharList _ai_char_list;
45 
46 PUBLISHED:
47  explicit Flock(unsigned int flock_id, double vcone_angle, double vcone_radius, unsigned int separation_wt = 2,
48  unsigned int cohesion_wt = 4, unsigned int alignment_wt = 1);
49  ~Flock();
50 
51  // Function to add the ai characters to _ai_char_list.
52  void add_ai_char(AICharacter *ai_char);
53 
54  // Function to access the private member flock_id.
55  unsigned int get_id();
56 };
57 
58 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is used to define the flock attributes and the AI characters which are part of the flock.
Definition: flock.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.