Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 18, 2007, 4:41:20 PM (16 years ago)
Author:
bknecht
Message:

implemented content of Flocking.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/objects/NPC.h

    r603 r617  
    1010// includes
    1111#include "WorldEntity.h"
     12#include "Model.h"
    1213
    1314namespace orxonox {
    1415
    15   class NPC : public WorldEntity
     16  class NPC : public Model
    1617  {
    17     NPC();
    18     virtual ~NPC();
     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
    1941  };
    2042
Note: See TracChangeset for help on using the changeset viewer.