Index: orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 4916)
+++ orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 4917)
@@ -19,4 +19,5 @@
 #include "quadtree_node.h"
 #include "material.h"
+#include "vector.h"
 
 using namespace std;
@@ -102,4 +103,19 @@
 
 
+QuadtreeNode* Quadtree::getQuadtreeFromPosition(const Vector& position)
+{
+  Vector v = position;
+  Rectangle* r = this->rootNode->getDimension();
+  float len = this->nodes[0]->getDimension()->getAxis() * 2.0f;
+  float xOff = r->getCenter()->x - r->getAxis();
+  float yOff = r->getCenter()->z - r->getAxis();
+
+  int i = (int)(( position.x - xOff) / len) + 1;
+  int j = (int)(( position.z - yOff) / len) + 1;
+
+  printf("the array coordinates are: %i, %i\n", i, j);
+}
+
+
 /**
  *  draws the debug quadtree boxes around the model
Index: orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
===================================================================
--- orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4916)
+++ orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4917)
@@ -30,4 +30,5 @@
 
     float getHeight(const Vector& position);
+    Rectangle* getDimension() { return this->pDimension; }
 
     void drawTree(int depth, int drawMode) const;
Index: orxonox/trunk/src/story_entities/world.cc
===================================================================
--- orxonox/trunk/src/story_entities/world.cc	(revision 4916)
+++ orxonox/trunk/src/story_entities/world.cc	(revision 4917)
@@ -69,4 +69,6 @@
 #include "class_list.h"
 
+#include "cd_engine.h"
+
 
 using namespace std;
@@ -787,75 +789,4 @@
 
 /**
-  *  checks for collisions
-
-    This method runs through all WorldEntities known to the world and checks for collisions
-    between them. In case of collisions the collide() method of the corresponding entities
-    is called.
-*/
-void World::collide ()
-{
-  /*
-  List *a, *b;
-  WorldEntity *aobj, *bobj;
-
-  a = entities;
-
-  while( a != NULL)
-    {
-      aobj = a->nextElement();
-      if( aobj->bCollide && aobj->collisioncluster != NULL)
-        {
-          b = a->nextElement();
-          while( b != NULL )
-            {
-              bobj = b->nextElement();
-              if( bobj->bCollide && bobj->collisioncluster != NULL )
-                {
-                  unsigned long ahitflg, bhitflg;
-                  if( check_collision ( &aobj->place, aobj->collisioncluster,
-                                        &ahitflg, &bobj->place, bobj->collisioncluster,
-                                        &bhitflg) );
-                  {
-                    aobj->collide (bobj, ahitflg, bhitflg);
-                    bobj->collide (aobj, bhitflg, ahitflg);
-                  }
-                }
-              b = b->nextElement();
-            }
-        }
-      a = a->enumerate();
-    }
-  */
-}
-
-/**
-  *  runs through all entities calling their draw() methods
-*/
-void World::draw ()
-{
-  /* draw entities */
-  WorldEntity* entity;
-  glLoadIdentity();
-  //entity = this->entities->enumerate();
-  tIterator<WorldEntity>* iterator = this->entities->getIterator();
-  entity = iterator->nextElement();
-  while( entity != NULL )
-    {
-      if( entity->isVisible() ) entity->draw();
-      //entity = this->entities->nextElement();
-      entity = iterator->nextElement();
-    }
-  delete iterator;
-
-  glCallList (objectList);
-
-  ParticleEngine::getInstance()->draw();
-
-  GraphicsEngine::getInstance()->draw();
-  //TextEngine::getInstance()->draw();
-}
-
-
-/**
  *  function to put your own debug stuff into it. it can display informations about
    the current class/procedure
@@ -863,63 +794,4 @@
 void World::debug()
 {
-  PRINTF(2)("debug() - starting debug\n");
-  PNode* p1 = NullParent::getInstance ();
-  PNode* p2 = new PNode (Vector(2, 2, 2), p1);
-  PNode* p3 = new PNode (Vector(4, 4, 4), p1);
-  PNode* p4 = new PNode (Vector(6, 6, 6), p2);
-
-  p1->debug ();
-  p2->debug ();
-  p3->debug ();
-  p4->debug ();
-
-  p1->shiftCoor (Vector(-1, -1, -1));
-
-  printf("World::debug() - shift\n");
-  p1->debug ();
-  p2->debug ();
-  p3->debug ();
-  p4->debug ();
-
-  p1->update (0);
-
-  printf ("World::debug() - update\n");
-  p1->debug ();
-  p2->debug ();
-  p3->debug ();
-  p4->debug ();
-
-  p2->shiftCoor (Vector(-1, -1, -1));
-  p1->update (0);
-
-  p1->debug ();
-  p2->debug ();
-  p3->debug ();
-  p4->debug ();
-
-  p2->setAbsCoor (Vector(1,2,3));
-
-
- p1->update (0);
-
-  p1->debug ();
-  p2->debug ();
-  p3->debug ();
-  p4->debug ();
-
-  delete p1;
-
-
-  /*
-  WorldEntity* entity;
-  printf("counting all entities\n");
-  printf("World::debug() - enumerate()\n");
-  entity = entities->enumerate();
-  while( entity != NULL )
-    {
-      if( entity->bDraw ) printf("got an entity\n");
-      entity = entities->nextElement();
-    }
-  */
 }
 
@@ -1075,4 +947,9 @@
 
 
+void World::collide()
+{
+
+}
+
 /**
  *  render the current frame
@@ -1098,4 +975,31 @@
 
 /**
+ *  runs through all entities calling their draw() methods
+ */
+void World::draw ()
+{
+  /* draw entities */
+  WorldEntity* entity;
+  glLoadIdentity();
+  //entity = this->entities->enumerate();
+  tIterator<WorldEntity>* iterator = this->entities->getIterator();
+  entity = iterator->nextElement();
+  while( entity != NULL )
+  {
+    if( entity->isVisible() ) entity->draw();
+      //entity = this->entities->nextElement();
+    entity = iterator->nextElement();
+  }
+  delete iterator;
+
+  glCallList (objectList);
+
+  ParticleEngine::getInstance()->draw();
+
+  GraphicsEngine::getInstance()->draw();
+  //TextEngine::getInstance()->draw();
+}
+
+/**
  *  add and spawn a new entity to this world
  * @param entity to be added
