Index: trunk/src/story_entities/network_world.cc
===================================================================
--- trunk/src/story_entities/network_world.cc	(revision 6139)
+++ trunk/src/story_entities/network_world.cc	(revision 6142)
@@ -38,5 +38,4 @@
 #include "shell.h"
 
-#include "garbage_collector.h"
 #include "fast_factory.h"
 #include "animation_player.h"
@@ -123,9 +122,4 @@
   PRINTF(3)("NetworkWorld::~NetworkWorld() - deleting current world\n");
 
-
-  // here everything that is alocated by the NetworkWorld is deleted
-  delete this->entities;
-  State::setWorldEntityList(NULL);
-
   delete this->localPlayer;
 
@@ -141,5 +135,6 @@
   SoundEngine::getInstance()->flushAllSources();
 
-
+  if (State::getObjectManager() == &this->objectManager)
+    State::setObjectManager(NULL);
   // erease everything that is left.
   delete PNode::getNullParent();
@@ -180,5 +175,4 @@
   this->music = NULL;
   this->shell = NULL;
-  this->entities = NULL;
   this->localPlayer = NULL;
   this->localCamera = NULL;
@@ -214,5 +208,5 @@
 ErrorMessage NetworkWorld::preLoad()
 {
-  State::setWorldEntityList(this->entities = new tList<WorldEntity>());
+  State::setObjectManager(&this->objectManager);
   this->cycle = 0;
 
@@ -233,6 +227,4 @@
 
   GraphicsEngine::getInstance()->displayFPS(true);
-
-  CDEngine::getInstance()->setEntityList( this->entities);
 }
 
@@ -630,14 +622,4 @@
 
 /**
- *  gets the list of entities from the world
- * @returns entity list
-*/
-tList<WorldEntity>* NetworkWorld::getEntities()
-{
-  return this->entities;
-}
-
-
-/**
  *  this returns the current game time
  * @returns elapsed game time
@@ -648,21 +630,20 @@
 }
 
-
 /**
  *  function to put your own debug stuff into it. it can display informations about
    the current class/procedure
 */
-void NetworkWorld::debug()
-{
-  PRINTF(0)("Printing out the List of alive NetworkWorldEntities:\n");
-  tIterator<WorldEntity>* iterator = this->entities->getIterator();
-  WorldEntity* entity = iterator->firstElement();
-  while( entity != NULL)
-  {
-    PRINTF(0)("%s::%s\n", entity->getClassName(), entity->getName());
-    entity = iterator->nextElement();
-  }
-  delete iterator;
-}
+// void NetworkWorld::debug()
+// {
+//   PRINTF(0)("Printing out the List of alive NetworkWorldEntities:\n");
+//   tIterator<WorldEntity>* iterator = this->entities->getIterator();
+//   WorldEntity* entity = iterator->firstElement();
+//   while( entity != NULL)
+//   {
+//     PRINTF(0)("%s::%s\n", entity->getClassName(), entity->getName());
+//     entity = iterator->nextElement();
+//   }
+//   delete iterator;
+// }
 
 
@@ -682,5 +663,5 @@
     {
       ++this->cycle;
-      PRINTF(4)("NetworkWorld::mainloop() - number of entities: %i\n", this->entities->getSize());
+//      PRINTF(4)("NetworkWorld::mainloop() - number of entities: %i\n", this->entities->getSize());
       // Network
       this->synchronize ();
@@ -727,4 +708,11 @@
 }
 
+void NetworkWorld::tick(std::list<WorldEntity*> entityList, float dt)
+{
+  std::list<WorldEntity*>::iterator entity;
+  for (entity = entityList.begin(); entity != entityList.end(); entity++)
+    (*entity)->tick(dt);
+
+}
 
 /**
@@ -763,12 +751,9 @@
       this->gameTime += this->dtS;
 
-      tIterator<WorldEntity>* iterator = this->entities->getIterator();
-      WorldEntity* entity = iterator->firstElement();
-      while( entity != NULL)
-        {
-          entity->tick (this->dtS);
-          entity = iterator->nextElement();
-        }
-      delete iterator;
+/*      this->tick(this->objectManager.getObjectList(OM_DEAD_TICK), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_COMMON), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_GROUP_00), this->dtS);*/
+      this->tick(this->objectManager.getObjectList(OM_GROUP_01), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_GROUP_01_PROJ), this->dtS);
 
       /* update tick the rest */
