Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4822 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jul 8, 2005, 11:19:49 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Singleton-Classes are now refered to as such in World and Orxonox

Location:
orxonox/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/ChangeLog

    r4811 r4822  
    112005-07-01      Benjamin Grauer <bensch@orxonox.ethz.ch>
    22        Implemented ClassList.h:
    3         an interface to BaseObject saving all instances in Lists.
    4         It also enables loadability-identifiers.
    5         To decide is, if this approach is fast enough.
     3        an interface to BaseObject saving all instances in Lists.
     4        It also enables loadability-identifiers.
     5        To decide is, if this approach is fast enough.
    66
    772005-06-20      Patrick Boenzli <patrick@orxonox.ethz.ch>
    88        Implemented an OBB collision detection system, injected into the
    9         WorldEntity framework. Object - Object Collision Detection works
    10         fine. Still work on the Object - Ground CD.
     9        WorldEntity framework. Object - Object Collision Detection works
     10        fine. Still work on the Object - Ground CD.
    1111
    12122005-06-10      Benjamin Grauer <bensch@orxonox.ethz.ch>
  • orxonox/trunk/src/lib/graphics/importer/model.cc

    r4806 r4822  
    902902      else if( tmpFace->vertexCount > 4)
    903903      {
    904         PRINTF(0)("NASTY NASTY: More than 4 vertices for a face, there will be errors in the triangles information!\n");
     904        PRINTF(1)("NASTY NASTY: More than 4 vertices for a face, there will be errors in the triangles information!\n");
    905905      //exit(0);
    906906      }
  • orxonox/trunk/src/orxonox.cc

    r4817 r4822  
    6767  this->setName("orxonox-main");
    6868
    69   this->resourceManager = NULL;
    70   this->objectManager = NULL;
    71   this->eventHandler = NULL;
    7269  this->iniParser = NULL;
    7370
     
    186183  PRINT(3)("> Initializing input\n");
    187184
    188   this->eventHandler = EventHandler::getInstance();
    189   this->eventHandler->init();
     185  EventHandler::getInstance()->init();
    190186
    191187  return 0;
     
    213209
    214210  PRINT(3)("initializing ResourceManager\n");
    215   resourceManager = ResourceManager::getInstance();
    216211
    217212  // create parser
     
    231226    {
    232227          //  printf("Not yet implemented\n");
    233       if (!resourceManager->setDataDir(valuebuf))
     228      if (!ResourceManager::getInstance()->setDataDir(valuebuf))
    234229      {
    235230        PRINTF(1)("Data Could not be located\n");
     
    242237  }
    243238
    244   if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
     239  if (!ResourceManager::getInstance()->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
    245240  {
    246241    PRINTF(1)("The DataDirectory %s could not be verified\n" \
    247242              "  Please Change in File %s Section %s Entry %s to a suitable value\n",
    248               resourceManager->getDataDir(),
     243              ResourceManager::getInstance()->getDataDir(),
    249244              DEFAULT_CONFIG_FILE,
    250245              CONFIG_SECTION_DATA,
     
    253248  }
    254249   //! \todo this is a hack and should be loadable
    255   resourceManager->addImageDir(ResourceManager::getInstance()->getFullName("maps/"));
    256   resourceManager->debug();
     250  ResourceManager::getInstance()->addImageDir(ResourceManager::getInstance()->getFullName("maps/"));
     251  ResourceManager::getInstance()->debug();
    257252
    258253  PRINT(3)("initializing TextEngine\n");
     
    260255
    261256  PRINT(3)("initializing ObjectManager\n");
    262   this->objectManager = ObjectManager::getInstance();
    263 
     257  ObjectManager::getInstance();
    264258  CDEngine::getInstance();
    265259
  • orxonox/trunk/src/orxonox.h

    r4817 r4822  
    1111class WorldEntity;
    1212class GameLoader;
    13 class ResourceManager;
    14 class ObjectManager;
    15 class EventHandler;
    1613class Event;
    1714class IniParser;
     
    5249  char              configFileName[256];     //!< Filename of the configuration-file.
    5350  GameLoader*       gameLoader;              //!< The gameLoader
    54   ResourceManager*  resourceManager;         //!< The ResourceManager
    55   ObjectManager*    objectManager;           //!< the object manager of the game
    56   EventHandler*     eventHandler;            //!< the eventhandler of orxonox is created here
    5751
    5852  unsigned int      argc;                    //!< Count of Arguments of orxonox
  • orxonox/trunk/src/story_entities/world.cc

    r4820 r4822  
    183183  ParticleEngine::getInstance()->debug();
    184184
    185   this->eventHandler->unsubscribe(this->localPlayer);
     185  EventHandler::getInstance()->unsubscribe(this->localPlayer);
    186186
    187187  delete WorldInterface::getInstance();
     
    189189  delete this->entities;
    190190  delete LightManager::getInstance();
    191   delete this->trackManager;
    192   delete this->particleEngine;
     191  delete TrackManager::getInstance();
     192  delete ParticleEngine::getInstance();
     193
    193194  TextEngine::getInstance()->flush();
    194195  SoundEngine::getInstance()->flushAllBuffers();
     
    292293  WorldInterface* wi = WorldInterface::getInstance();
    293294  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
    300296  LightManager::getInstance();
    301297  this->nullParent = NullParent::getInstance ();
     
    439435      PRINTF(4)("Loading Track\n");
    440436
    441       trackManager->loadParams( element);
    442       trackManager->finalize();
     437      TrackManager::getInstance()->loadParams( element);
     438      TrackManager::getInstance()->finalize();
    443439    }
    444440
     
    449445
    450446  // 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);
    458454
    459455  // bind camera
     
    474470//   lightMan->setPosition(100, 80, 60);
    475471
    476   //        trackManager->setBindSlave(env);
    477   PNode* tn = trackManager->getTrackNode();
     472  //        TrackManager::getInstance()->setBindSlave(env);
     473  PNode* tn = TrackManager::getInstance()->getTrackNode();
    478474  tn->addChild(this->localPlayer);
    479475
     
    485481  this->localPlayer->setParentMode(PNODE_ALL);
    486482  Vector* cameraOffset = new Vector (0, 5, -10);
    487   trackManager->condition(1, LEFTRIGHT, this->localPlayer);
     483  TrackManager::getInstance()->condition(1, LEFTRIGHT, this->localPlayer);
    488484
    489485  this->sky->setParent(this->localCamera);
     
    493489  glNewList (objectList, GL_COMPILE);
    494490
    495   //trackManager->drawGraph(.01);
    496   //trackManager->debug(2);
     491  //TrackManager::getInstance()->drawGraph(.01);
     492  //TrackManager::getInstance()->debug(2);
    497493  glEndList();
    498494
     
    556552
    557553  // 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();
    613607
    614608
     
    639633
    640634
    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);
    644638
    645639        /*
     
    679673        this->localCamera->lookAt(this->localPlayer);
    680674
    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);
    686680
    687681        // bind input
     
    690684
    691685        /*
    692         PNode* tn = trackManager->getTrackNode();
     686        PNode* tn = TrackManager::getInstance()->getTrackNode();
    693687        tn->addChild(this->localPlayer);
    694688        this->localCamera->lookAt(tn);
     
    696690        tn->addChild(this->localCamera);
    697691        this->localPlayer->setParentMode(PNODE_ALL);
    698         trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     692        TrackManager::getInstance()->condition(2, LEFTRIGHT, this->localPlayer);
    699693        */
    700694        this->glmis->step();
     
    889883  glCallList (objectList);
    890884
    891   particleEngine->draw(); //!< \todo should be dts like in the Trunk;
     885  ParticleEngine::getInstance()->draw(); //!< \todo should be dts like in the Trunk;
    892886
    893887  crosshair->draw();
     
    10751069
    10761070      /* update tick the rest */
    1077       this->trackManager->tick(this->dt);
     1071      TrackManager::getInstance()->tick(this->dt);
    10781072      this->localCamera->tick(this->dt);
    10791073      // tick the engines
     
    11071101void World::update()
    11081102{
    1109   this->garbageCollector->update();
     1103  GarbageCollector::getInstance()->update();
    11101104  this->nullParent->update (this->dtS);
    11111105
  • orxonox/trunk/src/story_entities/world.h

    r4765 r4822  
    1414class World;
    1515class WorldEntity;
    16 class TrackManager;
    1716class Camera;
    1817class Player;
    1918class PNode;
    2019class GLMenuImageScreen;
    21 class LightManager;
    22 class ParticleEngine;
    2320class Terrain;
    2421class GarbageCollector;
     
    2623class TiXmlElement;
    2724class PilotNode;
    28 class EventHandler;
    2925
    3026//! The game world Interface
     
    10298  Uint32 lastFrame;                   //!< last time of frame
    10399  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)
    105101  float dtS;                          //!< The time needed for caluculations in seconds
    106102  double gameTime;                    //!< this is where the game time is saved
     
    115111  char* path;                         //!< The file from which this world is loaded
    116112
     113
     114  // IMPORTANT WORLD-ENTITIES
    117115  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.
    120116  Camera* localCamera;                //!< The current Camera
    121117  WorldEntity* sky;                   //!< The Environmental Heaven of orxonox \todo insert this to environment insted
    122   LightManager* lightMan;             //!< The Lights of the Level
    123118  Terrain* terrain;                   //!< The Terrain of the World.
    124119
     
    127122  Player* localPlayer;                //!< The Player, you fly through the level.
    128123  PilotNode* pilotNode;               //!< THe pilot node to fly with the mouse
    129 
    130   GarbageCollector* garbageCollector; //!< reference to the garbage  collector
    131   EventHandler* eventHandler;
    132124
    133125  /* function for main-loop */
  • orxonox/trunk/src/world_entities/player.cc

    r4818 r4822  
    215215
    216216  this->weaponMan->draw();
    217 
    218217}
    219218
Note: See TracChangeset for help on using the changeset viewer.