Changeset 4332 in orxonox.OLD for orxonox/branches
- Timestamp:
- May 27, 2005, 7:14:55 PM (20 years ago)
- Location:
- orxonox/branches/physics/src
- Files:
-
- 2 deleted
- 39 edited
- 11 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/Makefile.am
r4293 r4332 81 81 lib/coord/null_parent.cc \ 82 82 lib/coord/helper_parent.cc \ 83 lib/coord/pilot_node.cc \ 83 84 lib/graphics/graphics_engine.cc \ 84 85 lib/graphics/light.cc \ … … 94 95 lib/graphics/particles/particle_system.cc \ 95 96 lib/graphics/particles/particle_emitter.cc \ 96 lib/lang/base_entity.cc \97 97 lib/lang/base_object.cc \ 98 98 lib/util/ini_parser.cc \ … … 107 107 defs/keynames.h \ 108 108 command_node.h \ 109 action_listener.h \ 109 110 defs/message_structures.h \ 110 111 util/loading/game_loader.h \ … … 151 152 lib/coord/null_parent.h \ 152 153 lib/coord/helper_parent.h \ 154 lib/coord/pilot_node.h \ 153 155 lib/graphics/graphics_engine.h \ 154 156 lib/graphics/light.h \ … … 165 167 lib/graphics/particles/particle_system.h \ 166 168 lib/graphics/particles/particle_emitter.h \ 167 lib/lang/base_entity.h \168 169 lib/lang/base_object.h \ 169 170 util/common/list.h \ -
orxonox/branches/physics/src/Makefile.in
r4293 r4332 68 68 test_bullet.$(OBJEXT) test_entity.$(OBJEXT) p_node.$(OBJEXT) \ 69 69 null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \ 70 graphics_engine.$(OBJEXT) light.$(OBJEXT) \70 pilot_node.$(OBJEXT) graphics_engine.$(OBJEXT) light.$(OBJEXT) \ 71 71 text_engine.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \ 72 72 md2Model.$(OBJEXT) primitive_model.$(OBJEXT) model.$(OBJEXT) \ 73 73 material.$(OBJEXT) texture.$(OBJEXT) particle_engine.$(OBJEXT) \ 74 74 particle_system.$(OBJEXT) particle_emitter.$(OBJEXT) \ 75 base_entity.$(OBJEXT) base_object.$(OBJEXT) \ 76 ini_parser.$(OBJEXT) substring.$(OBJEXT) vector.$(OBJEXT) \ 77 curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \ 75 base_object.$(OBJEXT) ini_parser.$(OBJEXT) substring.$(OBJEXT) \ 76 vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \ 78 77 benchmark.$(OBJEXT) 79 78 orxonox_OBJECTS = $(am_orxonox_OBJECTS) … … 85 84 @AMDEP_TRUE@ ./$(DEPDIR)/animation3d.Po \ 86 85 @AMDEP_TRUE@ ./$(DEPDIR)/animation_player.Po \ 87 @AMDEP_TRUE@ ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_entity.Po \ 88 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po \ 86 @AMDEP_TRUE@ ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_object.Po \ 89 87 @AMDEP_TRUE@ ./$(DEPDIR)/benchmark.Po ./$(DEPDIR)/camera.Po \ 90 88 @AMDEP_TRUE@ ./$(DEPDIR)/campaign.Po \ … … 107 105 @AMDEP_TRUE@ ./$(DEPDIR)/particle_engine.Po \ 108 106 @AMDEP_TRUE@ ./$(DEPDIR)/particle_system.Po \ 109 @AMDEP_TRUE@ ./$(DEPDIR)/p layer.Po \107 @AMDEP_TRUE@ ./$(DEPDIR)/pilot_node.Po ./$(DEPDIR)/player.Po \ 110 108 @AMDEP_TRUE@ ./$(DEPDIR)/primitive_model.Po \ 111 109 @AMDEP_TRUE@ ./$(DEPDIR)/projectile.Po \ … … 295 293 lib/coord/null_parent.cc \ 296 294 lib/coord/helper_parent.cc \ 295 lib/coord/pilot_node.cc \ 297 296 lib/graphics/graphics_engine.cc \ 298 297 lib/graphics/light.cc \ … … 308 307 lib/graphics/particles/particle_system.cc \ 309 308 lib/graphics/particles/particle_emitter.cc \ 310 lib/lang/base_entity.cc \311 309 lib/lang/base_object.cc \ 312 310 lib/util/ini_parser.cc \ … … 321 319 defs/keynames.h \ 322 320 command_node.h \ 321 action_listener.h \ 323 322 defs/message_structures.h \ 324 323 util/loading/game_loader.h \ … … 365 364 lib/coord/null_parent.h \ 366 365 lib/coord/helper_parent.h \ 366 lib/coord/pilot_node.h \ 367 367 lib/graphics/graphics_engine.h \ 368 368 lib/graphics/light.h \ … … 379 379 lib/graphics/particles/particle_system.h \ 380 380 lib/graphics/particles/particle_emitter.h \ 381 lib/lang/base_entity.h \382 381 lib/lang/base_object.h \ 383 382 util/common/list.h \ … … 476 475 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation_player.Po@am__quote@ 477 476 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ 478 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@479 477 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@ 480 478 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmark.Po@am__quote@ … … 507 505 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_engine.Po@am__quote@ 508 506 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_system.Po@am__quote@ 507 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot_node.Po@am__quote@ 509 508 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@ 510 509 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@ … … 1090 1089 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o helper_parent.obj `if test -f 'lib/coord/helper_parent.cc'; then $(CYGPATH_W) 'lib/coord/helper_parent.cc'; else $(CYGPATH_W) '$(srcdir)/lib/coord/helper_parent.cc'; fi` 1091 1090 1091 pilot_node.o: lib/coord/pilot_node.cc 1092 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT pilot_node.o -MD -MP -MF "$(DEPDIR)/pilot_node.Tpo" -c -o pilot_node.o `test -f 'lib/coord/pilot_node.cc' || echo '$(srcdir)/'`lib/coord/pilot_node.cc; \ 1093 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/pilot_node.Tpo" "$(DEPDIR)/pilot_node.Po"; else rm -f "$(DEPDIR)/pilot_node.Tpo"; exit 1; fi 1094 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/coord/pilot_node.cc' object='pilot_node.o' libtool=no @AMDEPBACKSLASH@ 1095 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/pilot_node.Po' tmpdepfile='$(DEPDIR)/pilot_node.TPo' @AMDEPBACKSLASH@ 1096 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1097 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o pilot_node.o `test -f 'lib/coord/pilot_node.cc' || echo '$(srcdir)/'`lib/coord/pilot_node.cc 1098 1099 pilot_node.obj: lib/coord/pilot_node.cc 1100 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT pilot_node.obj -MD -MP -MF "$(DEPDIR)/pilot_node.Tpo" -c -o pilot_node.obj `if test -f 'lib/coord/pilot_node.cc'; then $(CYGPATH_W) 'lib/coord/pilot_node.cc'; else $(CYGPATH_W) '$(srcdir)/lib/coord/pilot_node.cc'; fi`; \ 1101 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/pilot_node.Tpo" "$(DEPDIR)/pilot_node.Po"; else rm -f "$(DEPDIR)/pilot_node.Tpo"; exit 1; fi 1102 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/coord/pilot_node.cc' object='pilot_node.obj' libtool=no @AMDEPBACKSLASH@ 1103 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/pilot_node.Po' tmpdepfile='$(DEPDIR)/pilot_node.TPo' @AMDEPBACKSLASH@ 1104 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1105 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o pilot_node.obj `if test -f 'lib/coord/pilot_node.cc'; then $(CYGPATH_W) 'lib/coord/pilot_node.cc'; else $(CYGPATH_W) '$(srcdir)/lib/coord/pilot_node.cc'; fi` 1106 1092 1107 graphics_engine.o: lib/graphics/graphics_engine.cc 1093 1108 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.o -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.o `test -f 'lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`lib/graphics/graphics_engine.cc; \ … … 1297 1312 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1298 1313 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_emitter.obj `if test -f 'lib/graphics/particles/particle_emitter.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_emitter.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_emitter.cc'; fi` 1299 1300 base_entity.o: lib/lang/base_entity.cc1301 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_entity.o -MD -MP -MF "$(DEPDIR)/base_entity.Tpo" -c -o base_entity.o `test -f 'lib/lang/base_entity.cc' || echo '$(srcdir)/'`lib/lang/base_entity.cc; \1302 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/base_entity.Tpo" "$(DEPDIR)/base_entity.Po"; else rm -f "$(DEPDIR)/base_entity.Tpo"; exit 1; fi1303 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/lang/base_entity.cc' object='base_entity.o' libtool=no @AMDEPBACKSLASH@1304 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/base_entity.Po' tmpdepfile='$(DEPDIR)/base_entity.TPo' @AMDEPBACKSLASH@1305 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1306 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_entity.o `test -f 'lib/lang/base_entity.cc' || echo '$(srcdir)/'`lib/lang/base_entity.cc1307 1308 base_entity.obj: lib/lang/base_entity.cc1309 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_entity.obj -MD -MP -MF "$(DEPDIR)/base_entity.Tpo" -c -o base_entity.obj `if test -f 'lib/lang/base_entity.cc'; then $(CYGPATH_W) 'lib/lang/base_entity.cc'; else $(CYGPATH_W) '$(srcdir)/lib/lang/base_entity.cc'; fi`; \1310 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/base_entity.Tpo" "$(DEPDIR)/base_entity.Po"; else rm -f "$(DEPDIR)/base_entity.Tpo"; exit 1; fi1311 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/lang/base_entity.cc' object='base_entity.obj' libtool=no @AMDEPBACKSLASH@1312 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/base_entity.Po' tmpdepfile='$(DEPDIR)/base_entity.TPo' @AMDEPBACKSLASH@1313 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1314 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_entity.obj `if test -f 'lib/lang/base_entity.cc'; then $(CYGPATH_W) 'lib/lang/base_entity.cc'; else $(CYGPATH_W) '$(srcdir)/lib/lang/base_entity.cc'; fi`1315 1314 1316 1315 base_object.o: lib/lang/base_object.cc -
orxonox/branches/physics/src/command_node.cc
r4178 r4332 24 24 #include "list.h" 25 25 #include "orxonox.h" 26 #include "p_node.h" 26 27 27 28 #include <stdio.h> … … 37 38 CommandNode::CommandNode (int ID) 38 39 { 39 this->bound = new tList< WorldEntity>();40 this->bound = new tList<PNode>(); 40 41 this->aliases = NULL; 41 42 this->netID = ID; … … 54 55 this->bLocalInput = true; 55 56 this->netID = 0; 56 this->bound = new tList< WorldEntity>();57 this->bound = new tList<PNode>(); 57 58 this->bEnabled = true; 58 59 this->world = NULL; … … 194 195 \param entity: Pointer to the entity to bind 195 196 */ 196 void CommandNode::bind ( WorldEntity* entity)197 void CommandNode::bind (PNode* entity) 197 198 { 198 199 bound->add (entity); … … 203 204 \param entity: Pointer to the entity to relese 204 205 */ 205 void CommandNode::unbind ( WorldEntity* entity)206 void CommandNode::unbind (PNode* entity) 206 207 { 207 208 bound->remove (entity); … … 264 265 cmd.xrel = event.motion.xrel; 265 266 cmd.yrel = event.motion.yrel; 267 if( strlen (cmd.cmd) > 0) relay(&cmd); 266 268 break; 267 269 case SDL_MOUSEBUTTONUP: … … 308 310 if( this->world->command(cmd)) return; 309 311 310 tIterator< WorldEntity>* iterator = bound->getIterator();311 WorldEntity* entity = iterator->nextElement();312 tIterator<PNode>* iterator = bound->getIterator(); 313 PNode* entity = iterator->nextElement(); 312 314 while( entity != NULL) 313 315 { 314 entity->command (cmd); /*no absorbtion of command! strange*/316 ((WorldEntity*)entity)->command (cmd); /*no absorbtion of command! strange*/ 315 317 entity = iterator->nextElement(); 316 318 } -
orxonox/branches/physics/src/command_node.h
r4178 r4332 15 15 class WorldEntity; 16 16 class World; 17 class PNode; 17 18 18 19 #define N_STD_KEYS SDLK_LAST … … 45 46 int netID; //!< Unique identifier that is used to determine between remote CommandNodes 46 47 KeyBindings* aliases; 47 tList< WorldEntity>* bound; //!< List of WorldEntites that recieve commands from this CommandNode48 tList<PNode>* bound; //!< List of WorldEntites that recieve commands from this CommandNode 48 49 Sint32 coord[2]; 49 50 World* world; … … 64 65 void enable (bool bEnabled); 65 66 void loadBindings (char* filename); 66 void bind ( WorldEntity* entity);67 void unbind ( WorldEntity* entity);67 void bind (PNode* entity); 68 void unbind (PNode* entity); 68 69 void addToWorld (World* world); 69 70 void process (); -
orxonox/branches/physics/src/glmenu/glmenu_imagescreen.cc
r4283 r4332 88 88 void GLMenuImageScreen::init () 89 89 { 90 this->setClass Name ("GLMenuImageScreen");90 this->setClassID(CL_GLMENU_IMAGE_SCREEN, "GLMenuImageScreen"); 91 91 92 92 // Select Our VU Meter Background Texture -
orxonox/branches/physics/src/lib/coord/helper_parent.cc
r3544 r4332 30 30 HelperParent::HelperParent () 31 31 { 32 this->setClass Name ("HelperParent");32 this->setClassID(CL_HELPER_PARENT, "HelperParent"); 33 33 } 34 34 -
orxonox/branches/physics/src/lib/coord/p_node.h
r4274 r4332 93 93 const char* getName (); 94 94 95 96 95 void debug (); 97 96 -
orxonox/branches/physics/src/lib/graphics/graphics_engine.cc
r4283 r4332 34 34 this->minFPS = 9999; 35 35 this->maxFPS = 0; 36 this->setClass Name ("GraphicsEngine");36 this->setClassID(CL_GRAPHICS_ENGINE, "GraphicsEngine"); 37 37 38 38 this->fullscreen = false; -
orxonox/branches/physics/src/lib/graphics/light.cc
r3809 r4332 34 34 Light::Light(int lightNumber) 35 35 { 36 this->setClass Name("Light");36 this->setClassID(CL_LIGHT, "Light"); 37 37 char tmpName[7]; 38 38 sprintf(tmpName, "Light%d", lightNumber); … … 205 205 LightManager::LightManager () 206 206 { 207 this->setClass Name ("LightManager");207 this->setClassID(CL_LIGHT_MANAGER, "LightManager"); 208 208 209 209 glEnable (GL_LIGHTING); -
orxonox/branches/physics/src/lib/graphics/particles/particle_emitter.cc
r4328 r4332 30 30 float velocity) 31 31 { 32 this->setClass Name ("ParticleEmitter");32 this->setClassID(CL_PARTICLE_EMITTER, "ParticleEmitter"); 33 33 34 34 this->type = EMITTER_DOT; -
orxonox/branches/physics/src/lib/graphics/particles/particle_engine.cc
r4308 r4332 30 30 ParticleEngine::ParticleEngine () 31 31 { 32 this->setClass Name ("ParticleEngine");32 this->setClassID(CL_PARTICLE_ENGINE, "ParticleEngine"); 33 33 34 34 this->systemList = new tList<ParticleSystem>; -
orxonox/branches/physics/src/lib/graphics/particles/particle_system.cc
r4330 r4332 42 42 ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type) 43 43 { 44 this->setClassName ("ParticleSystem");44 this->setClassID(CL_PARTICLE_SYSTEM, "ParticleSystem"); 45 45 this->material = NULL; 46 46 this->name = NULL; -
orxonox/branches/physics/src/lib/graphics/text_engine.cc
r3953 r4332 51 51 Text::Text(Font* font, int type) 52 52 { 53 this->setClass Name("Text");53 this->setClassID(CL_TEXT, "Text"); 54 54 55 55 // initialize this Text … … 802 802 TextEngine::TextEngine () 803 803 { 804 this->setClass Name ("TextEngine");804 this->setClassID(CL_TEXT_ENGINE, "TextEngine"); 805 805 this->enableFonts(); 806 806 -
orxonox/branches/physics/src/lib/lang/base_object.cc
r4283 r4332 30 30 { 31 31 this->className = NULL; 32 this->id = -1; 32 33 this->finalized = false; 33 34 } … … 42 43 } 43 44 44 void BaseObject::setClassName (const char* className) 45 46 /** 47 \brief sets the class identifiers 48 \param a number for the class from class_list.h enumeration 49 \param the class name 50 */ 51 void BaseObject::setClassID(int id, const char* className) 52 { 53 this->id = id; 54 this->className = className; 55 } 56 57 58 /** 59 \brief sets the class identifier 60 \param a number for the class from class_list.h enumeration 61 */ 62 void BaseObject::setClassID (int id) 63 { 64 this->id = id; 65 } 66 67 68 /** 69 \brief sets the class identifiers 70 \param the class name 71 */ 72 void BaseObject::setClassName(const char* className) 45 73 { 46 74 this->className = className; 47 75 } 48 76 77 78 /** 79 \brief sets the class identifiers 80 \param a number for the class from class_list.h enumeration 81 \param the class name 82 */ 49 83 bool BaseObject::isA (char* className) 50 84 { … … 54 88 } 55 89 90 56 91 /* 57 bool BaseObject::isFinalized() 58 { 59 60 } 92 \brief this finalizes an object and makes it ready to be garbage collected 61 93 */ 62 63 94 void BaseObject::finalize() 64 95 { -
orxonox/branches/physics/src/lib/lang/base_object.h
r4283 r4332 9 9 10 10 #include "stdincl.h" 11 11 #include "class_list.h" 12 12 13 13 class BaseObject { … … 17 17 virtual ~BaseObject (); 18 18 19 void setClassName (const char* className); 19 void setClassID(int id); 20 void setClassName(const char* className); 21 void setClassID(int id, const char* className); 22 20 23 inline const char* getClassName(void) const { return this->className;}; 24 inline int getClassID(void) const { return this->id; } 21 25 bool isA (char* className); 22 26 … … 25 29 26 30 private: 27 const char* className; 28 bool finalized; 31 const char* className; //!< the name of the class 32 int id; //!< this is the id from the class_list.h enumeration 33 bool finalized; //!< is true if the object is ready to be garbage collected 29 34 }; 30 35 -
orxonox/branches/physics/src/proto/proto_class.cc
r4178 r4332 27 27 ProtoClass::ProtoClass () 28 28 { 29 this->setClassName ("ProtoClass"); 29 this->setClassID(CL_PROTO_ID, "ProtoClass"); 30 31 /* If you make a new class, what is most probably the case when you write this file 32 don't forget to: 33 1. Add the new file new_class.cc to the ./src/Makefile.am 34 2. Add the class identifier to ./src/class_list.h eg. CL_NEW_CLASS 35 36 Advanced Topics: 37 - if you want to let your object be managed via the ObjectManager make sure to read 38 the object_manager.h header comments. You will use this most certanly only if you 39 make many objects of your class, like a weapon bullet. 40 */ 30 41 } 31 42 -
orxonox/branches/physics/src/proto/proto_singleton.cc
r3655 r4332 26 26 ProtoSingleton::ProtoSingleton () 27 27 { 28 this->setClassName ("ProtoSingleton"); 28 this->setClassName("ProtoSingleton"); 29 this->setClassID(CL_PROTO_ID, "ProtoSingleton"); 29 30 31 /* If you make a new class, what is most probably the case when you write this file 32 don't forget to: 33 1. Add the new file new_class.cc to the ./src/Makefile.am 34 2. Add the class identifier to ./src/class_list.h eg. CL_NEW_CLASS 35 36 Advanced Topics: 37 - if you want to let your object be managed via the ObjectManager make sure to read 38 the object_manager.h header comments. You will use this most certanly only if you 39 make many objects of your class, like a weapon bullet. 40 */ 30 41 } 31 42 -
orxonox/branches/physics/src/story_entities/campaign.cc
r4283 r4332 110 110 ErrorMessage Campaign::start(int storyID = 0) 111 111 { 112 printf("World::start() - starting new StoryEntity Nr:%i\n", storyID);113 112 ErrorMessage errorCode; 114 113 if( !this->isInit) return errorCode; … … 119 118 while( se != NULL && this->running) 120 119 { 120 PRINTF(0)("Starting new StoryEntity Nr:%i\n", se->getStoryID()); 121 121 se->displayLoadScreen(); 122 122 se->preLoad(); … … 135 135 if( ( nextWorldID == WORLD_ID_GAMEEND) ||( se == NULL) ) 136 136 { 137 printf("Campaign::start() - quitting campaing story loop\n");137 PRINTF(0)("Quitting campaing story loop\n"); 138 138 if(se != NULL) 139 139 delete se; -
orxonox/branches/physics/src/story_entities/world.cc
r4314 r4332 27 27 #include "null_parent.h" 28 28 #include "helper_parent.h" 29 #include "pilot_node.h" 29 30 #include "track_node.h" 30 31 #include "world_entity.h" … … 201 202 void World::constuctorInit(char* name, int worldID) 202 203 { 203 this->setClass Name ("World");204 this->setClassID(CL_WORLD, "World"); 204 205 205 206 //this->worldName = name; … … 288 289 289 290 this->localCamera = new Camera(); 290 this->localCamera->setName (" camera");291 this->localCamera->setName ("Camera"); 291 292 292 293 State::getInstance()->setCamera(this->localCamera, this->localCamera->getTarget()); … … 308 309 { 309 310 PRINTF(1)("World has no path specified for loading"); 311 this->loadDebugWorld(this->getStoryID()); 310 312 return (ErrorMessage){213,"Path not specified","World::load()"}; 311 313 } … … 500 502 501 503 504 505 /** 506 \brief loads the debug world: only for experimental stuff 507 */ 502 508 void World::loadDebugWorld(int worldID) 503 509 { 510 printf("ajsdflkajs;dlfaj;slfja;lsjf;lajsf;la;sdfkja;lskdjfashdfklajshdflkjasdfh\n"); 504 511 /*monitor progress*/ 505 512 this->glmis->step(); … … 566 573 lightMan->setAmbientColor(.1,.1,.1); 567 574 lightMan->addLight(); 568 // lightMan->setAttenuation(1.0, .01, 0.0);569 // lightMan->setDiffuseColor(1,1,1);570 // lightMan->addLight(1);571 // lightMan->setPosition(20, 10, -20);572 // lightMan->setDiffuseColor(0,0,0);573 575 lightMan->debug(); 574 576 … … 585 587 lightMan->setPosition(-5.0, 10.0, -40.0); 586 588 587 // !\todo old track-system has to be removed 588 589 //create helper for player 590 //HelperParent* hp = new HelperParent (); 591 /* the player has to be added to this helper */ 592 593 // create a player 589 594 590 this->localPlayer = new Player (); 595 591 this->localPlayer->setName ("player"); 596 592 this->spawn (this->localPlayer); 597 593 /*monitor progress*/ 598 //this->glmis->step();599 594 this->glmis->step(); 600 595 601 // bind input602 Orxonox *orx = Orxonox::getInstance ();603 orx->getLocalInput()->bind (this->localPlayer);604 605 596 // bind camera 606 597 this->localCamera = new Camera(); 607 598 this->localCamera->setName ("camera"); 608 609 599 /*monitor progress*/ 610 600 this->glmis->step(); 611 601 612 sky = new SkyBox();613 // (SkyBox*)(sky)->setTexture("pictures/sky/skybox", "jpg");614 sky->setParent(localCamera);615 this->spawn(sky);616 617 /*monitor progress*/618 this->glmis->step();619 620 621 WorldEntity* env = new Environment();622 env->setName ("env");623 this->spawn(env);624 625 626 /*627 Vector* es = new Vector (10, 5, 0);628 Quaternion* qs = new Quaternion ();629 WorldEntity* pr = new Primitive(P_CYLINDER);630 pr->setName("primitive");631 this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);632 */633 634 /*monitor progress*/635 this->glmis->step();636 637 // trackManager->setBindSlave(env);638 PNode* tn = trackManager->getTrackNode();639 tn->addChild(this->localPlayer);640 this->localCamera->lookAt(tn);641 642 //localCamera->setParent(TrackNode::getInstance());643 tn->addChild(this->localCamera);644 // localCamera->lookAt(tn);645 this->localPlayer->setMode(PNODE_ALL);646 //Vector* cameraOffset = new Vector (0, 5, -10);647 trackManager->condition(2, LEFTRIGHT, this->localPlayer);648 this->glmis->step();649 break;650 }651 case DEBUG_WORLD_1:652 {653 lightMan->setPosition(.0, .0, .0);654 lightMan->setAttenuation(1.0, .01, 0.0);655 lightMan->setSpecularColor(1,0,0);656 this->nullParent = NullParent::getInstance ();657 this->nullParent->setName ("NullParent");658 659 // create a player660 WorldEntity* myPlayer = new Player();661 myPlayer->setName ("player");662 this->spawn(myPlayer);663 this->localPlayer = myPlayer;664 665 // bind input666 Orxonox *orx = Orxonox::getInstance();667 orx->getLocalInput()->bind (myPlayer);668 669 // bind camera670 this->localCamera = new Camera ();671 this->localCamera->setName ("camera");672 this->localCamera->lookAt(LightManager::getInstance()->getLight(0));673 this->localCamera->setParent(this->localPlayer);674 675 // Create SkySphere676 sky = new Skysphere("pictures/sky-replace.jpg");677 this->localPlayer->addChild(this->sky);678 this->spawn(this->sky);679 Vector* es = new Vector (20, 0, 0);680 Quaternion* qs = new Quaternion ();681 682 lightMan->getLight(0)->setParent(trackManager->getTrackNode());683 break;684 }685 case DEBUG_WORLD_2:686 {687 lightMan->setAmbientColor(.1,.1,.1);688 lightMan->addLight();689 lightMan->setPosition(-5.0, 10.0, -40.0);690 this->nullParent = NullParent::getInstance ();691 this->nullParent->setName ("NullParent");692 693 // !\todo old track-system has to be removed694 695 //create helper for player696 //HelperParent* hp = new HelperParent ();697 /* the player has to be added to this helper */698 699 // create a player700 this->localPlayer = new Player ();701 this->localPlayer->setName ("player");702 this->spawn (this->localPlayer);703 /*monitor progress*/704 //this->glmis->step();705 this->glmis->step();706 707 // bind input708 Orxonox *orx = Orxonox::getInstance ();709 orx->getLocalInput()->bind (this->localPlayer);710 711 // bind camera712 this->localCamera = new Camera();713 this->localCamera->setName ("camera");714 this->localCamera->lookAt(this->localPlayer);715 this->localCamera->setParent(this->localPlayer);716 717 /*monitor progress*/718 this->glmis->step();719 602 720 603 // Create SkySphere … … 728 611 729 612 730 WorldEntity* baseNode = new Satellite(Vector(1,0,1), 1.2); 731 this->localPlayer->addChild(baseNode); 732 baseNode->setRelCoor(Vector(10.0, 2.0, 1.0)); 733 this->spawn(baseNode); 734 735 WorldEntity* secondNode = new Satellite(Vector(0,0,1), 2.0); 736 baseNode->addChild(secondNode); 737 secondNode->setRelCoor(Vector(0.0, 0.0, 3.0)); 738 this->spawn(secondNode); 739 740 741 WorldEntity* thirdNode = new Satellite(Vector(0,0,1), 1.0); 742 secondNode->addChild(thirdNode); 743 thirdNode->setRelCoor(Vector(2.0, 0.0, 0.0)); 744 this->spawn(thirdNode); 745 746 747 748 WorldEntity* c = new Environment(); 749 this->localPlayer->addChild(c); 750 c->setRelCoor(Vector(10.0, 2.0, -1.0)); 751 this->spawn(c); 752 753 754 755 Animation3D* animation = new Animation3D(c); 756 animation->setInfinity(ANIM_INF_REPLAY); 757 758 759 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 760 animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 761 animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR); 762 763 764 765 766 767 768 /* 769 KeyFrame* f1 = new KeyFrame; 770 f1->position = new Vector(-1.1, 0.0, 2.6); 771 f1->direction = new Quaternion(); 772 f1->time = 1.0; 773 f1->mode = NEG_EXP; 774 775 776 KeyFrame* f2 = new KeyFrame; 777 f2->position = new Vector(-2.1, 0.0, 2.6); 778 f2->direction = new Quaternion(); 779 f2->time = 0.1; 780 f2->mode = NEG_EXP; 781 782 KeyFrame* f3 = new KeyFrame; 783 f3->position = new Vector(10.0, 2.0, -1.0); 784 f3->direction = new Quaternion(); 785 f3->time = 0.2; 786 f3->mode = NEG_EXP; 787 788 KeyFrame* f4 = new KeyFrame; 789 f4->position = new Vector(10.0, 5.0, -1.0); 790 f4->direction = new Quaternion(); 791 f4->time = 1.0; 792 f4->mode = NEG_EXP; 793 794 795 796 this->simpleAnimation->animatorBegin(); 797 this->simpleAnimation->selectObject(b); 798 this->simpleAnimation->setAnimationMode(SINGLE); 799 this->simpleAnimation->addKeyFrame(f1); 800 this->simpleAnimation->addKeyFrame(f2); 801 this->simpleAnimation->start(); 802 this->simpleAnimation->selectObject(c); 803 this->simpleAnimation->addKeyFrame(f3); 804 this->simpleAnimation->addKeyFrame(f4); 805 this->simpleAnimation->start(); 806 this->simpleAnimation->animatorEnd(); 807 */ 808 809 /* 810 Vector* es = new Vector (10, 5, 0); 811 Quaternion* qs = new Quaternion (); 812 WorldEntity* pr = new Primitive(P_CYLINDER); 813 pr->setName("primitive"); 814 this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT); 815 */ 816 613 terrain = new Terrain("worlds/newGround.obj"); 614 terrain->setRelCoor(Vector(0,-10,0)); 615 this->spawn(terrain); 817 616 /*monitor progress*/ 818 617 this->glmis->step(); 819 618 820 // trackManager->setBindSlave(env); 619 this->pilotNode = new PilotNode(); 620 this->pilotNode->addChild(this->localPlayer); 621 this->pilotNode->addChild(this->localCamera); 622 // bind input 623 Orxonox *orx = Orxonox::getInstance (); 624 //orx->getLocalInput()->bind (this->pilotNode); 625 626 /* 821 627 PNode* tn = trackManager->getTrackNode(); 822 628 tn->addChild(this->localPlayer); 823 824 //localCamera->setParent(TrackNode::getInstance());629 this->localCamera->lookAt(tn); 630 825 631 tn->addChild(this->localCamera); 826 // localCamera->lookAt(tn);827 632 this->localPlayer->setMode(PNODE_ALL); 828 //Vector* cameraOffset = new Vector (0, 5, -10);829 633 trackManager->condition(2, LEFTRIGHT, this->localPlayer); 634 */ 830 635 this->glmis->step(); 636 break; 637 } 638 case DEBUG_WORLD_1: 639 { 640 641 break; 642 } 643 case DEBUG_WORLD_2: 644 { 831 645 832 646 break; 833 647 } 834 648 default: 835 printf("World::load() - no world with ID %i found", this->debugWorldNr );649 break; 836 650 } 837 651 } … … 848 662 { 849 663 this->bPause = false; 664 this->pilotNode = NULL; 850 665 CommandNode* cn = Orxonox::getInstance()->getLocalInput(); 851 666 cn->addToWorld(this); … … 1321 1136 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW4)) this->localCamera->setViewMode(VIEW_RIGHT); 1322 1137 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW5)) this->localCamera->setViewMode(VIEW_TOP); 1323 1138 else if(this->pilotNode != NULL) if( !strcmp( cmd->cmd, "cursor")) this->pilotNode->command(cmd); 1324 1139 return false; 1325 1140 } -
orxonox/branches/physics/src/story_entities/world.h
r4283 r4332 24 24 class Text; 25 25 class TiXmlElement; 26 class PilotNode; 26 27 27 28 //! The game world Interface … … 123 124 tList<WorldEntity>* entities; //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them. 124 125 WorldEntity* localPlayer; //!< The Player, you fly through the level. 126 PilotNode* pilotNode; //!< THe pilot node to fly with the mouse 125 127 126 128 GarbageCollector* garbageCollector; //!< reference to the garbage collector -
orxonox/branches/physics/src/util/animation/animation_player.cc
r3953 r4332 28 28 AnimationPlayer::AnimationPlayer () 29 29 { 30 this->setClass Name ("AnimationPlayer");30 this->setClassID(CL_ANIMATION_PLAYER, "AnimationPlayer"); 31 31 32 32 this->animationList = new tList<Animation>(); -
orxonox/branches/physics/src/util/garbage_collector.cc
r4301 r4332 38 38 GarbageCollector::GarbageCollector () 39 39 { 40 this->setClass Name ("GarbageCollection");40 this->setClassID(CL_GARBAGE_COLLECTOR, "GarbageCollector"); 41 41 this->time = 0; 42 42 this->delay = 1.5f; /* clean up all 5.0 seconds */ … … 139 139 /* then finaly delete reference */ 140 140 //delete entity; 141 ObjectManager::getInstance()->addToDeadList(CL_TEST_BULLET, entity); 142 ObjectManager::getInstance()->debug(); 141 ObjectManager::getInstance()->addToDeadList(entity->getClassID(), entity); 143 142 } 144 143 entity = iterator->nextElement(); … … 148 147 PRINTF(3)("=============================\n"); 149 148 149 ObjectManager::getInstance()->debug(); 150 150 151 /* reset time to count again up to this->delay */ 151 152 this->time = 0; -
orxonox/branches/physics/src/util/loading/game_loader.cc
r4283 r4332 82 82 delete campaignName; 83 83 } 84 World* world0 = new World(DEBUG_WORLD_0); 85 world0->setNextStoryID(WORLD_ID_GAMEEND); 86 this->currentCampaign->addEntity(world0, WORLD_ID_2); 84 87 } 85 88 -
orxonox/branches/physics/src/util/loading/load_param.h
r4301 r4332 180 180 static LoadClassDescription* addClass(const char* className); 181 181 LoadParamDescription* addParam(const char* paramName); 182 182 183 183 184 static void printAll(const char* fileName = NULL); -
orxonox/branches/physics/src/util/object_manager.cc
r4301 r4332 28 28 ObjectManager::ObjectManager () 29 29 { 30 this->setClass Name ("ObjectManager");30 this->setClassID(CL_OBJECT_MANAGER, "ObjectManager"); 31 31 32 //this->managedObjectList = new BaseObject*[CL_NUMBER];33 32 this->managedObjectList = new tList<BaseObject>*[CL_NUMBER]; 33 for(int i = 0; i < CL_NUMBER; ++i) 34 { 35 this->managedObjectList[i] = NULL; 36 } 34 37 35 38 this->garbageCollector = GarbageCollector::getInstance(); 36 39 } 40 37 41 38 42 /** … … 62 66 63 67 64 void ObjectManager::cache(classList index, int number, const BaseObject ©Object) 65 { 66 //this->managedObjectList[index] = new BaseObject[number]; 67 this->managedObjectList[index] = new tList<BaseObject>(); 68 for(int i = 0; i < number; ++i) 69 { 70 this->managedObjectList[index]->add(new BaseObject(copyObject)); 71 } 72 } 73 74 75 void ObjectManager::addToDeadList(classList index, BaseObject* object) 68 void ObjectManager::addToDeadList(int index, BaseObject* object) 76 69 { 77 70 if( likely(this->managedObjectList[index] != NULL)) 78 71 this->managedObjectList[index]->add(object); 79 72 else 80 PRINTF(0)(" Error: unable to add object to the list nr. %i: no list initialized - ignoring\n", index);73 PRINTF(0)(" Critical: unable to add object to the list nr. %i: no list initialized - ignoring\n", index); 81 74 } 82 75 83 76 84 BaseObject* ObjectManager::getFromDeadList( classList index, int number)77 BaseObject* ObjectManager::getFromDeadList(int index, int number) 85 78 { 86 79 if( likely(this->managedObjectList[index] != NULL)) … … 88 81 BaseObject* obj = this->managedObjectList[index]->firstElement(); 89 82 this->managedObjectList[index]->remove(obj); 83 if( unlikely(obj == NULL)) 84 { 85 PRINTF(0)("Critical: there was no object anymore in the dead list! This could result in Segfaults\n"); 86 } 90 87 return obj; 91 88 } 92 89 else 93 PRINTF(0)(" Error: unable to get object from the list nr. %i: no elements initialized - ignoring\n", index); 90 PRINTF(0)(" Critical: unable to get object from the list nr. %i: no elements initialized - ignoring\n", index); 91 return NULL; 94 92 } 95 93 … … 102 100 for(int i = 0; i < CL_NUMBER; ++i) 103 101 { 104 if( this->managedObjectList[i] != NULL)102 if( this->managedObjectList[i] != NULL) 105 103 PRINT(0)("= o Class Nr. %i has cached %i object(s)\n", i, this->managedObjectList[i]->getSize()); 106 104 else -
orxonox/branches/physics/src/util/object_manager.h
r4301 r4332 8 8 - recycle deleted objects: specific for Projectils since there is a lot of world entity creation/deletion (and this needs a lot of time) 9 9 - control the garbage collector 10 11 TO ADD SUPPORT FOR A CLASS do the following steps: 12 1. include the hader file : #include "class_header.h" 13 2. add the class to the type enum classList {}; in class_list.h 14 3. define a function void mCache( ClassName ) in class ObjectManager 15 10 16 */ 11 17 … … 15 21 16 22 #include "base_object.h" 17 18 # define OM_23 #include "projectile.h" 24 #include "list.h" 19 25 20 26 #include "class_list.h" 21 27 22 28 23 29 class WorldEntity; … … 25 31 26 32 27 template<class T> class tList; 28 template<class T> class ManagedObject; 33 //! This defines the "template" makro function for cache(...) 34 #define mCache( Class ) \ 35 cache(classList index, int number, Class * copyObject) \ 36 { \ 37 this->managedObjectList[index] = new tList<BaseObject>(); \ 38 for(int i = 0; i < number; ++i)\ 39 {\ 40 this->managedObjectList[index]->add(new Class (*copyObject));\ 41 }\ 42 } 43 44 29 45 30 46 //! the object manager itself … … 35 51 virtual ~ObjectManager(void); 36 52 37 void cache(classList index, int number, const BaseObject ©Object);38 void addToDeadList( classList index, BaseObject* object);39 BaseObject* getFromDeadList( classList index, int number = 1);53 void mCache(Projectile); 54 void addToDeadList(int index, BaseObject* object); 55 BaseObject* getFromDeadList(int index, int number = 1); 40 56 41 57 void debug(); … … 43 59 private: 44 60 ObjectManager(void); 61 45 62 static ObjectManager* singletonRef; 46 63 47 //BaseObject** managedObjectList;48 64 tList<BaseObject>** managedObjectList; 49 65 GarbageCollector* garbageCollector; -
orxonox/branches/physics/src/util/resource_manager.cc
r4295 r4332 38 38 ResourceManager::ResourceManager () 39 39 { 40 this->setClass Name ("ResourceManager");40 this->setClassID(CL_RESOURCE_MANAGER, "ResourceManager"); 41 41 this->dataDir = NULL; 42 42 this->setDataDir("./"); -
orxonox/branches/physics/src/util/track/track_manager.cc
r4283 r4332 370 370 TrackManager::TrackManager(void) 371 371 { 372 this->setClass Name("TrackManager");372 this->setClassID(CL_TRACK_MANAGER, "TrackManager"); 373 373 374 374 TrackManager::singletonRef = this; // do this because otherwise the TrackNode cannot get The instance of the TrackManager -
orxonox/branches/physics/src/util/track/track_node.cc
r4283 r4332 32 32 TrackNode::TrackNode () 33 33 { 34 this->setClass Name("TrackNode");34 this->setClassID(CL_TRACK_NODE, "TrackNode"); 35 35 this->setName("TrackNode"); /* absolete but still used... */ 36 36 -
orxonox/branches/physics/src/world_entities/camera.cc
r4178 r4332 33 33 Camera::Camera(void) 34 34 { 35 this->setClass Name("Camera");35 this->setClassID(CL_CAMERA, "Camera"); 36 36 this->target = new CameraTarget(); 37 37 … … 190 190 CameraTarget::CameraTarget() 191 191 { 192 this->setClass Name("CameraTarget");192 this->setClassID(CL_CAMERA_TARGET, "CameraTarget"); 193 193 this->setMode(PNODE_MOVEMENT); 194 194 } -
orxonox/branches/physics/src/world_entities/character_attributes.cc
r3583 r4332 29 29 CharacterAttributes::CharacterAttributes () 30 30 { 31 this->setClass Name ("CharacterAttributes");31 this->setClassID(CL_CHARACTER_ATTRIBUTES, "CharacterAttributes"); 32 32 } 33 33 -
orxonox/branches/physics/src/world_entities/projectile.cc
r3755 r4332 33 33 Projectile::Projectile (Weapon* weapon) : WorldEntity() 34 34 { 35 this->setClassID(CL_PROJECTILE, "Projectile"); 35 36 this->weapon = weapon; 36 37 this->flightDirection = NULL; -
orxonox/branches/physics/src/world_entities/satellite.cc
r3750 r4332 31 31 Satellite::Satellite (Vector axis, float speed) 32 32 { 33 this->setClass Name ("Satellite");33 this->setClassID(CL_SATELLITE, "Satellite"); 34 34 this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL); 35 35 this->speed = speed; -
orxonox/branches/physics/src/world_entities/skybox.cc
r4283 r4332 62 62 void SkyBox::preInit(void) 63 63 { 64 this->setClass Name("SkyBox");64 this->setClassID(CL_SKYBOX, "SkyBox"); 65 65 this->skyModel = NULL; 66 66 this->material = new Material*[6]; -
orxonox/branches/physics/src/world_entities/terrain.cc
r4178 r4332 77 77 void Terrain::init(void) 78 78 { 79 this->setClassName ("Terrain"); 80 79 this->setClassID(CL_TERRAIN, "Terrain"); 81 80 this->objectList = 0; 82 81 } -
orxonox/branches/physics/src/world_entities/test_bullet.cc
r3757 r4332 33 33 TestBullet::TestBullet (Weapon* weapon) : Projectile(weapon) 34 34 { 35 this->setClassID(CL_TEST_BULLET, "TestBullet"); 35 36 this->model = (Model*)ResourceManager::getInstance()->load("models/test_projectile.obj", OBJ, RP_LEVEL); 36 37 } -
orxonox/branches/physics/src/world_entities/test_entity.cc
r4283 r4332 28 28 TestEntity::TestEntity () : WorldEntity() 29 29 { 30 this->setClassID(CL_TEST_ENTITY, "TestEntity"); 30 31 this->md2Model = new MD2Model(); 31 32 this->md2Model->loadModel(ResourceManager::getFullName("models/tris.md2")); -
orxonox/branches/physics/src/world_entities/test_gun.cc
r4301 r4332 45 45 : Weapon (parent, coordinate, direction) 46 46 { 47 this->setClassID(CL_TEST_GUN, "TestGun"); 47 48 this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN); 48 49 this->idleTime = 0.2f; … … 89 90 } 90 91 91 BaseObject* p = new TestBullet(this);92 ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, *p);92 Projectile* p = new TestBullet(this); 93 ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p); 93 94 ObjectManager::getInstance()->debug(); 94 95 } … … 143 144 } 144 145 145 Projectile* pj = new TestBullet(this); 146 Projectile* pj = (TestBullet*)ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET); 147 148 //printf( "object ref %p\n", ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET)); 149 150 //Projectile* pj = new TestBullet(this); 146 151 pj->setAbsCoor(this->getAbsCoor() + this->projectileOffset); 147 152 pj->setAbsDir(this->getAbsDir()); -
orxonox/branches/physics/src/world_entities/world_entity.cc
r4283 r4332 30 30 WorldEntity::WorldEntity(const TiXmlElement* root) 31 31 { 32 this->setClass Name ("WorldEntity");32 this->setClassID(CL_WORLD_ENTITY, "WorldEntity"); 33 33 this->model = NULL; 34 34
Note: See TracChangeset
for help on using the changeset viewer.