Panda3D
|
00001 //////////////////////////////////////////////////////////////////////// 00002 // Filename : flock.cxx 00003 // Created by : Deepak, John, Navin 00004 // Date : 12 Oct 09 00005 //////////////////////////////////////////////////////////////////// 00006 // 00007 // PANDA 3D SOFTWARE 00008 // Copyright (c) Carnegie Mellon University. All rights reserved. 00009 // 00010 // All use of this software is subject to the terms of the revised BSD 00011 // license. You should have received a copy of this license along 00012 // with this source code in a file named "LICENSE." 00013 // 00014 //////////////////////////////////////////////////////////////////// 00015 00016 #include "flock.h" 00017 00018 Flock::Flock(unsigned int flock_id, double vcone_angle, double vcone_radius, unsigned int separation_wt, 00019 unsigned int cohesion_wt, unsigned int alignment_wt) { 00020 _flock_id = flock_id; 00021 _flock_vcone_angle = vcone_angle; 00022 _flock_vcone_radius = vcone_radius; 00023 _separation_wt = separation_wt; 00024 _cohesion_wt = cohesion_wt; 00025 _alignment_wt = alignment_wt; 00026 } 00027 00028 Flock::~Flock() { 00029 } 00030 00031 ///////////////////////////////////////////////////////////////////////////////////////// 00032 // 00033 // Function : add_ai_char 00034 // Description : This function adds AI characters to the flock. 00035 00036 ///////////////////////////////////////////////////////////////////////////////////////// 00037 00038 void Flock::add_ai_char(AICharacter *ai_char) { 00039 ai_char->_ai_char_flock_id = _flock_id; 00040 ai_char->_steering->_flock_group = this; 00041 _ai_char_list.push_back(ai_char); 00042 } 00043 00044 unsigned int Flock::get_id() { 00045 return _flock_id; 00046 }