Changeset 4555 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 8, 2005, 2:17:00 PM (20 years ago)
- Location:
- orxonox/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/configure.ac
r4529 r4555 1 ########################################################################## 2 # orxonox - the future of 3D-vertical-scrollers 3 # 4 # Copyright (C) 2004 orx 5 # 1 ########################################################################## 2 # orxonox - the future of 3D-vertical-scrollers # 3 # # 4 # Copyright (C) 2004 orx # 5 # # 6 6 # This program is free software; you can redistribute it and/or modify # 7 7 # it under the terms of the GNU General Public License as published by # 8 8 # the Free Software Foundation; either version 2, or (at your option) # 9 # any later version. 10 # 11 # ### File Specific: 12 # main-programmer: Benjamin Grauer 13 # co-programmer: ... 14 # 15 # This is the main configuration File of autoconf. 9 # any later version. # 10 # # 11 # ### File Specific: # 12 # main-programmer: Benjamin Grauer # 13 # co-programmer: ... # 14 # # 15 # This is the main configuration File of autoconf. # 16 16 # Please edit this file only, if you exactly know what you are doing. # 17 17 # It is quite fragile, and compiling orxonox on different Platforms # … … 51 51 DEBUG=no 52 52 AC_MSG_CHECKING([if DEBUG-mode should be enabled]) 53 AC_ARG_ENABLE([debug], 54 AC_HELP_STRING([--enable-debug], [compiles in debug mode. Lots of debug info about the game.]),55 56 57 if test x$DEBUG = xno; then 58 59 60 53 AC_ARG_ENABLE([debug], 54 AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]), 55 DEBUG=$enableval) 56 57 if test x$DEBUG = xno; then 58 echo "no" 59 echo " -> Setting debuglevel to 4. (orxonox is still in Development. It really is needed." 60 DEBUG=4 61 61 elif test x$DEBUG = xyes; then 62 63 64 65 else 66 67 fi 68 62 echo "yes" 63 echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!." 64 DEBUG=4 65 else 66 echo "yes: setting debuglevel to to $DEBUG" 67 fi 68 AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are]) 69 69 70 70 AC_SUBST(DEBUG) … … 75 75 MODULAR_DEBUG=yes 76 76 AC_MSG_CHECKING([if Modular-DEBUG-mode should be ebabled]) 77 AC_ARG_ENABLE([modular-debug], 78 AC_HELP_STRING([--disable-modular-debug], [compiles in modular-debug mode, that logs differently on the many modules of orxonox.]),79 80 81 if test x$MODULAR_DEBUG = xno; then 82 77 AC_ARG_ENABLE([modular-debug], 78 AC_HELP_STRING( [--disable-modular-debug], [compiles in modular-debug mode, that logs differently on the many modules of orxonox.]), 79 MODULAR_DEBUG=$enableval) 80 81 if test x$MODULAR_DEBUG = xno; then 82 echo "no" 83 83 elif test x$MODULAR_DEBUG = xyes; then 84 85 84 echo "yes" 85 AC_DEFINE_UNQUOTED(MODULAR_DEBUG, 1, [if Modular-DUBUG mode is enabled]) 86 86 fi 87 87 … … 90 90 #--------------# 91 91 AC_MSG_CHECKING([if gtk should be enabled]) 92 AC_ARG_WITH([gtk], 93 AC_HELP_STRING( [--without-gtk], 94 [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes]) 95 if test x$def_gtk = xyes; then 92 AC_ARG_WITH([gtk], 93 AC_HELP_STRING( [--without-gtk], 94 [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes]) 95 if test x$def_gtk = xyes; then 96 96 echo "yes" 97 fi 98 if test x$def_gtk = xno; then 97 fi 98 if test x$def_gtk = xno; then 99 99 echo "no" 100 100 fi … … 104 104 #------------------# 105 105 AC_MSG_CHECKING([if libcURL should be enabled]) 106 AC_ARG_WITH([curl], 107 AC_HELP_STRING( [--without-curl], 108 [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes]) 109 if test x$def_curl = xyes; then 106 AC_ARG_WITH([curl], 107 AC_HELP_STRING( [--without-curl], 108 [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes]) 109 if test x$def_curl = xyes; then 110 110 echo "yes" 111 fi 112 if test x$def_curl = xno; then 111 fi 112 if test x$def_curl = xno; then 113 113 echo "no" 114 114 fi … … 119 119 def_sub_projects=no 120 120 AC_MSG_CHECKING([if the SubProjects should be built]) 121 AC_ARG_ENABLE([sub-projects], 122 AC_HELP_STRING( [--enable-sub-projects], 123 [also builds the subProjects while make from srcdir]), [def_sub_projects=yes]) 121 AC_ARG_ENABLE([sub-projects], 122 AC_HELP_STRING( [--enable-sub-projects], 123 [also builds the subProjects while make from srcdir]), [def_sub_projects=yes]) 124 124 if test x$def_sub_projects = xyes; then 125 125 echo "yes" 126 fi 126 fi 127 127 if test x$def_sub_projects = xno; then 128 128 echo "no" … … 135 135 def_profiling=no 136 136 AC_MSG_CHECKING([if Profiling should be enabled]) 137 AC_ARG_ENABLE([profile], 138 AC_HELP_STRING( [--enable-profile], 139 [builds orxonox with profiling support]), [def_profiling=yes]) 137 AC_ARG_ENABLE([profile], 138 AC_HELP_STRING( [--enable-profile], 139 [builds orxonox with profiling support]), [def_profiling=yes]) 140 140 if test x$def_profiling = xyes; then 141 141 echo "yes" 142 142 CXXFLAGS="$CXXFLAGS -pg" 143 fi 143 fi 144 144 if test x$def_profiling = xno; then 145 145 echo "no" … … 151 151 def_efence=no 152 152 AC_MSG_CHECKING([if efence should be enabled]) 153 AC_ARG_ENABLE([efence], 154 AC_HELP_STRING( [--enable-efence], 155 [builds orxonox with efence support]), [def_efence=yes]) 153 AC_ARG_ENABLE([efence], 154 AC_HELP_STRING( [--enable-efence], 155 [builds orxonox with efence support]), [def_efence=yes]) 156 156 if test x$def_efence = xyes; then 157 157 echo "yes" 158 fi 158 fi 159 159 if test x$def_efence = xno; then 160 160 echo "no" … … 166 166 def_documentation=no 167 167 AC_MSG_CHECKING([if the Documentation should be build by default]) 168 AC_ARG_ENABLE([documentation], 169 AC_HELP_STRING( [--enable-documentation], 170 [also builds the sDocumentation while make from srcdir]), [def_documentation=yes]) 168 AC_ARG_ENABLE([documentation], 169 AC_HELP_STRING( [--enable-documentation], 170 [also builds the sDocumentation while make from srcdir]), [def_documentation=yes]) 171 171 if test x$def_documentation = xyes; then 172 172 echo "yes" 173 fi 173 fi 174 174 if test x$def_documentation = xno; then 175 175 echo "no" … … 222 222 223 223 # checking gl header 224 224 #done before loop 225 225 226 226 # checking gl header … … 230 230 AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h") 231 231 if test x$FOUND_opengl32 = xyes ; then 232 232 LIBS="$LIBS -lopengl32" 233 233 else 234 235 236 237 238 234 echo "------------------" 235 echo "opengl not found." 236 echo "please install the opengl package which can be found at http://www.opengl.org" 237 echo "------------------" 238 exit -1 239 239 fi 240 240 … … 246 246 AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes) 247 247 if test x$FOUND_glu32 = xyes ; then 248 248 LIBS="$LIBS -lGLU32" 249 249 else 250 251 252 253 254 250 echo "------------------" 251 echo "GLU library not found." 252 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" 253 echo "------------------" 254 exit -1 255 255 fi 256 256 257 257 # checking for mingw32 258 258 AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) 259 if test x$FOUND_mingw32 = xyes; then 260 259 if test x$FOUND_mingw32 = xyes; then 260 LIBS="$LIBS -lmingw32" 261 261 fi 262 262 # checking for SDL-headers … … 306 306 LIBS="$LIBS -lGL" 307 307 else 308 309 310 311 312 308 echo "------------------" 309 echo "opengl not found." 310 echo "please install the opengl package which can be found at http://www.opengl.org" 311 echo "------------------" 312 exit -1 313 313 fi 314 314 … … 321 321 LIBS="$LIBS -lGLU" 322 322 else 323 324 325 326 327 328 fi 323 echo "------------------" 324 echo "GLU library not found." 325 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" 326 echo "------------------" 327 exit -1 328 fi 329 329 330 330 # checking for SDL-headers … … 339 339 echo "------------------" 340 340 echo "SDL library not found." 341 341 echo "please install the SDL library, which can be found at http://www.libsdl.org" 342 342 echo "------------------" 343 343 exit -1 344 fi 344 fi 345 345 346 346 … … 415 415 echo "------------------" 416 416 echo "openal library not found." 417 417 echo "please install the openal library, which can be found at http://www.openal.org" 418 418 echo "------------------" 419 419 exit -1 … … 433 433 echo "------------------" 434 434 echo "ogg library not found." 435 435 echo "please install the ogg library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" 436 436 echo "------------------" 437 437 exit -1 … … 448 448 echo "------------------" 449 449 echo "vorbis library not found." 450 450 echo "please install the vorbis library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" 451 451 echo "------------------" 452 452 exit -1 … … 466 466 echo "------------------" 467 467 echo "vorbisfile library not found." 468 468 echo "please install the vorbisfile library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" 469 469 echo "------------------" 470 470 exit -1 … … 485 485 echo "------------------" 486 486 echo "SDL_ttf library not found." 487 487 echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/" 488 488 echo "------------------" 489 489 exit -1 490 fi 490 fi 491 491 492 492 … … 512 512 # GTK # 513 513 #-----# 514 if test x$def_gtk = xyes; then 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 514 if test x$def_gtk = xyes; then 515 #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no) 516 AC_MSG_CHECKING([for gtk2.0]) 517 if `$PKG_CONFIG --exists gtk+-2.0`; then 518 echo "yes" 519 have_gtk2=yes 520 GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0` 521 GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` 522 AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2]) 523 if test $DEBUG -ge 3; then 524 echo "cflags: $GTK2_CFLAGS" 525 echo "libs: $GTK2_LIBS" 526 fi 527 else 528 echo "no" 529 fi 530 530 531 531 fi … … 537 537 # libcURL # 538 538 #---------# 539 if test x$def_curl = xyes; then 539 if test x$def_curl = xyes; then 540 540 541 541 AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"]) … … 563 563 LIBS="$LIBS -lefence" 564 564 fi 565 565 566 566 fi 567 567 … … 569 569 AC_CHECK_LIB([m], [main]) 570 570 571 571 572 572 # Checks for header files. 573 573 AC_HEADER_STDC … … 586 586 AC_CONFIG_FILES([Makefile 587 587 src/Makefile 588 589 590 591 592 593 594 595 596 588 src/lib/Makefile 589 src/lib/graphics/Makefile 590 src/lib/graphics/importer/Makefile 591 src/lib/sound/Makefile 592 src/lib/event/Makefile 593 src/lib/physics/Makefile 594 src/lib/particles/Makefile 595 src/lib/collision_detection/Makefile 596 src/lib/gui/Makefile 597 597 src/lib/tinyxml/Makefile 598 599 600 601 602 603 604 598 src/subprojects/Makefile 599 src/subprojects/testmain/Makefile 600 src/subprojects/importer/Makefile 601 src/subprojects/particles/Makefile 602 src/subprojects/collision_detection/Makefile 603 src/subprojects/gui/Makefile 604 ]) 605 605 606 606 AC_OUTPUT -
orxonox/trunk/orxonox.kdevelop
r4540 r4555 8 8 <primarylanguage>C++</primarylanguage> 9 9 <ignoreparts/> 10 <projectdirectory> /home/bensch/svn/orxonox/trunk</projectdirectory>11 <absoluteprojectpath> true</absoluteprojectpath>10 <projectdirectory>.</projectdirectory> 11 <absoluteprojectpath>false</absoluteprojectpath> 12 12 <description></description> 13 13 <secondaryLanguages/> … … 22 22 <directoryradio>executable</directoryradio> 23 23 <customdirectory>/</customdirectory> 24 <programargs ></programargs>24 <programargs/> 25 25 <terminal>false</terminal> 26 26 <autocompile>true</autocompile> … … 159 159 <kdevdocumentation> 160 160 <projectdoc> 161 <docsystem ></docsystem>162 <docurl ></docurl>163 <usermanualurl ></usermanualurl>161 <docsystem/> 162 <docurl/> 163 <usermanualurl/> 164 164 </projectdoc> 165 165 </kdevdocumentation> -
orxonox/trunk/src/lib/physics/physics_interface.cc
r4480 r4555 1 1 2 2 3 /* 3 /* 4 4 orxonox - the future of 3D-vertical-scrollers 5 5 … … 14 14 main-programmer: Patrick Boenzli 15 15 co-programmer: Benjamin Grauer 16 16 17 17 bensch: renamed the file 18 18 */ … … 36 36 \brief standard constructor 37 37 */ 38 PhysicsInterface::PhysicsInterface (void* objectPointer) 38 PhysicsInterface::PhysicsInterface (void* objectPointer) 39 39 { 40 40 this->objectPointer = objectPointer; … … 50 50 /** 51 51 \brief standard deconstructor 52 53 52 */ 54 PhysicsInterface::~PhysicsInterface () 53 PhysicsInterface::~PhysicsInterface () 55 54 { 56 55 PhysicsEngine::getInstance()->removePhysicsInterface(this); … … 67 66 PNode* massCalcPNode = dynamic_cast<PNode*>(this); //! \todo not sure if this will work .... 68 67 float massSum = 0; 69 68 70 69 tIterator<PNode>* iterator = massCalcPNode->children->getIterator(); 71 70 PNode* pn = iterator->nextElement(); 72 while( pn != NULL) 73 { 71 while( pn != NULL) 72 { 74 73 // todo: find out if children are PhysicsInterface in an efficient way 75 74 if (strcmp( pn->getClassName(), "PhysicsInterface")) { … … 79 78 } 80 79 delete iterator; 81 80 82 81 if (massSum != this->massChildren ) { 83 82 this->massChildren = massSum; … … 89 88 */ 90 89 } 91 90 92 91 /** 93 92 \brief applyes a field to this Object … … 97 96 { 98 97 PNode* tmp = (PNode*) objectPointer; 99 this->forceSum += field->calcForce(tmp->getAbsCoor()); 98 this->forceSum += field->calcForce(tmp->getAbsCoor()); 100 99 } 101 100 -
orxonox/trunk/src/lib/physics/physics_interface.h
r4480 r4555 1 /*! 1 /*! 2 2 \file physics_interface.h 3 3 \brief a physics interface simulating a body with a mass … … 45 45 virtual void recalcMass(); 46 46 47 47 48 48 private: 49 49 void* objectPointer; //!< A Pointer to the object we handel (actually should be this) 50 float mass; //!< Mass of this object 51 float massChildren; //!< Sum of the masses of the children nodes 52 Vector forceSum; //!< Total central force for this tick 53 Quaternion momentumSum; //!< Total momentum in this tick 54 55 50 float mass; //!< Mass of this object 51 float massChildren; //!< Sum of the masses of the children nodes 52 Vector forceSum; //!< Total central force for this tick 53 Quaternion momentumSum; //!< Total momentum in this tick 56 54 }; 57 55 -
orxonox/trunk/src/story_entities/world.cc
r4518 r4555 1 1 2 2 3 /* 3 /* 4 4 orxonox - the future of 3D-vertical-scrollers 5 5 … … 107 107 \param reference to the world 108 108 109 if the worldinterface is not initilizes, there wont be any 109 if the worldinterface is not initilizes, there wont be any 110 110 useable interface 111 111 */ … … 139 139 this->constuctorInit("", -1); 140 140 this->path = NULL; 141 141 142 142 this->loadParams(root); 143 143 } 144 144 145 /** 145 /** 146 146 \brief create a new World 147 147 148 148 This creates a new empty world! 149 149 */ … … 165 165 } 166 166 167 /** 167 /** 168 168 \brief remove the World from memory 169 169 170 170 delete everything explicitly, that isn't contained in the parenting tree! 171 171 things contained in the tree are deleted automaticaly … … 197 197 198 198 /** 199 \brief initializes the world. 199 \brief initializes the world. 200 200 201 201 set all stuff here that is world generic and does not use to much memory 202 202 because the real init() function StoryEntity::init() will be called 203 shortly before start of the game. 203 shortly before start of the game. 204 204 since all worlds are initiated/referenced before they will be started. 205 205 NO LEVEL LOADING HERE - NEVER! … … 232 232 233 233 234 /* 234 /* 235 235 // identifier 236 236 string = grabParameter( root, "identifier"); … … 250 250 } 251 251 else setNextStoryID( id); 252 252 253 253 254 254 // path … … 295 295 this->localCamera = new Camera(); 296 296 this->localCamera->setName ("Camera"); 297 297 298 298 State::getInstance()->setCamera(this->localCamera, this->localCamera->getTarget()); 299 299 … … 306 306 */ 307 307 ErrorMessage World::load() 308 { 308 { 309 309 PRINTF(3)("> Loading world: '%s'\n", getPath()); 310 310 TiXmlElement* element; 311 311 GameLoader* loader = GameLoader::getInstance(); 312 312 313 313 if( getPath() == NULL) 314 314 { … … 317 317 return (ErrorMessage){213,"Path not specified","World::load()"}; 318 318 } 319 319 320 320 TiXmlDocument* XMLDoc = new TiXmlDocument( path); 321 321 // load the campaign document 322 if( !XMLDoc->LoadFile()) 322 if( !XMLDoc->LoadFile()) 323 323 { 324 324 // report an error … … 327 327 return (ErrorMessage){213,"XML File parsing error","World::load()"}; 328 328 } 329 329 330 330 // check basic validity 331 331 TiXmlElement* root = XMLDoc->RootElement(); 332 332 assert( root != NULL); 333 333 334 334 if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile")) 335 335 { … … 339 339 return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"}; 340 340 } 341 341 342 342 // load the parameters 343 343 // name … … 378 378 // find WorldEntities 379 379 element = root->FirstChildElement("WorldEntities"); 380 380 381 381 if( element == NULL) 382 382 { … … 389 389 PRINTF(4)("Loading WorldEntities\n"); 390 390 while( element != NULL) 391 392 393 394 395 //todo do this more elegant 396 397 398 399 400 391 { 392 WorldEntity* created = dynamic_cast<WorldEntity*>( loader->fabricate( element)); 393 if( created != NULL) this->spawn( created); 394 // if we load a 'Player' we use it as localPlayer 395 //todo do this more elegant 396 if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created; 397 if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created; 398 element = element->NextSiblingElement(); 399 glmis->step(); //! \todo temporary 400 } 401 401 PRINTF(4)("Done loading WorldEntities\n"); 402 402 } 403 403 404 404 // find Track 405 405 element = root->FirstChildElement( "Track"); … … 409 409 } 410 410 else 411 { 411 { 412 412 //load track 413 413 PRINTF(4)("Loading Track\n"); … … 416 416 trackManager->finalize(); 417 417 } 418 418 419 419 // free the XML data 420 420 421 421 delete XMLDoc; 422 422 /* GENERIC LOADING PROCESS FINISHED */ 423 423 424 424 // bind input 425 425 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP); … … 430 430 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON); 431 431 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON); 432 432 433 433 // bind camera 434 434 //this->localCamera->bind (localPlayer); 435 435 this->localPlayer->addChild (this->localCamera); 436 436 437 437 438 438 lightMan->setAmbientColor(.1,.1,.1); … … 445 445 //lightMan->debug(); 446 446 lightMan->setPosition(-5.0, 10.0, -40.0); 447 448 // 447 448 // trackManager->setBindSlave(env); 449 449 PNode* tn = trackManager->getTrackNode(); 450 450 tn->addChild(this->localPlayer); 451 451 452 452 //localCamera->setParent(TrackNode::getInstance()); 453 453 tn->addChild(this->localCamera); … … 463 463 objectList = glGenLists(1); 464 464 glNewList (objectList, GL_COMPILE); 465 465 466 466 //trackManager->drawGraph(.01); 467 467 //trackManager->debug(2); … … 488 488 system->setColor(1.0, 0,0,0,0); 489 489 490 490 491 // Creating a Test Particle Emitter 491 492 ParticleEmitter* emitter = new ParticleEmitter(Vector(-1, 0, 0), M_PI_4, 400, .5); … … 498 499 gravity->setMagnitude(10.0); 499 500 // gravity->setParent(this->localCamera->getTarget()); 500 501 501 502 // Add the Flow from the Emitter into the System 502 503 particleEngine->addConnection(emitter, system); … … 504 505 new PhysicsConnection(system, gravity); 505 506 // new PhysicsConnection(this->localPlayer, gravity); 506 507 507 508 508 509 TestEntity* testEntity = new TestEntity(); … … 547 548 trackManager->addPointV(Vector(570, 20, -10)); 548 549 trackManager->setDuration(2); 549 550 550 551 trackManager->forkS("testFork1,testFork2"); 551 552 trackManager->workOnS("testFork1"); … … 572 573 573 574 trackManager->setDuration(4); 574 575 575 576 576 577 trackManager->joinS("testFork1,testFork2"); 577 578 578 579 trackManager->addPointV(Vector(1200, 60, -50)); 579 580 trackManager->addPointV(Vector(1300, 50, -50)); … … 586 587 trackManager->addPointV(Vector(1800, 100, -40)); 587 588 trackManager->setDuration(10); 588 589 589 590 trackManager->finalize(); 590 591 591 592 592 593 // LIGHT initialisation … … 598 599 { 599 600 /* 600 this loads the hard-coded debug world. this only for simplicity and will be 601 602 603 601 this loads the hard-coded debug world. this only for simplicity and will be 602 removed by a reald world-loader, which interprets a world-file. 603 if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and 604 make whatever you want... 604 605 */ 605 606 case DEBUG_WORLD_0: 606 607 { 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 //orx->getLocalInput()->bind (this->pilotNode); 667 668 669 670 671 672 673 674 675 676 677 678 608 lightMan->setPosition(-5.0, 10.0, -40.0); 609 610 611 this->localPlayer = new Player (); 612 this->localPlayer->setName ("player"); 613 this->spawn (this->localPlayer); 614 this->localPlayer->setRelCoor(Vector(5,0,0)); 615 /*monitor progress*/ 616 this->glmis->step(); 617 618 619 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1); 620 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON); 621 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON); 622 623 /* 624 Field* testField = new Gravity(); 625 testField->setMagnitude(10); 626 new PhysicsConnection(this->localPlayer, testField); 627 */ 628 629 // bind camera 630 this->localCamera = new Camera(); 631 this->localCamera->setName ("camera"); 632 /*monitor progress*/ 633 this->glmis->step(); 634 635 636 // Create SkySphere 637 this->sky = new Skysphere("pictures/sky-replace.jpg"); 638 this->sky->setName("SkySphere"); 639 this->spawn(this->sky); 640 this->localCamera->addChild(this->sky); 641 this->sky->setParentMode(PNODE_MOVEMENT); 642 /*monitor progress*/ 643 this->glmis->step(); 644 645 646 terrain = new Terrain("worlds/newGround.obj"); 647 terrain->setRelCoor(Vector(0,-10,0)); 648 this->spawn(terrain); 649 /*monitor progress*/ 650 this->glmis->step(); 651 652 this->pilotNode = new PilotNode(); 653 this->spawn(this->pilotNode); 654 this->pilotNode->setAbsCoor(Vector(150, -35, 5)); 655 this->pilotNode->addChild(this->localPlayer); 656 this->pilotNode->addChild(this->localCamera); 657 this->localCamera->lookAt(this->localPlayer); 658 659 this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_UP); 660 this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_DOWN); 661 this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_LEFT); 662 this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_RIGHT); 663 this->eventHandler->subscribe(this->pilotNode, ES_GAME, EV_MOUSE_MOTION); 664 665 // bind input 666 Orxonox *orx = Orxonox::getInstance (); 667 //orx->getLocalInput()->bind (this->pilotNode); 668 669 /* 670 PNode* tn = trackManager->getTrackNode(); 671 tn->addChild(this->localPlayer); 672 this->localCamera->lookAt(tn); 673 674 tn->addChild(this->localCamera); 675 this->localPlayer->setParentMode(PNODE_ALL); 676 trackManager->condition(2, LEFTRIGHT, this->localPlayer); 677 */ 678 this->glmis->step(); 679 break; 679 680 } 680 681 case DEBUG_WORLD_1: 681 682 { 682 683 683 684 break; 684 685 } 685 686 case DEBUG_WORLD_2: 686 687 { 687 688 688 689 break; 689 690 } 690 691 default: … … 698 699 \brief initializes a new World shortly before start 699 700 700 this is the function, that will be loaded shortly before the world is 701 this is the function, that will be loaded shortly before the world is 701 702 started 702 703 */ … … 759 760 void World::displayLoadScreen () 760 761 { 761 PRINTF(3)("World::displayLoadScreen - start\n"); 762 763 //GLMenuImageScreen* 762 PRINTF(3)("World::displayLoadScreen - start\n"); 763 764 //GLMenuImageScreen* 764 765 this->glmis = new GLMenuImageScreen(); 765 766 this->glmis->init(); 766 767 this->glmis->setMaximum(8); 767 768 // this->glmis->draw(); 768 769 PRINTF(3)("World::displayLoadScreen - end\n"); 769 770 PRINTF(3)("World::displayLoadScreen - end\n"); 770 771 } 771 772 … … 777 778 void World::releaseLoadScreen () 778 779 { 779 PRINTF(3)("World::releaseLoadScreen - start\n"); 780 PRINTF(3)("World::releaseLoadScreen - start\n"); 780 781 this->glmis->setValue(this->glmis->getMaximum()); 781 PRINTF(3)("World::releaseLoadScreen - end\n"); 782 PRINTF(3)("World::releaseLoadScreen - end\n"); 782 783 delete this->glmis; 783 784 } … … 804 805 805 806 806 /** 807 /** 807 808 \brief checks for collisions 808 809 This method runs through all WorldEntities known to the world and checks for collisions 810 between them. In case of collisions the collide() method of the corresponding entities 809 810 This method runs through all WorldEntities known to the world and checks for collisions 811 between them. In case of collisions the collide() method of the corresponding entities 811 812 is called. 812 813 */ … … 816 817 List *a, *b; 817 818 WorldEntity *aobj, *bobj; 818 819 819 820 a = entities; 820 821 821 822 while( a != NULL) 822 823 { 823 824 aobj = a->nextElement(); 824 825 if( aobj->bCollide && aobj->collisioncluster != NULL) 825 826 827 828 829 830 831 832 833 if( check_collision ( &aobj->place, aobj->collisioncluster, 834 &ahitflg, &bobj->place, bobj->collisioncluster, 835 836 837 838 839 840 841 842 843 826 { 827 b = a->nextElement(); 828 while( b != NULL ) 829 { 830 bobj = b->nextElement(); 831 if( bobj->bCollide && bobj->collisioncluster != NULL ) 832 { 833 unsigned long ahitflg, bhitflg; 834 if( check_collision ( &aobj->place, aobj->collisioncluster, 835 &ahitflg, &bobj->place, bobj->collisioncluster, 836 &bhitflg) ); 837 { 838 aobj->collide (bobj, ahitflg, bhitflg); 839 bobj->collide (aobj, bhitflg, ahitflg); 840 } 841 } 842 b = b->nextElement(); 843 } 844 } 844 845 a = a->enumerate(); 845 846 } … … 847 848 } 848 849 849 /** 850 /** 850 851 \brief runs through all entities calling their draw() methods 851 852 */ … … 859 860 tIterator<WorldEntity>* iterator = this->entities->getIterator(); 860 861 entity = iterator->nextElement(); 861 while( entity != NULL ) 862 { 862 while( entity != NULL ) 863 { 863 864 if( entity->bDraw ) entity->draw(); 864 865 //entity = this->entities->nextElement(); … … 866 867 } 867 868 delete iterator; 868 869 869 870 glCallList (objectList); 870 871 … … 900 901 p3->debug (); 901 902 p4->debug (); 902 903 903 904 p1->update (0); 904 905 … … 928 929 929 930 delete p1; 930 931 931 932 932 933 /* 933 934 WorldEntity* entity; 934 935 printf("counting all entities\n"); 935 936 printf("World::debug() - enumerate()\n"); 936 entity = entities->enumerate(); 937 while( entity != NULL ) 938 { 937 entity = entities->enumerate(); 938 while( entity != NULL ) 939 { 939 940 if( entity->bDraw ) printf("got an entity\n"); 940 941 entity = entities->nextElement(); … … 963 964 this->handleInput (); 964 965 if( this->bQuitCurrentGame || this->bQuitOrxonox) 965 966 break; 966 967 // Process time 967 968 this->tick (); 968 969 // Update the state 969 this->update (); 970 this->update (); 970 971 // Process collision 971 972 this->collide (); … … 1021 1022 { 1022 1023 this->dt = currentFrame - this->lastFrame; 1023 1024 1024 1025 if( this->dt > 0) 1025 1026 1027 1028 1029 1030 1031 1026 { 1027 float fps = 1000/dt; 1028 1029 // temporary, only for showing how fast the text-engine is 1030 char tmpChar[20]; 1031 sprintf(tmpChar, "fps: %4.0f", fps); 1032 } 1032 1033 else 1033 1034 1035 1036 1037 1038 1039 1040 1034 { 1035 /* the frame-rate is limited to 100 frames per second, all other things are for 1036 nothing. 1037 */ 1038 PRINTF(2)("fps = 1000 - frame rate is adjusted\n"); 1039 SDL_Delay(10); 1040 this->dt = 10; 1041 } 1041 1042 //this->timeSlice (dt); 1042 1043 1043 1044 /* function to let all entities tick (iterate through list) */ 1044 this->dtS = (float)this->dt / 1000.0; 1045 this->dtS = (float)this->dt / 1000.0; 1045 1046 this->gameTime += this->dtS; 1046 //entity = entities->enumerate(); 1047 //entity = entities->enumerate(); 1047 1048 tIterator<WorldEntity>* iterator = this->entities->getIterator(); 1048 1049 WorldEntity* entity = iterator->nextElement(); 1049 while( entity != NULL) 1050 { 1051 1052 1053 1050 while( entity != NULL) 1051 { 1052 entity->tick (this->dtS); 1053 entity = iterator->nextElement(); 1054 } 1054 1055 delete iterator; 1055 1056 … … 1063 1064 particleEngine->tick(this->dtS); 1064 1065 this->garbageCollector->tick(this->dtS); 1065 1066 1066 1067 /* actualy the Graphics Engine should tick the world not the other way around... 1067 1068 1069 1068 but since we like the things not too complicated we got it this way around 1069 until there is need or time to do it the other way around. 1070 \todo: GraphicsEngine ticks world: separation of processes and data... 1070 1071 */ 1071 1072 GraphicsEngine::getInstance()->tick(this->dtS); … … 1092 1093 /** 1093 1094 \brief render the current frame 1094 1095 1095 1096 clear all buffers and draw the world 1096 1097 */ … … 1147 1148 \param In which relative direction should it look. 1148 1149 */ 1149 void World::spawn(WorldEntity* entity, PNode* parentNode, 1150 Vector* relCoor, Quaternion* relDir, 1151 1150 void World::spawn(WorldEntity* entity, PNode* parentNode, 1151 Vector* relCoor, Quaternion* relDir, 1152 int parentingMode) 1152 1153 { 1153 1154 this->nullParent = NullParent::getInstance(); … … 1155 1156 { 1156 1157 parentNode->addChild (entity); 1157 1158 1158 1159 entity->setRelCoor (*relCoor); 1159 1160 entity->setRelDir (*relDir); 1160 1161 entity->setParentMode(parentingMode); 1161 1162 1162 1163 this->entities->add (entity); 1163 1164 1164 1165 entity->postSpawn (); 1165 1166 } -
orxonox/trunk/src/subprojects/particles/particle_fun.cc
r4554 r4555 52 52 system->setRadius(PINIT_START_RADIUS, PINIT_END_RADIUS ,0 ,0); 53 53 system->setLifeSpan(PINIT_LIFESPAN); 54 54 55 system->setConserve(PINIT_CONSERVE_FACTOR); 56 system->setMass(5,3,6); 55 57 56 58 // Creating a Test Particle Emitter
Note: See TracChangeset
for help on using the changeset viewer.