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