@@ -780,5 +765,4 @@
 
       ParticleEngine::getInstance()->tick(this->dtS);
-      GarbageCollector::getInstance()->tick(this->dtS);
 
 
@@ -805,5 +789,4 @@
 void NetworkWorld::update()
 {
-  GarbageCollector::getInstance()->update();
   GraphicsEngine::getInstance()->update(this->dtS);
   PNode::getNullParent()->updateNode (this->dtS);
@@ -816,5 +799,8 @@
 void NetworkWorld::collide()
 {
-  CDEngine::getInstance()->checkCollisions();
+  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_00),
+                                            this->objectManager.getObjectList(OM_GROUP_01_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_01),
+                                            this->objectManager.getObjectList(OM_COMMON));
 }
 
@@ -846,16 +832,18 @@
 void NetworkWorld::draw ()
 {
-  /* draw entities */
-  WorldEntity* entity;
-  glLoadIdentity();
-  tIterator<WorldEntity>* iterator = this->entities->getIterator();
-  entity = iterator->firstElement();
-  while( entity != NULL )
-  {
-    if( entity->isVisible() ) entity->draw();
-    if( unlikely( this->showBV)) entity->drawBVTree(3, 226);  // to draw the bounding boxes of the objects at level 2 for debug purp
-    entity = iterator->nextElement();
-  }
-  delete iterator;
+  GraphicsEngine* engine = GraphicsEngine::getInstance();
+  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON_NOTICK));
+  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON));
+  engine->draw(State::getObjectManager()->getObjectList(OM_COMMON));
+  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_00));
+  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01));
+  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
+
+//   {
+//     if( entity->isVisible() ) entity->draw();
+  //FIXME
+//     if( unlikely( this->showBV)) entity->drawBVTree(3, 226);  // to draw the bounding boxes of the objects at level 2 for debug purp
+//     entity = iterator->nextElement();
+//   }
 
   glCallList (objectList);
@@ -866,5 +854,5 @@
     PNode::getNullParent()->debugDraw(0);
 
-  GraphicsEngine::getInstance()->draw();
+  engine->draw();
   //TextEngine::getInstance()->draw();
 }
@@ -876,5 +864,5 @@
 void NetworkWorld::spawn(WorldEntity* entity)
 {
-  this->entities->add (entity);
+//   this->entities->add (entity);
   entity->postSpawn ();
 }
@@ -889,5 +877,5 @@
 void NetworkWorld::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir)
 {
-  this->entities->add (entity);
+//   this->entities->add (entity);
 
   entity->setAbsCoor (*absCoor);
@@ -915,5 +903,5 @@
       entity->setRelDir (*relDir);
 
-      this->entities->add (entity);
+//       this->entities->add (entity);
 
       entity->postSpawn ();
Index: trunk/src/story_entities/network_world.h
===================================================================
--- trunk/src/story_entities/network_world.h	(revision 6139)
+++ trunk/src/story_entities/network_world.h	(revision 6142)
@@ -11,6 +11,8 @@
 #include "story_entity.h"
 #include "p_node.h"
+#include "object_manager.h"
 
 class NetworkWorld;
+
 class WorldEntity;
 class Camera;
@@ -18,11 +20,8 @@
 class GLMenuImageScreen;
 class Terrain;
-class GarbageCollector;
-class Text;
 class TiXmlElement;
 
 class Shell;
 class OggPlayer;
-template<class T> class tList;
 
 //! The game world
@@ -61,6 +60,4 @@
   bool command (Command* cmd);
 
-  tList<WorldEntity>* getEntities();
-
   /* interface to world */
   void spawn (WorldEntity* entity);
@@ -84,4 +81,5 @@
   void synchronize ();
   void handleInput ();
+  void tick (std::list<WorldEntity*> worldEntity, float dt);
   void tick ();
   void update ();
@@ -104,4 +102,6 @@
     bool bPause;                        //!< pause mode
 
+    ObjectManager      objectManager;   //!< The ObjectManager of this World.
+
     GLMenuImageScreen* glmis;           //!< The Level-Loader Display
 
@@ -118,5 +118,5 @@
 
     GLuint objectList;                  //!< temporary: @todo this will be ereased soon
-    tList<WorldEntity>* entities;       //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
+
     Player* localPlayer;                //!< The Player, you fly through the level.
 };
