Panda3D
flock.cxx
1 ////////////////////////////////////////////////////////////////////////
2 // Filename : flock.cxx
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 #include "flock.h"
17 
18 Flock::Flock(unsigned int flock_id, double vcone_angle, double vcone_radius, unsigned int separation_wt,
19  unsigned int cohesion_wt, unsigned int alignment_wt) {
20  _flock_id = flock_id;
21  _flock_vcone_angle = vcone_angle;
22  _flock_vcone_radius = vcone_radius;
23  _separation_wt = separation_wt;
24  _cohesion_wt = cohesion_wt;
25  _alignment_wt = alignment_wt;
26 }
27 
28 Flock::~Flock() {
29 }
30 
31 /////////////////////////////////////////////////////////////////////////////////////////
32 //
33 // Function : add_ai_char
34 // Description : This function adds AI characters to the flock.
35 
36 /////////////////////////////////////////////////////////////////////////////////////////
37 
39  ai_char->_ai_char_flock_id = _flock_id;
40  ai_char->_steering->_flock_group = this;
41  _ai_char_list.push_back(ai_char);
42 }
43 
44 unsigned int Flock::get_id() {
45  return _flock_id;
46 }
void add_ai_char(AICharacter *ai_char)
This function adds AI characters to the flock.
Definition: flock.cxx:38