Panda3D
 All Classes Functions Variables Enumerations
flock.h
00001 ////////////////////////////////////////////////////////////////////////
00002 // Filename    : flock.h
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 #ifndef _FLOCK_H
00017 #define _FLOCK_H
00018 
00019 #include "aiGlobals.h"
00020 #include "aiCharacter.h"
00021 
00022 class AICharacter;
00023 
00024 ///////////////////////////////////////////////////////////////////////////////////////
00025 //
00026 // Class : Flock
00027 // Description : This class is used to define the flock attributes and the AI characters
00028 //                which are part of the flock.
00029 
00030 ///////////////////////////////////////////////////////////////////////////////////////
00031 
00032 class EXPCL_PANDAAI Flock {
00033 private:
00034   unsigned int _flock_id;
00035 
00036 public:
00037   // Variables which will hold the parameters of the ai character's visibilty cone.
00038   double _flock_vcone_angle;
00039   double _flock_vcone_radius;
00040 
00041   // Variables to specify weights of separation, cohesion and alignment behaviors and thus
00042   // create variable flock behavior.
00043   unsigned int _separation_wt;
00044   unsigned int _cohesion_wt;
00045   unsigned int _alignment_wt;
00046 
00047   // This vector will hold all the ai characters which belong to this flock.
00048   typedef std::vector<AICharacter*> AICharList;
00049   AICharList _ai_char_list;
00050 
00051 PUBLISHED:
00052   Flock(unsigned int flock_id, double vcone_angle, double vcone_radius, unsigned int separation_wt = 2,
00053     unsigned int cohesion_wt = 4, unsigned int alignment_wt = 1);
00054   ~Flock();
00055 
00056   // Function to add the ai characters to _ai_char_list.
00057   void add_ai_char(AICharacter *ai_char);
00058 
00059   // Function to access the private member flock_id.
00060   unsigned int get_id();
00061 };
00062 
00063 #endif
 All Classes Functions Variables Enumerations