Changeset 8190 in orxonox.OLD for trunk/src/world_entities/world_entity.h
- Timestamp:
- Jun 7, 2006, 3:00:01 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/world_entity.h
r8186 r8190 15 15 #include "glincl.h" 16 16 #include <vector> 17 #include <stdarg.h> 17 18 #include "physics_interface.h" 18 19 19 20 … … 24 25 25 26 class BVTree; 27 class BoundingVolume; 26 28 class Model; 27 29 class CollisionHandle; 30 class Collision; 31 class Plane; 28 32 29 33 … … 72 76 73 77 /* --- 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]; } 75 93 76 94 … … 98 116 99 117 /* --- 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; } 100 122 /** @returns the Energy of the entity */ 101 123 float getHealth() const { return this->health; }; … … 107 129 OrxGui::GLGuiWidget* getHealthWidget(); 108 130 bool hasHealthWidget() const { return this->healthWidget; }; 109 131 110 132 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 111 141 112 142 /* --- Misc Stuff Block --- */ … … 128 158 private: 129 159 /// 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. 130 161 float health; //!< The Energy of this Entity, if the Entity has any energy at all. 131 162 float healthMax; //!< The Maximal energy this entity can take. … … 140 171 bool bVisible; //!< If it should be visible. 141 172 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. 144 175 145 146 //network stuff147 148 float scaling; //!< model's scaling factor149 int scaling_handle; //!< handle for syncing var150 151 std::string modelFileName; //!< model's file name152 int modelFileName_handle; //!< handle for syncing var153 CollisionHandle** collisionHandles;154 176 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 155 188 156 189 };
Note: See TracChangeset
for help on using the changeset viewer.