Changeset 2190 in orxonox.OLD for orxonox/trunk/src/world_entity.h
- Timestamp:
- Jul 17, 2004, 12:11:20 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entity.h
r2077 r2190 1 1 /*! 2 2 \file world_entity.h 3 \brief A base class for all objects in the world 4 5 This is the base class of all objects in the game-world. If you want to have an object in the world, that can realy interact with other objects and that is also dispbayable etc. you have to extend this class and override the needed functions. 6 */ 7 8 3 \brief Definition of the basic WorldEntity 4 */ 9 5 10 6 #ifndef WORLD_ENTITY_H 11 7 #define WORLD_ENTITY_H 12 8 13 #include " data_tank.h"9 #include "stdincl.h" 14 10 15 class Vector; 16 class Ability; 11 class CollisionCluster; 17 12 18 //! WorldEntity 19 /** 20 A base class for all objects in the world 21 22 This is the base class of all objects in the game-world. If you want to have an object in the world, that can realy interact with other objects and that is also dispbayable etc. you have to extend this class and override the needed functions. 23 */ 24 class WorldEntity { 13 //! Basic class from which all interactive stuff in the world is derived from 14 class WorldEntity 15 { 16 friend class World; 25 17 26 18 public: 27 WorldEntity ( );19 WorldEntity (bool isFree = false); 28 20 ~WorldEntity (); 29 21 22 Location* get_location (); 23 Placement* get_placement (); 24 void set_collision (CollisionCluster* newhull); 30 25 31 void setPosition(Vector* position); 32 Vector* getPosition(); 33 void setOrientation(Vector* orientation); 34 Vector* getOrientation(); 35 void setSpawnPoint(Vector* place); 36 void setSpeed(float speed); 37 float getSpeed(); 38 void setHealth(float health); 39 float getHealth(); 26 bool isFree (); 27 28 //void addAbility(Ability* ability); 29 //void removeAbility(Ability* ability); 40 30 41 void addAbility(Ability* ability); 42 void removeAbility(Ability* ability); 31 virtual void post_spawn (); 32 virtual void tick (float time); 33 virtual void hit (WorldEntity* weapon, Vector loc); 34 virtual void destroy (); 35 virtual void collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags); 36 virtual void command (Command* cmd); 37 38 virtual void draw (); 39 virtual void get_lookat (Location* locbuf); 43 40 44 virtual void tick(float dt); 45 virtual void paint(); 46 /* virtual void actionEvent(Event* event); */ 47 virtual void collide(WorldEntity* we, Vector loc); 48 virtual void hit(WorldEntity* weapon, Vector loc); 49 virtual void destroy(); 50 51 virtual void entityPreEnter(); 52 virtual void entityPostEnter(); 53 virtual void entityPreQuit(); 54 virtual void entityPostQuit(); 55 56 41 virtual void left_world (); 57 42 58 43 private: 59 Vector* position; //!< position of the entity 60 Vector* orientation; //!< orientation of the entity 61 /* List of abilities */ 62 float health; //!< health of the entity, if any 63 float speed; //!< speed of the entity if any 64 /* entity can be in the air or at ground: */ 65 int airGround; //!< is it air or bound to the ground (ground=0, air=1) 44 const bool bFree; 45 bool bCollide; 46 bool bDraw; 47 48 WorldEntity* owner; 49 CollisionCluster* collisioncluster; 50 Placement place; 51 Location loc; 66 52 67 68 53 void init( Location* spawnloc, WorldEntity* spawnowner); 54 void init( Placement* spawnplc, WorldEntity* spawnowner); 69 55 }; 70 56
Note: See TracChangeset
for help on using the changeset viewer.