Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8190 in orxonox.OLD for trunk/src/world_entities/world_entity.h


Ignore:
Timestamp:
Jun 7, 2006, 3:00:01 PM (19 years ago)
Author:
patrick
Message:

trunk: merged the cr branche to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/world_entity.h

    r8186 r8190  
    1515#include "glincl.h"
    1616#include <vector>
    17 #include <stdarg.h>
     17
     18#include "physics_interface.h"
    1819
    1920
     
    2425
    2526class BVTree;
     27class BoundingVolume;
    2628class Model;
    2729class CollisionHandle;
     30class Collision;
     31class Plane;
    2832
    2933
     
    7276
    7377  /* --- Collision Reaction Block --- */
    74   void subscribeReaction(CREngine::CRType type, int nrOfTargets, ...);
     78  void subscribeReaction(CREngine::CRType type);
     79  void subscribeReaction(CREngine::CRType type, long target1);
     80  void subscribeReaction(CREngine::CRType type, long target1, long target2);
     81  void subscribeReaction(CREngine::CRType type, long target1, long target2, long target3);
     82  void subscribeReaction(CREngine::CRType type, long target1, long target2, long target3, long target4);
     83
     84  void unsubscribeReaction(CREngine::CRType type);
     85  void unsubscribeReaction();
     86
     87  bool registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB);
     88  bool registerCollision(WorldEntity* entity, Plane* plane, Vector position);
     89  /** @return true if there is at least on collision reaction subscribed */
     90  inline bool isReactive() const { return this->bReactive; }
     91
     92  CollisionHandle* getCollisionHandle(CREngine::CRType type) const { return this->collisionHandles[type]; }
    7593
    7694
     
    98116
    99117  /* --- Character Attribute Block --- */
     118  /** @returns the damage dealt by this world entity */
     119  float getDamage() const { return this->damage; }
     120  /** sets the damage dealt to @param damage damage per second */
     121  void setDamage(float damage) { this->damage = damage; }
    100122  /** @returns the Energy of the entity */
    101123  float getHealth() const { return this->health; };
     
    107129  OrxGui::GLGuiWidget* getHealthWidget();
    108130  bool hasHealthWidget() const { return this->healthWidget; };
    109  
     131
    110132  virtual void varChangeHandler( std::list<int> & id );
     133
     134
     135  //FIXME: the PhysicsInterface and the whole PEngine should probably be reviewed. Here its just used to store the vars
     136  /* --- Physics Interface --- */
     137  inline PhysicsInterface getPhysicsInterface() const { return this->physicsInterface; }
     138  inline float getMass() const { return this->physicsInterface.getMass(); }
     139  inline float getTotalMass() const { return this->physicsInterface.getTotalMass(); }
     140
    111141
    112142  /* --- Misc Stuff Block --- */
     
    128158private:
    129159  /// TODO maybe we will move the following three entries and the corresponding functions to Playable AND NPC
     160  float                   damage;             //!< the damage dealt to other objects by colliding.
    130161  float                   health;             //!< The Energy of this Entity, if the Entity has any energy at all.
    131162  float                   healthMax;          //!< The Maximal energy this entity can take.
     
    140171  bool                    bVisible;           //!< If it should be visible.
    141172
    142   OM_LIST                           objectListNumber;   //!< The ObjectList from ObjectManager this Entity is in.
    143   ObjectManager::EntityList::iterator objectListIterator; //!< The iterator position of this Entity in the given list of the ObjectManager.
     173  OM_LIST                 objectListNumber;                //!< The ObjectList from ObjectManager this Entity is in.
     174  ObjectManager::EntityList::iterator objectListIterator;  //!< The iterator position of this Entity in the given list of the ObjectManager.
    144175
    145  
    146   //network stuff
    147  
    148   float       scaling;                         //!< model's scaling factor
    149   int         scaling_handle;                  //!< handle for syncing var
    150  
    151   std::string modelFileName;                  //!< model's file name
    152   int         modelFileName_handle;           //!< handle for syncing var
    153   CollisionHandle**       collisionHandles;
    154176
     177
     178  float                   scaling;                         //!< model's scaling factor
     179  int                     scaling_handle;                  //!< handle for syncing var
     180
     181  std::string             modelFileName;                   //!< model's file name
     182  int                     modelFileName_handle;            //!< handle for syncing var
     183
     184  CollisionHandle*        collisionHandles[CREngine::CR_NUMBER];  //!< the list of the collision reactions
     185  bool                    bReactive;                              //!< true if there is at least one collision reaction subscibed
     186
     187  PhysicsInterface        physicsInterface;                //!< the physics object of the WorldEntity
    155188
    156189};
Note: See TracChangeset for help on using the changeset viewer.