| 
                Last change
                  on this file since 975 was
                  969,
                  checked in by rgrieder, 18 years ago
           | 
        
        
          
              - removed some unnecessary forward declarations
 - renamed destroy() —> destroySingleton()
  
           | 
        
        | 
            File size:
            1.3 KB
           | 
      
      
        
  | Rev | Line |   | 
|---|
| [603] | 1 | /** | 
|---|
 | 2 |   @file NPC.h | 
|---|
 | 3 |   @brief AI using WorldEntity | 
|---|
 | 4 |   @author Benjamin Knecht <beni_at_orxonox.net> | 
|---|
 | 5 |  */ | 
|---|
 | 6 |  | 
|---|
| [673] | 7 | #ifndef _NPC_H__ | 
|---|
 | 8 | #define _NPC_H__ | 
|---|
| [708] | 9 |  | 
|---|
 | 10 | #include "../OrxonoxPrereqs.h" | 
|---|
| [603] | 11 |  | 
|---|
| [617] | 12 | #include "Model.h" | 
|---|
| [603] | 13 |  | 
|---|
 | 14 | namespace orxonox { | 
|---|
 | 15 |  | 
|---|
| [729] | 16 |   class _OrxonoxExport NPC : public Model | 
|---|
| [603] | 17 |   { | 
|---|
| [617] | 18 |     public: | 
|---|
 | 19 |  | 
|---|
 | 20 |       NPC(); | 
|---|
 | 21 |       virtual ~NPC(); | 
|---|
| [627] | 22 |       virtual void loadParams(TiXmlElement* xmlElem); | 
|---|
| [617] | 23 |       void tick(float dt); | 
|---|
| [619] | 24 |       void update(); | 
|---|
| [617] | 25 |       void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable); | 
|---|
 | 26 |  | 
|---|
 | 27 |     private: | 
|---|
| [627] | 28 |       float getDistance(WorldEntity* temp); | 
|---|
 | 29 |       void calculateAcceleration(); | 
|---|
 | 30 |       Vector3 separation(); | 
|---|
 | 31 |       Vector3 alignment(); | 
|---|
 | 32 |       Vector3 cohesion(); | 
|---|
| [617] | 33 |  | 
|---|
 | 34 |  | 
|---|
 | 35 |     private: | 
|---|
 | 36 |       bool movable_;  // movability of the element, (false) gives the possiblity that an object can`t be moved by flocking but still gets into the calculation | 
|---|
 | 37 |  | 
|---|
 | 38 |       // those values should maybe be controlled by a higher power and should maybe be parameters that can be changed | 
|---|
 | 39 |       static int const SEPERATIONDISTANCE = 300;  //detectionradius of seperation | 
|---|
 | 40 |       static int const ALIGNMENTDISTANCE = 300;  //detectionradius of alignment | 
|---|
 | 41 |       static int const COHESIONDISTANCE = 5000;  //detectionradius of cohesion | 
|---|
| [728] | 42 |       static int const NUMELEMENTS = 9;  //number of elements | 
|---|
| [603] | 43 |   }; | 
|---|
 | 44 | } | 
|---|
| [673] | 45 | #endif /* _NPC_H__ */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.