Index: /orxonox/trunk/ChangeLog
===================================================================
--- /orxonox/trunk/ChangeLog	(revision 4821)
+++ /orxonox/trunk/ChangeLog	(revision 4822)
@@ -1,12 +1,12 @@
 2005-07-01      Benjamin Grauer <bensch@orxonox.ethz.ch>
         Implemented ClassList.h:
-	an interface to BaseObject saving all instances in Lists.
-	It also enables loadability-identifiers.
-	To decide is, if this approach is fast enough.
+        an interface to BaseObject saving all instances in Lists.
+        It also enables loadability-identifiers.
+        To decide is, if this approach is fast enough.
 
 2005-06-20      Patrick Boenzli <patrick@orxonox.ethz.ch>
         Implemented an OBB collision detection system, injected into the
-	WorldEntity framework. Object - Object Collision Detection works 
-	fine. Still work on the Object - Ground CD.
+        WorldEntity framework. Object - Object Collision Detection works
+        fine. Still work on the Object - Ground CD.
 
 2005-06-10      Benjamin Grauer <bensch@orxonox.ethz.ch>
Index: /orxonox/trunk/src/lib/graphics/importer/model.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 4821)
+++ /orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 4822)
@@ -902,5 +902,5 @@
       else if( tmpFace->vertexCount > 4)
       {
-        PRINTF(0)("NASTY NASTY: More than 4 vertices for a face, there will be errors in the triangles information!\n");
+        PRINTF(1)("NASTY NASTY: More than 4 vertices for a face, there will be errors in the triangles information!\n");
       //exit(0);
       }
Index: /orxonox/trunk/src/orxonox.cc
===================================================================
--- /orxonox/trunk/src/orxonox.cc	(revision 4821)
+++ /orxonox/trunk/src/orxonox.cc	(revision 4822)
@@ -67,7 +67,4 @@
   this->setName("orxonox-main");
 
-  this->resourceManager = NULL;
-  this->objectManager = NULL;
-  this->eventHandler = NULL;
   this->iniParser = NULL;
 
@@ -186,6 +183,5 @@
   PRINT(3)("> Initializing input\n");
 
-  this->eventHandler = EventHandler::getInstance();
-  this->eventHandler->init();
+  EventHandler::getInstance()->init();
 
   return 0;
@@ -213,5 +209,4 @@
 
   PRINT(3)("initializing ResourceManager\n");
-  resourceManager = ResourceManager::getInstance();
 
   // create parser
@@ -231,5 +226,5 @@
     {
           //  printf("Not yet implemented\n");
-      if (!resourceManager->setDataDir(valuebuf))
+      if (!ResourceManager::getInstance()->setDataDir(valuebuf))
       {
         PRINTF(1)("Data Could not be located\n");
@@ -242,9 +237,9 @@
   }
 
-  if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
+  if (!ResourceManager::getInstance()->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
   {
     PRINTF(1)("The DataDirectory %s could not be verified\n" \
               "  Please Change in File %s Section %s Entry %s to a suitable value\n",
-              resourceManager->getDataDir(),
+              ResourceManager::getInstance()->getDataDir(),
               DEFAULT_CONFIG_FILE,
               CONFIG_SECTION_DATA,
@@ -253,6 +248,6 @@
   }
    //! \todo this is a hack and should be loadable
-  resourceManager->addImageDir(ResourceManager::getInstance()->getFullName("maps/"));
-  resourceManager->debug();
+  ResourceManager::getInstance()->addImageDir(ResourceManager::getInstance()->getFullName("maps/"));
+  ResourceManager::getInstance()->debug();
 
   PRINT(3)("initializing TextEngine\n");
@@ -260,6 +255,5 @@
 
   PRINT(3)("initializing ObjectManager\n");
-  this->objectManager = ObjectManager::getInstance();
-
+  ObjectManager::getInstance();
   CDEngine::getInstance();
 
Index: /orxonox/trunk/src/orxonox.h
===================================================================
--- /orxonox/trunk/src/orxonox.h	(revision 4821)
+++ /orxonox/trunk/src/orxonox.h	(revision 4822)
@@ -11,7 +11,4 @@
 class WorldEntity;
 class GameLoader;
-class ResourceManager;
-class ObjectManager;
-class EventHandler;
 class Event;
 class IniParser;
@@ -52,7 +49,4 @@
   char              configFileName[256];     //!< Filename of the configuration-file.
   GameLoader*       gameLoader;              //!< The gameLoader
-  ResourceManager*  resourceManager;         //!< The ResourceManager
-  ObjectManager*    objectManager;           //!< the object manager of the game
-  EventHandler*     eventHandler;            //!< the eventhandler of orxonox is created here
 
   unsigned int      argc;                    //!< Count of Arguments of orxonox
Index: /orxonox/trunk/src/story_entities/world.cc
===================================================================
--- /orxonox/trunk/src/story_entities/world.cc	(revision 4821)
+++ /orxonox/trunk/src/story_entities/world.cc	(revision 4822)
@@ -183,5 +183,5 @@
   ParticleEngine::getInstance()->debug();
 
-  this->eventHandler->unsubscribe(this->localPlayer);
+  EventHandler::getInstance()->unsubscribe(this->localPlayer);
 
   delete WorldInterface::getInstance();
@@ -189,6 +189,7 @@
   delete this->entities;
   delete LightManager::getInstance();
-  delete this->trackManager;
-  delete this->particleEngine;
+  delete TrackManager::getInstance();
+  delete ParticleEngine::getInstance();
+
   TextEngine::getInstance()->flush();
   SoundEngine::getInstance()->flushAllBuffers();
@@ -292,10 +293,5 @@
   WorldInterface* wi = WorldInterface::getInstance();
   wi->init(this);
-  this->garbageCollector = GarbageCollector::getInstance();
-
-  this->eventHandler = EventHandler::getInstance();
-
-  this->particleEngine = ParticleEngine::getInstance();
-  this->trackManager = TrackManager::getInstance();
+
   LightManager::getInstance();
   this->nullParent = NullParent::getInstance ();
@@ -439,6 +435,6 @@
       PRINTF(4)("Loading Track\n");
 
-      trackManager->loadParams( element);
-      trackManager->finalize();
+      TrackManager::getInstance()->loadParams( element);
+      TrackManager::getInstance()->finalize();
     }
 
@@ -449,11 +445,11 @@
 
   // bind input
-  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP);
-  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_DOWN);
-  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_LEFT);
-  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_RIGHT);
-  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
-  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
-  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
+  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP);
+  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_DOWN);
+  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_LEFT);
+  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_RIGHT);
+  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
+  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
+  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
 
   // bind camera
