Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 4896)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 4897)
@@ -29,5 +29,7 @@
 QuadtreeNode::QuadtreeNode (sTriangleExt** triangles, int numTriangles,
                             const float* pVertices, int numVertices,
-                            Quadtree* quadtree, QuadtreeNode* parent)
+                            Quadtree* quadtree, QuadtreeNode* parent,
+                            Rectangle* rect
+                           )
 {
   this->pTriangles = triangles;
@@ -38,4 +40,5 @@
   this->treeDepth = 0;
   this->parent = parent;
+  this->pDimension = rect;
 
   this->init();
@@ -59,4 +62,5 @@
   this->treeDepth = 0;
 
+  this->pDimension = this->getDimFromModel();
   this->init();
 }
@@ -108,5 +112,5 @@
 
   /* dimension calculation & limit checking */
-  this->pDimension = this->getDimension();
+
   if( treeDepth >= maxDepth)
     return;
@@ -128,5 +132,4 @@
 {
   /* dimension calculation & limit checking */
-  this->pDimension = this->getDimension();
   if( minLength <= this->pDimension->getAxis())
     return;
@@ -245,9 +248,26 @@
   delete iterator;
 
+
+  /* now create the rectangle dimensions */
+  Vector v;
+
+  v.x = this->center.x + this->pDimension->getAxis() / 2.0f;
+  v.z = this->center.z + this->pDimension->getAxis() / 2.0f;
+  Rectangle* rA = new Rectangle(v, this->pDimension->getAxis() / 2.0f);
+
+  v.z = this->center.z - this->pDimension->getAxis() / 2.0f;
+  Rectangle* rB = new Rectangle(v, this->pDimension->getAxis() / 2.0f);
+
+  v.x = this->center.x - this->pDimension->getAxis() / 2.0f;
+  Rectangle* rC = new Rectangle(v, this->pDimension->getAxis() / 2.0f);
+
+  v.z = this->center.z + this->pDimension->getAxis() / 2.0f;
+  Rectangle* rD = new Rectangle(v, this->pDimension->getAxis() / 2.0f);
+
   /* now propagate */
-  this->nodeA = new QuadtreeNode(pTriA, lenA, this->pVertices, this->numVertices, this->quadtree, this);
-  this->nodeB = new QuadtreeNode(pTriB, lenB, this->pVertices, this->numVertices, this->quadtree, this);
-  this->nodeC = new QuadtreeNode(pTriC, lenC, this->pVertices, this->numVertices, this->quadtree, this);
-  this->nodeD = new QuadtreeNode(pTriD, lenD, this->pVertices, this->numVertices, this->quadtree, this);
+  this->nodeA = new QuadtreeNode(pTriA, lenA, this->pVertices, this->numVertices, this->quadtree, this, rA);
+  this->nodeB = new QuadtreeNode(pTriB, lenB, this->pVertices, this->numVertices, this->quadtree, this, rB);
+  this->nodeC = new QuadtreeNode(pTriC, lenC, this->pVertices, this->numVertices, this->quadtree, this, rC);
+  this->nodeD = new QuadtreeNode(pTriD, lenD, this->pVertices, this->numVertices, this->quadtree, this, rD);
 }
 
@@ -282,47 +302,4 @@
 
 
-/**
-  \brief gets the maximal dimension of a model
- * @param playerModel the model that this measurement is based on
-    \return the dimension of the AbstractModel as a Rectangle
-
-    The rectangle is x-z axis aligned. ATTENTION: if there are any vertices in the model, that exceed the
-    size of 999999.0, there probably will be some errors in the dimensions calculations. Write an email to
-    patrick@orxonox.ethz.ch if you will ever encounter a model bigger than 999999.0 units, I will realy be
-    happy to see orxonox used to extensivly :)
- */
-Rectangle* QuadtreeNode::getDimension(modelInfo* pModelInfo)
-{
-  float            maxX, maxY;                       //!< the maximal coordinates axis
-  float            minX, minY;                       //!< minimal axis coorindates
-  const float*     pVertices;                        //!< pointer to the current vertices
-
-  maxX = -999999; maxY = -999999;
-  minX =  999999; minY =  999999;
-  /* get maximal/minimal x/y */
-  for( int i = 0; i < pModelInfo->numVertices; ++i)
-  {
-    pVertices = &pModelInfo->pVertices[i * 3];
-    if( pVertices[0] > maxX)
-      maxX = pVertices[0];
-    if( pVertices[2] > maxY)
-      maxY = pVertices[2];
-
-    if( pVertices[0] < minX)
-      minX = pVertices[0];
-    if( pVertices[2] < minY)
-      minY = pVertices[2];
-  }
-
-  Rectangle* rect = new Rectangle();
-  rect->setCenter((maxX + minX) / 2.0f, 0.0f, (maxY + minY) / 2.0f); /* this is little strange, since y is in opengl the up vector */
-  rect->setAxis(fmax(((fabs(maxX) + fabs(minX)) / 2.0f), ((fabs(maxY) + fabs(minY)) / 2.0f)));
-
-  for( int i = 0; i < this->treeDepth; ++i)
-    PRINT(3)(" |");
-  PRINT(3)(" | +-| (II) Rectangle Dimension  (%5.2f, %5.2f) to (%5.2f, %5.2f), Center (%5.2f, %5.2f)\n", minX, minY, maxX, maxY, rect->getCenter()->x, rect->getCenter()->z, rect->getAxis());
-  return rect;
-}
-
 
 /**
@@ -335,5 +312,5 @@
    happy to see orxonox used to extensivly :)
  */
-Rectangle* QuadtreeNode::getDimension()
+Rectangle* QuadtreeNode::getDimFromModel()
 {
   float            maxX, maxY;                       //!< the maximal coordinates axis
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4896)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4897)
@@ -22,5 +22,6 @@
     QuadtreeNode(sTriangleExt** triangles, int numTriangles,
                  const float* pVertices, int numVertices,
-                 Quadtree* quadtree, QuadtreeNode* parent);
+                 Quadtree* quadtree, QuadtreeNode* parent,
+                 Rectangle* rect);
     QuadtreeNode(modelInfo* pModelInfo);
     virtual ~QuadtreeNode();
@@ -35,6 +36,6 @@
   private:
     void init();
-    Rectangle* getDimension(modelInfo* pModelInfo);
-    Rectangle* getDimension();
+
+    Rectangle* getDimFromModel();
 
 
Index: /orxonox/trunk/src/lib/math/vector.h
===================================================================
--- /orxonox/trunk/src/lib/math/vector.h	(revision 4896)
+++ /orxonox/trunk/src/lib/math/vector.h	(revision 4897)
@@ -246,4 +246,5 @@
   public:
     Rectangle() { this->center = new Vector(); }
+    Rectangle(const Vector &center, float len) { this->center = new Vector(center.x, center.y, center.z); this->axis[0] = len; this->axis[1] = len; }
     virtual ~Rectangle() {}
 