Index: trunk/src/story_entities/world.cc
===================================================================
--- trunk/src/story_entities/world.cc	(revision 6139)
+++ trunk/src/story_entities/world.cc	(revision 6142)
@@ -38,5 +38,4 @@
 #include "shell.h"
 
-#include "garbage_collector.h"
 #include "fast_factory.h"
 #include "animation_player.h"
@@ -123,9 +122,4 @@
   PRINTF(3)("World::~World() - deleting current world\n");
 
-
-  // here everything that is alocated by the World is deleted
-  delete this->entities;
-  State::setWorldEntityList(NULL);
-
   delete this->localPlayer;
 
@@ -141,5 +135,6 @@
   SoundEngine::getInstance()->flushAllSources();
 
-
+  if (State::getObjectManager() == &this->objectManager)
+    State::setObjectManager(NULL);
   // erease everything that is left.
   delete PNode::getNullParent();
@@ -180,5 +175,4 @@
   this->music = NULL;
   this->shell = NULL;
-  this->entities = NULL;
   this->localPlayer = NULL;
   this->localCamera = NULL;
@@ -214,5 +208,5 @@
 ErrorMessage World::preLoad()
 {
-  State::setWorldEntityList(this->entities = new tList<WorldEntity>());
+  State::setObjectManager(&this->objectManager);
   this->cycle = 0;
 
@@ -233,6 +227,4 @@
 
   GraphicsEngine::getInstance()->displayFPS(true);
-
-  CDEngine::getInstance()->setEntityList( this->entities);
 }
 
@@ -588,14 +580,4 @@
 
 /**
- *  gets the list of entities from the world
- * @returns entity list
-*/
-tList<WorldEntity>* World::getEntities()
-{
-  return this->entities;
-}
-
-
-/**
  *  this returns the current game time
  * @returns elapsed game time
@@ -605,23 +587,4 @@
   return this->gameTime;
 }
-
-
-/**
- *  function to put your own debug stuff into it. it can display informations about
-   the current class/procedure
-*/
-void World::debug()
-{
-  PRINTF(0)("Printing out the List of alive WorldEntities:\n");
-  tIterator<WorldEntity>* iterator = this->entities->getIterator();
-  WorldEntity* entity = iterator->firstElement();
-  while( entity != NULL)
-  {
-    PRINTF(0)("%s::%s\n", entity->getClassName(), entity->getName());
-    entity = iterator->nextElement();
-  }
-  delete iterator;
-}
-
 
 /**
@@ -640,5 +603,4 @@
     {
       ++this->cycle;
-      PRINTF(4)("World::mainloop() - number of entities: %i\n", this->entities->getSize());
       // Network
       this->synchronize ();
@@ -685,4 +647,11 @@
 }
 
+void World::tick(std::list<WorldEntity*> entityList, float dt)
+{
+  std::list<WorldEntity*>::iterator entity;
+  for (entity = entityList.begin(); entity != entityList.end(); entity++)
+    (*entity)->tick(dt);
+
+}
 
 /**
@@ -721,12 +690,9 @@
       this->gameTime += this->dtS;
 
-      tIterator<WorldEntity>* iterator = this->entities->getIterator();
-      WorldEntity* entity = iterator->firstElement();
-      while( entity != NULL)
-        {
-          entity->tick (this->dtS);
-          entity = iterator->nextElement();
-        }
-      delete iterator;
+/*      this->tick(this->objectManager.getObjectList(OM_DEAD_TICK), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_COMMON), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_GROUP_00), this->dtS);*/
+      this->tick(this->objectManager.getObjectList(OM_GROUP_01), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_GROUP_01_PROJ), this->dtS);
 
       /* update tick the rest */
@@ -738,5 +704,4 @@
 
       ParticleEngine::getInstance()->tick(this->dtS);
