Changeset 4730 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 29, 2005, 1:46:15 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r4725 r4730 153 153 endif 154 154 155 SUBDIRS = lib . $(SUB_PROGS) subprojects155 SUBDIRS = lib . $(SUB_PROGS) 156 156 157 157 -
orxonox/trunk/src/Makefile.in
r4725 r4730 391 391 @SUB_PROJECTS_FALSE@SUB_PROGS = 392 392 @SUB_PROJECTS_TRUE@SUB_PROGS = subprojects 393 SUBDIRS = lib . $(SUB_PROGS) subprojects393 SUBDIRS = lib . $(SUB_PROGS) 394 394 all: all-recursive 395 395 -
orxonox/trunk/src/lib/physics/Makefile.am
r4539 r4730 2 2 include $(MAINSRCDIR)/defs/include_paths.am 3 3 4 noinst_LIBRARIES = libORXphysics.a 4 noinst_LIBRARIES = libORXphysics.a 5 5 6 6 libORXphysics_a_SOURCES = physics_interface.cc \ 7 8 9 10 11 12 7 physics_connection.cc \ 8 physics_engine.cc \ 9 fields/field.cc \ 10 fields/gravity.cc \ 11 fields/point_gravity.cc \ 12 fields/twirl.cc 13 13 14 14 noinst_HEADERS= physics_interface.h \ 15 16 17 18 19 20 21 15 physics_connection.h \ 16 physics_engine.h \ 17 fields/fields.h \ 18 fields/field.h \ 19 fields/gravity.h \ 20 fields/point_gravity.h \ 21 fields/twirl.h -
orxonox/trunk/src/lib/physics/Makefile.in
r4539 r4730 187 187 target_vendor = @target_vendor@ 188 188 MAINSRCDIR = ../.. 189 noinst_LIBRARIES = libORXphysics.a 189 noinst_LIBRARIES = libORXphysics.a 190 190 libORXphysics_a_SOURCES = physics_interface.cc \ 191 192 193 194 195 196 191 physics_connection.cc \ 192 physics_engine.cc \ 193 fields/field.cc \ 194 fields/gravity.cc \ 195 fields/point_gravity.cc \ 196 fields/twirl.cc 197 197 198 198 noinst_HEADERS = physics_interface.h \ 199 200 201 202 203 204 205 199 physics_connection.h \ 200 physics_engine.h \ 201 fields/fields.h \ 202 fields/field.h \ 203 fields/gravity.h \ 204 fields/point_gravity.h \ 205 fields/twirl.h 206 206 207 207 all: all-am -
orxonox/trunk/src/lib/physics/fields/field.cc
r4728 r4730 30 30 { 31 31 this->init(); 32 }33 34 /**35 \param root The XML-element to load settings from36 */37 Field::Field(const TiXmlElement* root)38 {39 this->init();40 this->loadParams(root);41 32 } 42 33 -
orxonox/trunk/src/lib/physics/fields/field.h
r4728 r4730 36 36 public: 37 37 Field(); 38 Field(const TiXmlElement* root);39 38 virtual ~Field(); 40 39 -
orxonox/trunk/src/lib/physics/fields/gravity.cc
r4728 r4730 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Benjamin Grauer 13 13 co-programmer: ... 14 14 */ … … 53 53 { 54 54 static_cast<Field*>(this)->loadParams(root); 55 56 55 } 57 56 -
orxonox/trunk/src/lib/physics/physics_engine.cc
r4728 r4730 21 21 22 22 #include "list.h" 23 #include "game_loader.h"24 23 #include "tinyxml.h" 24 #include "factory.h" 25 25 26 26 using namespace std; … … 30 30 \brief standard constructor 31 31 */ 32 PhysicsEngine::PhysicsEngine( )32 PhysicsEngine::PhysicsEngine(void) 33 33 { 34 34 this->setClassID(CL_PHYSICS_ENGINE, "PhysicsEngine"); … … 48 48 49 49 */ 50 PhysicsEngine::~PhysicsEngine ()50 PhysicsEngine::~PhysicsEngine(void) 51 51 { 52 52 PhysicsEngine::singletonRef = NULL; … … 56 56 \param root the XML-element to load settings from 57 57 */ 58 void loadParams(const TiXmlElement* root)59 { 60 const TiXmlElement* element ;61 62 PRINTF( 4)("Loading Physical Fields\n");58 void PhysicsEngine::loadParams(const TiXmlElement* root) 59 { 60 const TiXmlElement* element = NULL; 61 62 PRINTF(0)("Loading Physical Fields\n"); 63 63 element = root->FirstChildElement("Fields"); 64 { 65 element = element->FirstChildElement(); 66 GameLoader::getInstance()->fabricate(element); 64 printf("PPPPPOOOOINNNTERRRR: %p\n", element); 65 element = element->FirstChildElement(); 66 printf("PPPPPOOOOINNNTERRRR: %p\n", element); 67 while (element != NULL) 68 { 69 Factory::getFirst()->fabricate(element)->getName(); 67 70 68 71 element = element->NextSiblingElement(); 69 72 } 70 71 PRINTF(4)("Loading Physical Connections\n"); 72 element = root->FirstChildElement("PhysicsConnections"); 73 { 74 element = element->FirstChildElement(); 75 GameLoader::getInstance()->fabricate(element); 73 element = NULL; 74 75 PRINTF(0)("Loading Physical Connections\n"); 76 element = root->FirstChildElement("Connections"); 77 element = element->FirstChildElement(); 78 while (element != NULL) 79 { 80 Factory::getFirst()->fabricate(element); 76 81 77 82 element = element->NextSiblingElement(); 78 83 } 79 80 } 81 82 83 84 } 84 85 85 86 /** … … 260 261 PRINT(0)(" reference: %p\n", this); 261 262 PRINT(0)(" number of Interfaces: %d\n", this->interfaces->getSize()); 263 PRINT(0)(" number of Fields: %d\n", this->fields->getSize()); 262 264 PRINT(0)(" number of Connections: %d\n", this->connections->getSize()); 263 265 -
orxonox/trunk/src/story_entities/world.cc
r4728 r4730 415 415 416 416 LoadParam<ParticleEngine>(root, "ParticleEngine", ParticleEngine::getInstance(), &ParticleEngine::loadParams); 417 LoadParam<PhysicsEngine>(root, "PhysicsEngine", PhysicsEngine::getInstance(), &PhysicsEngine::loadParams); 417 418 418 419 // find Track … … 494 495 //////////// 495 496 496 Field* gravity = new Gravity(); 497 gravity->setMagnitude(30.0); 498 497 Gravity* test = new Gravity(); 499 498 500 499 // SYSTEM TRAILING THE PLAYER … … 525 524 particleEngine->addConnection(emitter, system); 526 525 527 new PhysicsConnection(system, gravity);526 //new PhysicsConnection(system, gravity); 528 527 // new PhysicsConnection(this->localPlayer, gravity); 529 528 … … 552 551 553 552 554 // new PhysicsConnection(testEntity, gravity); 555 556 // printing out some debug stuff 557 NullParent::getInstance()->debug(0); 558 this->localPlayer->whatIs(); 559 this->whatIs(); 560 GraphicsEngine::getInstance()->whatIs(); 553 PhysicsEngine::getInstance()->debug(); 554 561 555 } 562 556 -
orxonox/trunk/src/util/loading/factory.cc
r4729 r4730 35 35 this->setName(factoryName); 36 36 37 if (Factory::first == NULL) 38 Factory::first = this; 37 39 next = NULL; 38 40 39 41 initialize(); 40 42 } 43 44 Factory* Factory::first = NULL; 41 45 42 46 /** … … 55 59 56 60 /** 57 \brief generates the associated object from data58 */59 BaseObject* Factory::fabricate(const TiXmlElement* data)60 {61 return NULL;62 }63 64 /**65 61 \brief make this particular factory known to the LevelFactory 66 62 */ 67 63 void Factory::initialize() 68 64 { 69 #ifdef IS_ORXONOX70 65 GameLoader::getInstance()->registerFactory( this); 71 #endif /* IS_ORXONOX */72 66 } 73 67 -
orxonox/trunk/src/util/loading/factory.h
r4729 r4730 35 35 \todo make factoryName a BaseObject-parameter. (else it would be redundant) 36 36 */ 37 #define CREATE_FACTORY(CLASS_NAME) tFactory<CLASS_NAME>* global_##CLASS_NAME## Factory = new tFactory<CLASS_NAME>(#CLASS_NAME)37 #define CREATE_FACTORY(CLASS_NAME) tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(#CLASS_NAME) 38 38 39 39 //! The Factory is a loadable object handler … … 45 45 46 46 47 virtual BaseObject* fabricate(const TiXmlElement* root) ;47 virtual BaseObject* fabricate(const TiXmlElement* root) = NULL; 48 48 void initialize(); 49 49 void registerFactory( Factory* factory); 50 50 /** \brief sets the Next factory in the list \param nextFactory the next factory */ 51 51 inline void setNext( Factory* nextFactory) { this->next = nextFactory; }; 52 /** \returns the first factory */ 53 static Factory* getFirst(void) { return Factory::first; }; 52 54 /** \returns the next factory */ 53 55 Factory* getNext(void) const { return this->next; }; 56 54 57 55 58 private: … … 69 72 70 73 private: 71 BaseObject* fabricate(const TiXmlElement* root);74 virtual BaseObject* fabricate(const TiXmlElement* root); 72 75 }; 73 76 … … 79 82 tFactory<T>::tFactory(const char* factoryName) : Factory(factoryName) 80 83 { 81 PRINTF(5)(" fileName: %s loadable\n", this->getName());84 PRINTF(5)("Class: %s loadable\n", this->getName()); 82 85 } 83 86 … … 90 93 BaseObject* tFactory<T>::fabricate(const TiXmlElement* root) 91 94 { 92 if(!strcmp(root->Value(), getName()))95 if(!strcmp(root->Value(), this->getName())) 93 96 return new T ( root); 94 97 else if( getNext() != NULL)
Note: See TracChangeset
for help on using the changeset viewer.