Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/orxonox/objects/NPC.h @ 617

Last change on this file since 617 was 617, checked in by bknecht, 16 years ago

implemented content of Flocking.h

File size: 1.3 KB
Line 
1/**
2  @file NPC.h
3  @brief AI using WorldEntity
4  @author Benjamin Knecht <beni_at_orxonox.net>
5 */
6
7#ifndef MODULE_NPC_H
8#define MODULE_NPC_H
9
10// includes
11#include "WorldEntity.h"
12#include "Model.h"
13
14namespace orxonox {
15
16  class NPC : public Model
17  {
18    public:
19
20      NPC();
21      virtual ~NPC();
22      void tick(float dt);
23      void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable);
24
25    private:
26      float getDistance(NPC* temp);
27      void calculateAcceleration(NPC** arrayOfElements);
28      Vector3 separation(NPC** arrayOfElements);
29      Vector3 alignment(NPC** arrayOfElements);
30      Vector3 cohesion(NPC** arrayOfElements);
31
32
33    private:
34      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
35
36      // those values should maybe be controlled by a higher power and should maybe be parameters that can be changed
37      static int const SEPERATIONDISTANCE = 300;  //detectionradius of seperation
38      static int const ALIGNMENTDISTANCE = 300;  //detectionradius of alignment
39      static int const COHESIONDISTANCE = 5000;  //detectionradius of cohesion
40      static int const ANZELEMENTS = 9;  //number of elements
41  };
42
43}
44#endif
Note: See TracBrowser for help on using the repository browser.