Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 4897)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 4898)
@@ -26,10 +26,11 @@
    @todo this constructor is not jet implemented - do it
 */
-Quadtree::Quadtree (modelInfo* pModelInfo)
+Quadtree::Quadtree (modelInfo* pModelInfo, const int treeDepth)
 {
    this->setClassID(CL_QUADTREE, "Quadtree");
    this->pModelInfo = pModelInfo;
+   this->treeDepth = treeDepth;
 
-   this->rootNode = new QuadtreeNode(this->pModelInfo);
+   this->rootNode = new QuadtreeNode(this->pModelInfo, this->treeDepth);
 }
 
@@ -46,31 +47,4 @@
 
 /**
- *  gives the signal to separate the model into a quadtree
- */
-void Quadtree::separate()
-{
-  this->rootNode->separateNode();
-}
-
-
-/**
- *  gives the signal to separate the model into a quadtree
- */
-void Quadtree::separate(const int maxDepth)
-{
-  this->rootNode->separateNode(0, maxDepth);
-}
-
-
-/**
- *  gives the signal to separate the model into a quadtree
- */
-void Quadtree::separate(float minLength)
-{
-  this->rootNode->separateNode(minLength);
-}
-
-
-/**
  *  draws the debug quadtree boxes around the model
  */
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h	(revision 4897)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h	(revision 4898)
@@ -18,10 +18,6 @@
 
  public:
-  Quadtree(modelInfo* pModelInfo);
+  Quadtree(modelInfo* pModelInfo, const int treeDepth);
   virtual ~Quadtree();
-
-  void separate();
-  void separate(const int maxDepth);
-  void separate(float minLength);
 
   void drawTree(int depth, int drawMode) const;
@@ -30,5 +26,5 @@
    QuadtreeNode*                   rootNode;              //!< reference to the root node of the quadtree
    modelInfo*                      pModelInfo;            //!< reference to the modelInfo of the object
-
+   int                             treeDepth;             //!< depth of the tree
 };
 
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 4897)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 4898)
@@ -30,5 +30,5 @@
                             const float* pVertices, int numVertices,
                             Quadtree* quadtree, QuadtreeNode* parent,