@@ -474,6 +470,6 @@
 //   lightMan->setPosition(100, 80, 60);
 
-  //        trackManager->setBindSlave(env);
-  PNode* tn = trackManager->getTrackNode();
+  //        TrackManager::getInstance()->setBindSlave(env);
+  PNode* tn = TrackManager::getInstance()->getTrackNode();
   tn->addChild(this->localPlayer);
 
@@ -485,5 +481,5 @@
   this->localPlayer->setParentMode(PNODE_ALL);
   Vector* cameraOffset = new Vector (0, 5, -10);
-  trackManager->condition(1, LEFTRIGHT, this->localPlayer);
+  TrackManager::getInstance()->condition(1, LEFTRIGHT, this->localPlayer);
 
   this->sky->setParent(this->localCamera);
@@ -493,6 +489,6 @@
   glNewList (objectList, GL_COMPILE);
 
-  //trackManager->drawGraph(.01);
-  //trackManager->debug(2);
+  //TrackManager::getInstance()->drawGraph(.01);
+  //TrackManager::getInstance()->debug(2);
   glEndList();
 
@@ -556,59 +552,57 @@
 
   // initializing the TrackManager
-  this->trackManager = TrackManager::getInstance();
-  //trackManager->addPointV(Vector(0,0,0));
-  trackManager->addPointV(Vector(150, -35, 5));
-  trackManager->addPointV(Vector(200,-35, 5));
-  trackManager->addPointV(Vector(250, -35, 5));
-  trackManager->addPointV(Vector(320,-33,-.55));
-  trackManager->setDuration(1);
-  trackManager->setSavePoint();
-
-  trackManager->addPointV(Vector(410, 0, 0));
-  trackManager->addPointV(Vector(510, 20, -10));
-  trackManager->addPointV(Vector(550, 20, -10));
-  trackManager->addPointV(Vector(570, 20, -10));
-  trackManager->setDuration(2);
-
-  trackManager->forkS("testFork1,testFork2");
-  trackManager->workOnS("testFork1");
-  trackManager->addPointV(Vector(640, 25, -30));
-  trackManager->addPointV(Vector(700, 40, -120));
-  trackManager->addPointV(Vector(800, 50, -150));
-  trackManager->addPointV(Vector(900, 60, -100));
-  trackManager->addPointV(Vector(900, 60, -70));
-  trackManager->addPointV(Vector(990, 65, -15));
-  trackManager->addPointV(Vector(1050, 65, -10));
-  trackManager->addPointV(Vector(1100, 65, -20));
-  trackManager->setDuration(4);
-
-  trackManager->workOnS("testFork2");
-  trackManager->addPointV(Vector(640, 25, 20));
-  trackManager->addPointV(Vector(670, 50, 120));
-  trackManager->addPointV(Vector(700, 70, 80));
-  trackManager->addPointV(Vector(800, 70, 65));
-  trackManager->addPointV(Vector(850, 65, 65));
-  trackManager->addPointV(Vector(920, 35, 40));
-  trackManager->addPointV(Vector(945, 40, 40));
-  trackManager->addPointV(Vector(970, 24, 40));
-  trackManager->addPointV(Vector(1000, 40, -7));
-
-  trackManager->setDuration(4);
-
-
-  trackManager->joinS("testFork1,testFork2");
-
-  trackManager->addPointV(Vector(1200, 60, -50));
-  trackManager->addPointV(Vector(1300, 50, -50));
-  trackManager->addPointV(Vector(1400, 40, -50));
-  trackManager->addPointV(Vector(1500, 40, -60));
-  trackManager->addPointV(Vector(1600, 35, -55));
-  trackManager->addPointV(Vector(1700, 45, -40));
-  trackManager->addPointV(Vector(1750, 60, -40));
-  trackManager->addPointV(Vector(1770, 80, -40));
-  trackManager->addPointV(Vector(1800, 100, -40));
-  trackManager->setDuration(10);
-
-  trackManager->finalize();
+  TrackManager::getInstance()->addPointV(Vector(150, -35, 5));
+  TrackManager::getInstance()->addPointV(Vector(200,-35, 5));
+  TrackManager::getInstance()->addPointV(Vector(250, -35, 5));
+  TrackManager::getInstance()->addPointV(Vector(320,-33,-.55));
+  TrackManager::getInstance()->setDuration(1);
+  TrackManager::getInstance()->setSavePoint();
+
+  TrackManager::getInstance()->addPointV(Vector(410, 0, 0));
+  TrackManager::getInstance()->addPointV(Vector(510, 20, -10));
+  TrackManager::getInstance()->addPointV(Vector(550, 20, -10));
+  TrackManager::getInstance()->addPointV(Vector(570, 20, -10));
+  TrackManager::getInstance()->setDuration(2);
+
+  TrackManager::getInstance()->forkS("testFork1,testFork2");
+  TrackManager::getInstance()->workOnS("testFork1");
+  TrackManager::getInstance()->addPointV(Vector(640, 25, -30));
+  TrackManager::getInstance()->addPointV(Vector(700, 40, -120));
+  TrackManager::getInstance()->addPointV(Vector(800, 50, -150));
+  TrackManager::getInstance()->addPointV(Vector(900, 60, -100));
+  TrackManager::getInstance()->addPointV(Vector(900, 60, -70));
+  TrackManager::getInstance()->addPointV(Vector(990, 65, -15));
+  TrackManager::getInstance()->addPointV(Vector(1050, 65, -10));
+  TrackManager::getInstance()->addPointV(Vector(1100, 65, -20));
+  TrackManager::getInstance()->setDuration(4);
+
+  TrackManager::getInstance()->workOnS("testFork2");
+  TrackManager::getInstance()->addPointV(Vector(640, 25, 20));
+  TrackManager::getInstance()->addPointV(Vector(670, 50, 120));
+  TrackManager::getInstance()->addPointV(Vector(700, 70, 80));
+  TrackManager::getInstance()->addPointV(Vector(800, 70, 65));
+  TrackManager::getInstance()->addPointV(Vector(850, 65, 65));
+  TrackManager::getInstance()->addPointV(Vector(920, 35, 40));
+  TrackManager::getInstance()->addPointV(Vector(945, 40, 40));
+  TrackManager::getInstance()->addPointV(Vector(970, 24, 40));
+  TrackManager::getInstance()->addPointV(Vector(1000, 40, -7));
+
+  TrackManager::getInstance()->setDuration(4);
+
+
+  TrackManager::getInstance()->joinS("testFork1,testFork2");
+
+  TrackManager::getInstance()->addPointV(Vector(1200, 60, -50));
+  TrackManager::getInstance()->addPointV(Vector(1300, 50, -50));
+  TrackManager::getInstance()->addPointV(Vector(1400, 40, -50));
+  TrackManager::getInstance()->addPointV(Vector(1500, 40, -60));
+  TrackManager::getInstance()->addPointV(Vector(1600, 35, -55));
+  TrackManager::getInstance()->addPointV(Vector(1700, 45, -40));
+  TrackManager::getInstance()->addPointV(Vector(1750, 60, -40));
+  TrackManager::getInstance()->addPointV(Vector(1770, 80, -40));
+  TrackManager::getInstance()->addPointV(Vector(1800, 100, -40));
+  TrackManager::getInstance()->setDuration(10);
+
+  TrackManager::getInstance()->finalize();
 
 
@@ -639,7 +633,7 @@
 
 
-        this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
-        this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
-        this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
+        EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
+        EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
+        EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
 
         /*
@@ -679,9 +673,9 @@
         this->localCamera->lookAt(this->localPlayer);
 
-        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_UP);
-        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_DOWN);
-        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_LEFT);
-        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_RIGHT);
-        this->eventHandler->subscribe(this->pilotNode, ES_GAME, EV_MOUSE_MOTION);
+        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_UP);
+        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_DOWN);
+        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_LEFT);
+        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_RIGHT);
+        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, EV_MOUSE_MOTION);
 
         // bind input
@@ -690,5 +684,5 @@
 
         /*
-        PNode* tn = trackManager->getTrackNode();
+        PNode* tn = TrackManager::getInstance()->getTrackNode();
         tn->addChild(this->localPlayer);
         this->localCamera->lookAt(tn);
@@ -696,5 +690,5 @@
         tn->addChild(this->localCamera);
         this->localPlayer->setParentMode(PNODE_ALL);
-        trackManager->condition(2, LEFTRIGHT, this->localPlayer);
+        TrackManager::getInstance()->condition(2, LEFTRIGHT, this->localPlayer);
         */
         this->glmis->step();
