Changeset 4822 in orxonox.OLD for orxonox/trunk/src/story_entities
- Timestamp:
- Jul 8, 2005, 11:19:49 AM (19 years ago)
- Location:
- orxonox/trunk/src/story_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r4820 r4822 183 183 ParticleEngine::getInstance()->debug(); 184 184 185 this->eventHandler->unsubscribe(this->localPlayer);185 EventHandler::getInstance()->unsubscribe(this->localPlayer); 186 186 187 187 delete WorldInterface::getInstance(); … … 189 189 delete this->entities; 190 190 delete LightManager::getInstance(); 191 delete this->trackManager; 192 delete this->particleEngine; 191 delete TrackManager::getInstance(); 192 delete ParticleEngine::getInstance(); 193 193 194 TextEngine::getInstance()->flush(); 194 195 SoundEngine::getInstance()->flushAllBuffers(); … … 292 293 WorldInterface* wi = WorldInterface::getInstance(); 293 294 wi->init(this); 294 this->garbageCollector = GarbageCollector::getInstance(); 295 296 this->eventHandler = EventHandler::getInstance(); 297 298 this->particleEngine = ParticleEngine::getInstance(); 299 this->trackManager = TrackManager::getInstance(); 295 300 296 LightManager::getInstance(); 301 297 this->nullParent = NullParent::getInstance (); … … 439 435 PRINTF(4)("Loading Track\n"); 440 436 441 trackManager->loadParams( element);442 trackManager->finalize();437 TrackManager::getInstance()->loadParams( element); 438 TrackManager::getInstance()->finalize(); 443 439 } 444 440 … … 449 445 450 446 // bind input 451 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP);452 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_DOWN);453 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_LEFT);454 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_RIGHT);455 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);456 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);457 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);447 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP); 448 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_DOWN); 449 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_LEFT); 450 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_RIGHT); 451 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1); 452 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON); 453 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON); 458 454 459 455 // bind camera … … 474 470 // lightMan->setPosition(100, 80, 60); 475 471 476 // trackManager->setBindSlave(env);477 PNode* tn = trackManager->getTrackNode();472 // TrackManager::getInstance()->setBindSlave(env); 473 PNode* tn = TrackManager::getInstance()->getTrackNode(); 478 474 tn->addChild(this->localPlayer); 479 475 … … 485 481 this->localPlayer->setParentMode(PNODE_ALL); 486 482 Vector* cameraOffset = new Vector (0, 5, -10); 487 trackManager->condition(1, LEFTRIGHT, this->localPlayer);483 TrackManager::getInstance()->condition(1, LEFTRIGHT, this->localPlayer); 488 484 489 485 this->sky->setParent(this->localCamera); … … 493 489 glNewList (objectList, GL_COMPILE); 494 490 495 // trackManager->drawGraph(.01);496 // trackManager->debug(2);491 //TrackManager::getInstance()->drawGraph(.01); 492 //TrackManager::getInstance()->debug(2); 497 493 glEndList(); 498 494 … … 556 552 557 553 // initializing the TrackManager 558 this->trackManager = TrackManager::getInstance(); 559 //trackManager->addPointV(Vector(0,0,0)); 560 trackManager->addPointV(Vector(150, -35, 5)); 561 trackManager->addPointV(Vector(200,-35, 5)); 562 trackManager->addPointV(Vector(250, -35, 5)); 563 trackManager->addPointV(Vector(320,-33,-.55)); 564 trackManager->setDuration(1); 565 trackManager->setSavePoint(); 566 567 trackManager->addPointV(Vector(410, 0, 0)); 568 trackManager->addPointV(Vector(510, 20, -10)); 569 trackManager->addPointV(Vector(550, 20, -10)); 570 trackManager->addPointV(Vector(570, 20, -10)); 571 trackManager->setDuration(2); 572 573 trackManager->forkS("testFork1,testFork2"); 574 trackManager->workOnS("testFork1"); 575 trackManager->addPointV(Vector(640, 25, -30)); 576 trackManager->addPointV(Vector(700, 40, -120)); 577 trackManager->addPointV(Vector(800, 50, -150)); 578 trackManager->addPointV(Vector(900, 60, -100)); 579 trackManager->addPointV(Vector(900, 60, -70)); 580 trackManager->addPointV(Vector(990, 65, -15)); 581 trackManager->addPointV(Vector(1050, 65, -10)); 582 trackManager->addPointV(Vector(1100, 65, -20)); 583 trackManager->setDuration(4); 584 585 trackManager->workOnS("testFork2"); 586 trackManager->addPointV(Vector(640, 25, 20)); 587 trackManager->addPointV(Vector(670, 50, 120)); 588 trackManager->addPointV(Vector(700, 70, 80)); 589 trackManager->addPointV(Vector(800, 70, 65)); 590 trackManager->addPointV(Vector(850, 65, 65)); 591 trackManager->addPointV(Vector(920, 35, 40)); 592 trackManager->addPointV(Vector(945, 40, 40)); 593 trackManager->addPointV(Vector(970, 24, 40)); 594 trackManager->addPointV(Vector(1000, 40, -7)); 595 596 trackManager->setDuration(4); 597 598 599 trackManager->joinS("testFork1,testFork2"); 600 601 trackManager->addPointV(Vector(1200, 60, -50)); 602 trackManager->addPointV(Vector(1300, 50, -50)); 603 trackManager->addPointV(Vector(1400, 40, -50)); 604 trackManager->addPointV(Vector(1500, 40, -60)); 605 trackManager->addPointV(Vector(1600, 35, -55)); 606 trackManager->addPointV(Vector(1700, 45, -40)); 607 trackManager->addPointV(Vector(1750, 60, -40)); 608 trackManager->addPointV(Vector(1770, 80, -40)); 609 trackManager->addPointV(Vector(1800, 100, -40)); 610 trackManager->setDuration(10); 611 612 trackManager->finalize(); 554 TrackManager::getInstance()->addPointV(Vector(150, -35, 5)); 555 TrackManager::getInstance()->addPointV(Vector(200,-35, 5)); 556 TrackManager::getInstance()->addPointV(Vector(250, -35, 5)); 557 TrackManager::getInstance()->addPointV(Vector(320,-33,-.55)); 558 TrackManager::getInstance()->setDuration(1); 559 TrackManager::getInstance()->setSavePoint(); 560 561 TrackManager::getInstance()->addPointV(Vector(410, 0, 0)); 562 TrackManager::getInstance()->addPointV(Vector(510, 20, -10)); 563 TrackManager::getInstance()->addPointV(Vector(550, 20, -10)); 564 TrackManager::getInstance()->addPointV(Vector(570, 20, -10)); 565 TrackManager::getInstance()->setDuration(2); 566 567 TrackManager::getInstance()->forkS("testFork1,testFork2"); 568 TrackManager::getInstance()->workOnS("testFork1"); 569 TrackManager::getInstance()->addPointV(Vector(640, 25, -30)); 570 TrackManager::getInstance()->addPointV(Vector(700, 40, -120)); 571 TrackManager::getInstance()->addPointV(Vector(800, 50, -150)); 572 TrackManager::getInstance()->addPointV(Vector(900, 60, -100)); 573 TrackManager::getInstance()->addPointV(Vector(900, 60, -70)); 574 TrackManager::getInstance()->addPointV(Vector(990, 65, -15)); 575 TrackManager::getInstance()->addPointV(Vector(1050, 65, -10)); 576 TrackManager::getInstance()->addPointV(Vector(1100, 65, -20)); 577 TrackManager::getInstance()->setDuration(4); 578 579 TrackManager::getInstance()->workOnS("testFork2"); 580 TrackManager::getInstance()->addPointV(Vector(640, 25, 20)); 581 TrackManager::getInstance()->addPointV(Vector(670, 50, 120)); 582 TrackManager::getInstance()->addPointV(Vector(700, 70, 80)); 583 TrackManager::getInstance()->addPointV(Vector(800, 70, 65)); 584 TrackManager::getInstance()->addPointV(Vector(850, 65, 65)); 585 TrackManager::getInstance()->addPointV(Vector(920, 35, 40)); 586 TrackManager::getInstance()->addPointV(Vector(945, 40, 40)); 587 TrackManager::getInstance()->addPointV(Vector(970, 24, 40)); 588 TrackManager::getInstance()->addPointV(Vector(1000, 40, -7)); 589 590 TrackManager::getInstance()->setDuration(4); 591 592 593 TrackManager::getInstance()->joinS("testFork1,testFork2"); 594 595 TrackManager::getInstance()->addPointV(Vector(1200, 60, -50)); 596 TrackManager::getInstance()->addPointV(Vector(1300, 50, -50)); 597 TrackManager::getInstance()->addPointV(Vector(1400, 40, -50)); 598 TrackManager::getInstance()->addPointV(Vector(1500, 40, -60)); 599 TrackManager::getInstance()->addPointV(Vector(1600, 35, -55)); 600 TrackManager::getInstance()->addPointV(Vector(1700, 45, -40)); 601 TrackManager::getInstance()->addPointV(Vector(1750, 60, -40)); 602 TrackManager::getInstance()->addPointV(Vector(1770, 80, -40)); 603 TrackManager::getInstance()->addPointV(Vector(1800, 100, -40)); 604 TrackManager::getInstance()->setDuration(10); 605 606 TrackManager::getInstance()->finalize(); 613 607 614 608 … … 639 633 640 634 641 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);642 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);643 this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);635 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1); 636 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON); 637 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON); 644 638 645 639 /* … … 679 673 this->localCamera->lookAt(this->localPlayer); 680 674 681 this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_UP);682 this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_DOWN);683 this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_LEFT);684 this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_RIGHT);685 this->eventHandler->subscribe(this->pilotNode, ES_GAME, EV_MOUSE_MOTION);675 EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_UP); 676 EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_DOWN); 677 EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_LEFT); 678 EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_RIGHT); 679 EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, EV_MOUSE_MOTION); 686 680 687 681 // bind input … … 690 684 691 685 /* 692 PNode* tn = trackManager->getTrackNode();686 PNode* tn = TrackManager::getInstance()->getTrackNode(); 693 687 tn->addChild(this->localPlayer); 694 688 this->localCamera->lookAt(tn); … … 696 690 tn->addChild(this->localCamera); 697 691 this->localPlayer->setParentMode(PNODE_ALL); 698 trackManager->condition(2, LEFTRIGHT, this->localPlayer);692 TrackManager::getInstance()->condition(2, LEFTRIGHT, this->localPlayer); 699 693 */ 700 694 this->glmis->step(); … … 889 883 glCallList (objectList); 890 884 891 particleEngine->draw(); //!< \todo should be dts like in the Trunk;885 ParticleEngine::getInstance()->draw(); //!< \todo should be dts like in the Trunk; 892 886 893 887 crosshair->draw(); … … 1075 1069 1076 1070 /* update tick the rest */ 1077 this->trackManager->tick(this->dt);1071 TrackManager::getInstance()->tick(this->dt); 1078 1072 this->localCamera->tick(this->dt); 1079 1073 // tick the engines … … 1107 1101 void World::update() 1108 1102 { 1109 this->garbageCollector->update();1103 GarbageCollector::getInstance()->update(); 1110 1104 this->nullParent->update (this->dtS); 1111 1105 -
orxonox/trunk/src/story_entities/world.h
r4765 r4822 14 14 class World; 15 15 class WorldEntity; 16 class TrackManager;17 16 class Camera; 18 17 class Player; 19 18 class PNode; 20 19 class GLMenuImageScreen; 21 class LightManager;22 class ParticleEngine;23 20 class Terrain; 24 21 class GarbageCollector; … … 26 23 class TiXmlElement; 27 24 class PilotNode; 28 class EventHandler;29 25 30 26 //! The game world Interface … … 102 98 Uint32 lastFrame; //!< last time of frame 103 99 Uint32 cycle; //!< The cycle we are in (starts with 0 and rises with every frame) 104 Uint32 dt; //!< time needed to calculate this frame 100 Uint32 dt; //!< time needed to calculate this frame (in milliSeconds) 105 101 float dtS; //!< The time needed for caluculations in seconds 106 102 double gameTime; //!< this is where the game time is saved … … 115 111 char* path; //!< The file from which this world is loaded 116 112 113 114 // IMPORTANT WORLD-ENTITIES 117 115 PNode* nullParent; //!< The zero-point, that everything has as its parent. 118 TrackManager* trackManager; //!< The reference of the TrackManager that handles the course through the Level.119 ParticleEngine* particleEngine; //!< The ParticleEngine of the World.120 116 Camera* localCamera; //!< The current Camera 121 117 WorldEntity* sky; //!< The Environmental Heaven of orxonox \todo insert this to environment insted 122 LightManager* lightMan; //!< The Lights of the Level123 118 Terrain* terrain; //!< The Terrain of the World. 124 119 … … 127 122 Player* localPlayer; //!< The Player, you fly through the level. 128 123 PilotNode* pilotNode; //!< THe pilot node to fly with the mouse 129 130 GarbageCollector* garbageCollector; //!< reference to the garbage collector131 EventHandler* eventHandler;132 124 133 125 /* function for main-loop */
Note: See TracChangeset
for help on using the changeset viewer.