Changeset 2043 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Jun 30, 2004, 8:38:43 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r2036 r2043 6 6 7 7 bin_PROGRAMS=orxonox 8 orxonox_SOURCES=orxonox.cc world.cc environment.cc player.cc npc.cc input_output.cc data_tank.cc ai.cc shoot_laser.cc shoot_rocket.cc world_entity.cc synchronisable.cc list.cc 8 orxonox_SOURCES=orxonox.cc world.cc environment.cc player.cc npc.cc input_output.cc data_tank.cc ai.cc shoot_laser.cc shoot_rocket.cc world_entity.cc synchronisable.cc list.cc vector.cc ability.cc 9 9 10 10 # uncomment the following if bencoder requires the math library -
orxonox/trunk/src/Makefile.in
r2036 r2043 117 117 #"-O3 -pedantic -fPIC -ffast-math -I/usr/X11R6/include" 118 118 bin_PROGRAMS = orxonox 119 orxonox_SOURCES = orxonox.cc world.cc environment.cc player.cc npc.cc input_output.cc data_tank.cc ai.cc shoot_laser.cc shoot_rocket.cc world_entity.cc synchronisable.cc list.cc 119 orxonox_SOURCES = orxonox.cc world.cc environment.cc player.cc npc.cc input_output.cc data_tank.cc ai.cc shoot_laser.cc shoot_rocket.cc world_entity.cc synchronisable.cc list.cc vector.cc ability.cc 120 120 subdir = src 121 121 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 130 130 input_output.$(OBJEXT) data_tank.$(OBJEXT) ai.$(OBJEXT) \ 131 131 shoot_laser.$(OBJEXT) shoot_rocket.$(OBJEXT) \ 132 world_entity.$(OBJEXT) synchronisable.$(OBJEXT) list.$(OBJEXT) 132 world_entity.$(OBJEXT) synchronisable.$(OBJEXT) list.$(OBJEXT) \ 133 vector.$(OBJEXT) ability.$(OBJEXT) 133 134 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 134 135 orxonox_LDADD = $(LDADD) … … 139 140 depcomp = $(SHELL) $(top_srcdir)/depcomp 140 141 am__depfiles_maybe = depfiles 141 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/a i.Po ./$(DEPDIR)/data_tank.Po \142 @AMDEP_TRUE@ ./$(DEPDIR)/ environment.Po \142 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ability.Po ./$(DEPDIR)/ai.Po \ 143 @AMDEP_TRUE@ ./$(DEPDIR)/data_tank.Po ./$(DEPDIR)/environment.Po \ 143 144 @AMDEP_TRUE@ ./$(DEPDIR)/input_output.Po ./$(DEPDIR)/list.Po \ 144 145 @AMDEP_TRUE@ ./$(DEPDIR)/npc.Po ./$(DEPDIR)/orxonox.Po \ 145 146 @AMDEP_TRUE@ ./$(DEPDIR)/player.Po ./$(DEPDIR)/shoot_laser.Po \ 146 147 @AMDEP_TRUE@ ./$(DEPDIR)/shoot_rocket.Po \ 147 @AMDEP_TRUE@ ./$(DEPDIR)/synchronisable.Po ./$(DEPDIR)/ world.Po \148 @AMDEP_TRUE@ ./$(DEPDIR)/world _entity.Po148 @AMDEP_TRUE@ ./$(DEPDIR)/synchronisable.Po ./$(DEPDIR)/vector.Po \ 149 @AMDEP_TRUE@ ./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po 149 150 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 150 151 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 199 200 -rm -f *.tab.c 200 201 202 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ability.Po@am__quote@ 201 203 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ai.Po@am__quote@ 202 204 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_tank.Po@am__quote@ … … 210 212 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shoot_rocket.Po@am__quote@ 211 213 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synchronisable.Po@am__quote@ 214 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ 212 215 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/world.Po@am__quote@ 213 216 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/world_entity.Po@am__quote@ -
orxonox/trunk/src/world_entity.cc
r2036 r2043 20 20 #include "world_entity.h" 21 21 22 #include "vector.h" 23 22 24 using namespace std; 23 25 24 26 27 /** 28 \brief 29 \param v: 30 \return 31 */ 32 33 /** 34 \brief Constructor 35 36 This Constructor initializises the all WorldEntities. Everything, that is a part of the game-world is a child of WorldEntity. This class implements empty functions for all sort of operation a WorldEntity has to or can implement. 37 This is some sort of standard interface to all WorldEntities... 38 */ 25 39 WorldEntity::WorldEntity () 26 40 { … … 32 46 WorldEntity::~WorldEntity () {} 33 47 48 /** 49 \brief sets the position of this entity 50 \param position: Vector, pointing (from 0,0,0) to the new position 51 */ 52 void WorldEntity::setPosition(Vector* position) {} 34 53 35 /*void WorldEntity::setPosition( Vector position ) {} */ 36 /* Vector* void getPosition() {} */ 54 /** 55 \brief gets the postion of this entity 56 \return a Vector, pointing (from 0,0,0) to the new position 57 */ 58 Vector* getPosition() {} 37 59 38 void WorldEntity::setOrientation(/* Vector orientation*/) {} 39 /* Vector* */ void WorldEntity::getOrientation() {} 60 /** 61 \brief sets orientation of this entity 62 \param orientation: vector specifying in which direction the entity looks 63 */ 64 void WorldEntity::setOrientation(Vector* orientation) {} 40 65 66 /** 67 \brief gets orientation of this entity 68 \return vector specifying in which direction the entity looks 69 */ 70 Vector* WorldEntity::getOrientation() {} 71 72 /** 73 \brief sets the speed of the entity, if any 74 \param speed: the speed in points (openGL points) per seconds 75 */ 41 76 void WorldEntity::setSpeed(float speed) 42 77 { … … 44 79 } 45 80 81 /** 82 \brief gets the speed of the entity, if any 83 \return the speed in points (openGL points) per seconds 84 */ 46 85 float WorldEntity::getSpeed() 47 86 { … … 49 88 } 50 89 90 /** 91 \brief sets the health of the entity 92 \param health: number for the life count, normaly {0..100} 93 */ 51 94 void WorldEntity::setHealth(float health) 52 95 { … … 54 97 } 55 98 99 /** 100 \brief gets the health of the entity 101 \return number for the life count, normaly {0..100} 102 */ 56 103 float WorldEntity::getHealth() 57 104 { … … 59 106 } 60 107 108 /** 109 \brief this method is called every tick 110 \param time: the time since start of the world 61 111 62 void WorldEntity::tick(float dt) 112 This function is called before every repaint of the world, to update every time dependent variable of the entity. If the entity moves, it has to calculate the new position every tick here in this function. Do not use this for animations. 113 */ 114 void WorldEntity::tick(float time) 63 115 {} 64 116 117 /** 118 \brief the entity is painted to the screen with this function 119 120 This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn. 121 */ 65 122 void WorldEntity::paint() 66 123 { … … 69 126 70 127 /* virtual void WorldEntity::actionEvent(Event* event); */ 71 void WorldEntity::collide(WorldEntity* we /*, Vector n */) 72 {} 128 /** 129 \brief this function is called, when two entities collide 130 \param we: the world entity, with whom it collides 131 \param loc: place where the collision happens 132 */ 133 void WorldEntity::collide(WorldEntity* we, Vector loc) {} 73 134 74 void WorldEntity::hurt() 75 {} 135 /** 136 \brief this function is called, when the ship is hit by a waepon 137 \param weapon: the laser/rocket/shoot that hits. 138 \param loc: place where it is hit 76 139 77 void WorldEntity::destroy() 78 {} 140 calculate the damage depending 141 */ 142 void WorldEntity::hit(WorldEntity* weapon, Vector loc) {} 143 144 /** 145 \brief this function is called, if the entity is to be destroied 146 147 This can be called, if eg. something realy bad happens :) 148 */ 149 void WorldEntity::destroy() {} 150 151 /** 152 \brief this function is automatically called before the entity enters the world 153 */ 154 void WorldEntity::entityPreEnter() {} 155 156 /** 157 \brief this function is automatically called after the entity enters the world 158 159 */ 160 void WorldEntity::entityPostEnter() {} 161 162 /** 163 \brief this function is automatically called before the entity quits the world 164 165 */ 166 void WorldEntity::entityPreQuit() {} 167 168 /** 169 \brief this function is automatically called after the entity quits the world 170 */ 171 void WorldEntity::entityPostQuit() {} -
orxonox/trunk/src/world_entity.h
r2036 r2043 5 5 #include "data_tank.h" 6 6 7 class Vector; 8 class Ability; 7 9 8 10 class WorldEntity { … … 13 15 14 16 15 /*void setPosition( Vector position );*/ 16 /* Vector* void getPosition();*/ 17 void setOrientation(/* Vector orientation*/); 18 /* Vector* */ void getOrientation(); 17 void setPosition(Vector* position); 18 Vector* getPosition(); 19 void setOrientation(Vector* orientation); 20 Vector* getOrientation(); 21 void setSpawnPoint(Vector* place); 19 22 void setSpeed(float speed); 20 23 float getSpeed(); … … 22 25 float getHealth(); 23 26 24 void addAbility( );25 void removeAbility( );27 void addAbility(Ability* ability); 28 void removeAbility(Ability* ability); 26 29 27 virtual void tick(float dt);30 virtual void tick(float time); 28 31 virtual void paint(); 29 32 /* virtual void actionEvent(Event* event); */ 30 virtual void collide(WorldEntity* we /*, Vector n */);31 virtual void h urt();33 virtual void collide(WorldEntity* we, Vector loc); 34 virtual void hit(WorldEntity* weapon, Vector loc); 32 35 virtual void destroy(); 33 36 37 virtual void entityPreEnter(); 38 virtual void entityPostEnter(); 39 virtual void entityPreQuit(); 40 virtual void entityPostQuit(); 41 42 43 34 44 private: 35 /* Vector* position; */36 /* Vector* orientation; */45 Vector* position; 46 Vector* orientation; 37 47 /* List of abilities */ 38 48 float health; 39 49 float speed; 50 /* entity can be in the air or at ground: */ 51 int airGround; 52 40 53 41 54
Note: See TracChangeset
for help on using the changeset viewer.