@@ -889,5 +883,5 @@
   glCallList (objectList);
 
-  particleEngine->draw(); //!< \todo should be dts like in the Trunk;
+  ParticleEngine::getInstance()->draw(); //!< \todo should be dts like in the Trunk;
 
   crosshair->draw();
@@ -1075,5 +1069,5 @@
 
       /* update tick the rest */
-      this->trackManager->tick(this->dt);
+      TrackManager::getInstance()->tick(this->dt);
       this->localCamera->tick(this->dt);
       // tick the engines
@@ -1107,5 +1101,5 @@
 void World::update()
 {
-  this->garbageCollector->update();
+  GarbageCollector::getInstance()->update();
   this->nullParent->update (this->dtS);
 
Index: /orxonox/trunk/src/story_entities/world.h
===================================================================
--- /orxonox/trunk/src/story_entities/world.h	(revision 4821)
+++ /orxonox/trunk/src/story_entities/world.h	(revision 4822)
@@ -14,11 +14,8 @@
 class World;
 class WorldEntity;
-class TrackManager;
 class Camera;
 class Player;
 class PNode;
 class GLMenuImageScreen;
-class LightManager;
-class ParticleEngine;
 class Terrain;
 class GarbageCollector;
@@ -26,5 +23,4 @@
 class TiXmlElement;
 class PilotNode;
-class EventHandler;
 
 //! The game world Interface
@@ -102,5 +98,5 @@
   Uint32 lastFrame;                   //!< last time of frame
   Uint32 cycle;                       //!< The cycle we are in (starts with 0 and rises with every frame)
-  Uint32 dt;                          //!< time needed to calculate this frame
+  Uint32 dt;                          //!< time needed to calculate this frame (in milliSeconds)
   float dtS;                          //!< The time needed for caluculations in seconds
   double gameTime;                    //!< this is where the game time is saved
@@ -115,10 +111,9 @@
   char* path;                         //!< The file from which this world is loaded
 
+
+  // IMPORTANT WORLD-ENTITIES
   PNode* nullParent;                  //!< The zero-point, that everything has as its parent.
-  TrackManager* trackManager;         //!< The reference of the TrackManager that handles the course through the Level.
-  ParticleEngine* particleEngine;     //!< The ParticleEngine of the World.
   Camera* localCamera;                //!< The current Camera
   WorldEntity* sky;                   //!< The Environmental Heaven of orxonox \todo insert this to environment insted
-  LightManager* lightMan;             //!< The Lights of the Level
   Terrain* terrain;                   //!< The Terrain of the World.
 
@@ -127,7 +122,4 @@
   Player* localPlayer;                //!< The Player, you fly through the level.
   PilotNode* pilotNode;               //!< THe pilot node to fly with the mouse
-
-  GarbageCollector* garbageCollector; //!< reference to the garbage  collector
-  EventHandler* eventHandler;
 
   /* function for main-loop */
Index: /orxonox/trunk/src/world_entities/player.cc
===================================================================
--- /orxonox/trunk/src/world_entities/player.cc	(revision 4821)
+++ /orxonox/trunk/src/world_entities/player.cc	(revision 4822)
@@ -215,5 +215,4 @@
 
   this->weaponMan->draw();
-
 }
 
