flock.h

00001 #ifndef FLOCK_H
00002 #define FLOCK_H
00003 
00004 #include "irrlicht.h"
00005 
00006 class Boid;
00007 
00009 
00013 class Flock : public irr::scene::ISceneNode
00014 {
00015     public:
00016 
00031         Flock(irr::IrrlichtDevice* d,
00032                 irr::f32 size,
00033                 const irr::c8* boidMeshFile,
00034                 irr::scene::ISceneNode* parent,
00035                 irr::s32 id = 0,
00036                 const irr::core::vector3df& position = irr::core::vector3df(0,0,0) );
00037 
00040         ~Flock();
00041 
00045         void update(irr::u32 deltaTime);
00046 
00052         Boid* addBoid(irr::core::vector3df position, const irr::c8* boidMeshFile);
00053 
00058         void removeBoid(Boid* b);
00059 
00063         void removeBoids(void);
00064 
00066         irr::s32 getBoidCount(void);
00067 
00070                 virtual void OnPreRender();
00071 
00074                 virtual void render();
00075 
00078                 virtual const irr::core::aabbox3d<irr::f32>& getBoundingBox() const;
00079 
00087                 virtual irr::video::SMaterial& getMaterial(irr::s32 i);
00088 
00092                 virtual irr::s32 getMaterialCount(void);
00093 
00096                 void setScale(irr::f32 scale);
00097 
00100         irr::core::list<Boid*>& getBoidList(void);
00101 
00104         void setSeparationWeight(irr::s32 weight);
00105 
00108         irr::s32 getSeparationWeight(void);
00109 
00112         void setAlignmentWeight(irr::s32 weight);
00113 
00116         irr::s32 getAlignmentWeight(void);
00117 
00120         void setCohesionWeight(irr::s32 weight);
00121 
00124         irr::s32 getCohesionWeight(void);
00125 
00128         void setNeighborRadius(irr::s32 radius);
00129 
00132         irr::s32 getNeighborRadius(void);
00133 
00136         void setTarget(irr::core::vector3df target);
00137 
00140         irr::core::vector3df getTarget(void);
00141 
00144         void setSeekTargetWeight(irr::s32 weight);
00145 
00148         irr::s32 getSeekTargetWeight(void);
00149 
00152         void setTornadoWeight(irr::s32 weight);
00153 
00156         irr::s32 getTornadoWeight(void);
00157 
00158     protected:
00159 
00160     private:
00161 
00162         irr::IrrlichtDevice*                    device;
00163         irr::core::list<Boid*>          boids;
00164                 irr::core::aabbox3d<irr::f32>   box;
00165                 irr::video::SMaterial           material;
00166         irr::s32                        separationWeight;
00167         irr::s32                        alignmentWeight;
00168         irr::s32                        cohesionWeight;
00169         irr::s32                        neighborRadius;
00170         irr::core::vector3df            seekTarget;
00171         irr::s32                        seekTargetWeight;
00172         irr::s32                        tornadoWeight;
00173 };
00174 
00175 #endif // FLOCK_H

Generated on Sun Dec 2 17:09:57 2007 for Swarm by  doxygen 1.4.6-NO