-                            Rectangle* rect
+                            Rectangle* rect, int treeDepth, const int maxDepth
                            )
 {
@@ -41,4 +41,17 @@
   this->parent = parent;
   this->pDimension = rect;
+  this->treeDepth = treeDepth;
+  this->maxDepth = maxDepth;
+
+
+  /* debug output */
+  for( int i = 0; i < this->treeDepth; ++i)
+    PRINT(3)(" |");
+  PRINT(3)(" | +-| (Event) Separating Node Depth: %i/%i\n", treeDepth, maxDepth);
+
+  for( int i = 0; i < this->treeDepth; ++i)
+    PRINT(3)(" |");
+  PRINT(3)(" | +-| (II) Rectangle Center (%5.2f, %5.2f), half axis length: %5.2f\n",
+  this->pDimension->getCenter()->x, this->pDimension->getCenter()->z, this->pDimension->getAxis());
 
   this->init();
@@ -49,5 +62,5 @@
  *  standard constructor
  */
-QuadtreeNode::QuadtreeNode(modelInfo* pModelInfo)
+QuadtreeNode::QuadtreeNode(modelInfo* pModelInfo, const int maxDepth)
 {
   this->pModelInfo = pModelInfo;
@@ -61,4 +74,10 @@
     this->pTriangles[i] = &this->pModelInfo->pTriangles[i];
   this->treeDepth = 0;
+  this->maxDepth = maxDepth;
+
+  /* debug output */
+  for( int i = 0; i < this->treeDepth; ++i)
+    PRINT(3)(" |");
+  PRINT(3)(" | +-| (Event) Separating Node Depth: %i/%i\n", treeDepth, maxDepth);
 
   this->pDimension = this->getDimFromModel();
@@ -80,4 +99,6 @@
   this->nodeC = NULL;
   this->nodeD = NULL;
+
+  this->separateNode(this->treeDepth, this->maxDepth);
 }
 
@@ -105,9 +126,5 @@
 void QuadtreeNode::separateNode(int treeDepth, const int maxDepth)
 {
-  this->treeDepth = treeDepth;
-  /* debug output */
-  for( int i = 0; i < treeDepth; ++i)
-    PRINT(3)(" |");
-  PRINT(3)(" | +-| (Event) Separating Node Depth: %i/%i\n", treeDepth, maxDepth);
+
 
   /* dimension calculation & limit checking */
@@ -118,8 +135,9 @@
   /* node separation */
   this->separateNode();
-  this->nodeA->separateNode(treeDepth + 1, maxDepth);
-  this->nodeB->separateNode(treeDepth + 1, maxDepth);
-  this->nodeC->separateNode(treeDepth + 1, maxDepth);
-  this->nodeD->separateNode(treeDepth + 1, maxDepth);
+
+//   this->nodeA->separateNode(treeDepth + 1, maxDepth);
+//   this->nodeB->separateNode(treeDepth + 1, maxDepth);
+//   this->nodeC->separateNode(treeDepth + 1, maxDepth);
+//   this->nodeD->separateNode(treeDepth + 1, maxDepth);
 }
 
@@ -252,22 +270,22 @@
   Vector v;
 
-  v.x = this->center.x + this->pDimension->getAxis() / 2.0f;
-  v.z = this->center.z + this->pDimension->getAxis() / 2.0f;
+  v.x = this->pDimension->getCenter()->x + this->pDimension->getAxis() / 2.0f;
+  v.z = this->pDimension->getCenter()->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;
+  v.z = this->pDimension->getCenter()->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;
+  v.x = this->pDimension->getCenter()->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;
+  v.z = this->pDimension->getCenter()->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, 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);
+  this->nodeA = new QuadtreeNode(pTriA, lenA, this->pVertices, this->numVertices, this->quadtree, this, rA, this->treeDepth + 1, this->maxDepth);
+  this->nodeB = new QuadtreeNode(pTriB, lenB, this->pVertices, this->numVertices, this->quadtree, this, rB, this->treeDepth + 1, this->maxDepth);
+  this->nodeC = new QuadtreeNode(pTriC, lenC, this->pVertices, this->numVertices, this->quadtree, this, rC, this->treeDepth + 1, this->maxDepth);
+  this->nodeD = new QuadtreeNode(pTriD, lenD, this->pVertices, this->numVertices, this->quadtree, this, rD, this->treeDepth + 1, this->maxDepth);
 }
 
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4897)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4898)
@@ -23,11 +23,7 @@
                  const float* pVertices, int numVertices,
                  Quadtree* quadtree, QuadtreeNode* parent,
-                 Rectangle* rect);
-    QuadtreeNode(modelInfo* pModelInfo);
+                 Rectangle* rect, int treeDepth, const int maxDepth);
+    QuadtreeNode(modelInfo* pModelInfo, const int maxDepth);
     virtual ~QuadtreeNode();
-
-    void separateNode(int treeDepth, const int maxDepth);
-    void separateNode(float minLength);
-    void separateNode();
 
     void drawTree(int depth, int drawMode) const;
@@ -37,6 +33,9 @@
     void init();
 
+    void separateNode(int treeDepth, const int maxDepth);
+    void separateNode(float minLength);
+    void separateNode();
+
     Rectangle* getDimFromModel();
-
 
   protected:
@@ -55,4 +54,5 @@
 
     int                             treeDepth;          //!< the depth of the tree
+    int                             maxDepth;           //!< the maximal depth of the tree
 
     sTriangleExt**                  pTriangles;         //!< reference to the triangles of the node
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc	(revision 4897)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc	(revision 4898)
@@ -99,6 +99,5 @@
 Quadtree* SpatialSeparation::createQuadtree(AbstractModel* model)
 {
-  this->quadtree = new Quadtree(model->getModelInfo());
-  this->quadtree->separate(4);
+  this->quadtree = new Quadtree(model->getModelInfo(), 4);
 
   return this->quadtree;