-      GarbageCollector::getInstance()->tick(this->dtS);
 
 
@@ -763,5 +728,4 @@
 void World::update()
 {
-  GarbageCollector::getInstance()->update();
   GraphicsEngine::getInstance()->update(this->dtS);
   PNode::getNullParent()->updateNode (this->dtS);
@@ -774,5 +738,8 @@
 void World::collide()
 {
-  CDEngine::getInstance()->checkCollisions();
+  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_00),
+                                            this->objectManager.getObjectList(OM_GROUP_01_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_01),
+                                            this->objectManager.getObjectList(OM_COMMON));
 }
 
@@ -804,16 +771,18 @@
 void World::draw ()
 {
-  /* draw entities */
-  WorldEntity* entity;
-  glLoadIdentity();
-  tIterator<WorldEntity>* iterator = this->entities->getIterator();
-  entity = iterator->firstElement();
-  while( entity != NULL )
-  {
-    if( entity->isVisible() ) entity->draw();
-    if( unlikely( this->showBV)) entity->drawBVTree(3, 226);  // to draw the bounding boxes of the objects at level 2 for debug purp
-    entity = iterator->nextElement();
-  }
-  delete iterator;
+  GraphicsEngine* engine = GraphicsEngine::getInstance();
+  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON_NOTICK));
+  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON));
+  engine->draw(State::getObjectManager()->getObjectList(OM_COMMON));
+  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_00));
+  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01));
+  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
+
+//   {
+//     if( entity->isVisible() ) entity->draw();
+  //FIXME
+//     if( unlikely( this->showBV)) entity->drawBVTree(3, 226);  // to draw the bounding boxes of the objects at level 2 for debug purp
+//     entity = iterator->nextElement();
+//   }
 
   glCallList (objectList);
@@ -824,5 +793,5 @@
     PNode::getNullParent()->debugDraw(0);
 
-  GraphicsEngine::getInstance()->draw();
+  engine->draw();
   //TextEngine::getInstance()->draw();
 }
@@ -834,5 +803,5 @@
 void World::spawn(WorldEntity* entity)
 {
-  this->entities->add (entity);
+//   this->entities->add (entity);
   entity->postSpawn ();
 }
@@ -847,5 +816,5 @@
 void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir)
 {
-  this->entities->add (entity);
+//   this->entities->add (entity);
 
   entity->setAbsCoor (*absCoor);
@@ -873,5 +842,5 @@
       entity->setRelDir (*relDir);
 
-      this->entities->add (entity);
+//       this->entities->add (entity);
 
       entity->postSpawn ();
Index: trunk/src/story_entities/world.h
===================================================================
--- trunk/src/story_entities/world.h	(revision 6139)
+++ trunk/src/story_entities/world.h	(revision 6142)
@@ -11,6 +11,7 @@
 #include "story_entity.h"
 #include "p_node.h"
+#include "object_manager.h"
 
-class World;
+
 class WorldEntity;
 class Camera;
@@ -18,11 +19,8 @@
 class GLMenuImageScreen;
 class Terrain;
-class GarbageCollector;
-class Text;
 class TiXmlElement;
 
 class Shell;
 class OggPlayer;
-template<class T> class tList;
 
 //! The game world
@@ -61,6 +59,4 @@
   bool command (Command* cmd);
 
-  tList<WorldEntity>* getEntities();
-
   /* interface to world */
   void spawn (WorldEntity* entity);
@@ -84,4 +80,5 @@
   void synchronize ();
   void handleInput ();
+  void tick (std::list<WorldEntity*> worldEntity, float dt);
   void tick ();
   void update ();
@@ -104,4 +101,6 @@
     bool bPause;                        //!< pause mode
 
+    ObjectManager      objectManager;   //!< The ObjectManager of this World.
+
     GLMenuImageScreen* glmis;           //!< The Level-Loader Display
 
@@ -118,5 +117,5 @@
 
     GLuint objectList;                  //!< temporary: @todo this will be ereased soon
-    tList<WorldEntity>* entities;       //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
+
     Player* localPlayer;                //!< The Player, you fly through the level.
 };
