Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 4844)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 4845)
@@ -17,4 +17,5 @@
 
 #include "quadtree.h"
+#include "quadtree_node.h"
 
 using namespace std;
@@ -29,4 +30,6 @@
    this->setClassID(CL_QUADTREE, "Quadtree");
    this->pModelInfo = pModelInfo;
+
+   this->rootNode = new QuadtreeNode(this->pModelInfo);
 }
 
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h	(revision 4844)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h	(revision 4845)
@@ -10,5 +10,5 @@
 
 #include "base_object.h"
-#include "vector.h"
+#include "abstract_model.h"
 
 class QuadtreeNode;
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 4844)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 4845)
@@ -27,4 +27,14 @@
 {
    this->setClassID(CL_QUADTREE_NODE, "QuadtreeNode");
+}
+
+
+/**
+ *  standard constructor
+ */
+QuadtreeNode::QuadtreeNode(modelInfo* pModelInfo)
+{
+  this->pModelInfo = pModelInfo;
+  this->getDimension(this->pModelInfo);
 }
 
@@ -61,2 +71,44 @@
 void QuadtreeNode::drawTree(int depth, int drawMode) const
 {}
+
+
+
+/**
+  \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.
+ */
+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)));
+
+  PRINTF(0)("Dimension Informationation: X: min/max %f/%f Y: min/max %f/%f\n", minX, maxX, minY, maxY);
+  return rect;
+}
+
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4844)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4845)
@@ -1,7 +1,7 @@
 /*!
     \file proto_class.h
-  *  Definition of ...
+ *  Definition of ...
 
-*/
+ */
 
 #ifndef _QUADTREE_NODE_H
@@ -10,4 +10,5 @@
 #include "base_object.h"
 #include "vector.h"
+#include "abstract_model.h"
 
 // FORWARD DEFINITION
@@ -18,28 +19,32 @@
 class QuadtreeNode : public BaseObject {
 
- public:
-  QuadtreeNode(sTriangleExt* triangles, int numTriangles, Quadtree* quadtree);
-  virtual ~QuadtreeNode();
+  public:
+    QuadtreeNode(sTriangleExt* triangles, int numTriangles, Quadtree* quadtree);
+    QuadtreeNode(modelInfo* pModelInfo);
+    virtual ~QuadtreeNode();
 
-  void separateNode(int treeDepth);
-  void separateNode(float minLength);
+    void separateNode(int treeDepth);
+    void separateNode(float minLength);
 
-  void drawTree(int depth, int drawMode) const;
+    void drawTree(int depth, int drawMode) const;
 
 
- private:
-   Quadtree*                       quadtree;           //!< reference to the quadtree
-   Vector                          center;             //!< center coordinate of the quadtree node - relative coordinates in model space(!)
-   float                           axisLength;         //!< axis length of the quadtree
-   float                           maxHeigth;          //!< max height of the model in the quadtree
+  private:
+    Rectangle* getDimension(modelInfo* pModelInfo);
 
-   sTriangleExt*                   triangles;          //!< reference to the triangles of the node
-   unsigned int                    numTriangles;       //!< number of triangles of the Node
-   modelInfo*                      pModelInfo;         //!< reference to the modelInfo of the object
+  private:
+    Quadtree*                       quadtree;           //!< reference to the quadtree
+    Vector                          center;             //!< center coordinate of the quadtree node - relative coordinates in model space(!)
+    float                           axisLength;         //!< axis length of the quadtree
+    float                           maxHeigth;          //!< max height of the model in the quadtree
 
-   QuadtreeNode*                   nodeA;              //!< reference to the node A
-   QuadtreeNode*                   nodeB;              //!< reference to the node B
-   QuadtreeNode*                   nodeC;              //!< reference to the node C
-   QuadtreeNode*                   nodeD;              //!< reference to the node D
+    sTriangleExt*                   triangles;          //!< reference to the triangles of the node
+    unsigned int                    numTriangles;       //!< number of triangles of the Node
+    modelInfo*                      pModelInfo;         //!< reference to the modelInfo of the object
+
+    QuadtreeNode*                   nodeA;              //!< reference to the node A
+    QuadtreeNode*                   nodeB;              //!< reference to the node B
+    QuadtreeNode*                   nodeC;              //!< reference to the node C
+    QuadtreeNode*                   nodeD;              //!< reference to the node D
 
 };
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc	(revision 4844)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc	(revision 4845)
@@ -34,5 +34,5 @@
 {
    this->setClassID(CL_SPATIAL_SEPARATION, "SpatialSeparation");
-   this->getDimension(model);
+   this->createQuadtree(model);
 }
 
@@ -97,44 +97,6 @@
   this->quadtree->separate();
 
+
   return this->quadtree;
-}
-
-
-/**
-  \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.
- */
-Rectangle* SpatialSeparation::getDimension(AbstractModel* playerModel)
-{
-  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 < playerModel->getModelInfo()->numVertices; ++i)
-  {
-    pVertices = &playerModel->getModelInfo()->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);
-
-
-  PRINTF(0)("Dimension Informationation: X: min/max %f/%f Y: min/max %f/%f\n", minX, maxX, minY, maxY);
 }
 
Index: /orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.h
===================================================================
--- /orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.h	(revision 4844)
+++ /orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.h	(revision 4845)
@@ -16,29 +16,4 @@
 #define SEC_OFFSET 1.0                       //!< the offset added to the overlapSize to ensure that there are no problems in
 
-
-//! A class that represents a rectangle, this is needed for SpatialSeparation
-class Rectangle
-{
-
-  public:
-    Rectangle() {}
-    virtual ~Rectangle() {}
-
-    /** \brief sets the center of the rectangle to a defined vector @param center the new center */
-    inline void setCenter(const Vector &center) { this->center = center;}
-    /** \brief sets the center of the rectangle to a defined vector @param x coord of the center @param y coord of the center @param z coord of the center */
-    inline void setCenter(float x, float y, float z) { this->center.x = x; this->center.y = y; this->center.z = z; }
-    /** \brief returns the center of the rectangle to a defined vector @returns center the new center */
-    inline const Vector* getCenter() const { return &this->center; }
-
-    /** \brief sets both axis of the rectangle to a defined vector @param unityLength the new center */
-    inline void setAxis(float unityLength) { this->axis[0] = unityLength; this->axis[1] = unityLength; }
-               /** \brief sets both axis of the rectangle to a defined vector @param v1 the length of the x axis @param v2 the length of the z axis*/
-    inline void setAxis(float v1, float v2) { this->axis[0] = v1; this->axis[1] = v2; }
-
-  private:
-    Vector center;
-    float axis[2];
-};
 
 
@@ -61,5 +36,4 @@
   private:
     void separateZone();
-    Rectangle* getDimension(AbstractModel* playerModel);
 
 
Index: /orxonox/trunk/src/lib/math/vector.h
===================================================================
--- /orxonox/trunk/src/lib/math/vector.h	(revision 4844)
+++ /orxonox/trunk/src/lib/math/vector.h	(revision 4845)
@@ -238,3 +238,29 @@
 };
 
+
+
+//! A class that represents a rectangle, this is needed for SpatialSeparation
+class Rectangle
+{
+
+  public:
+    Rectangle() {}
+    virtual ~Rectangle() {}
+
+    /** \brief sets the center of the rectangle to a defined vector @param center the new center */
+   inline void setCenter(const Vector &center) { this->center = center;}
+    /** \brief sets the center of the rectangle to a defined vector @param x coord of the center @param y coord of the center @param z coord of the center */
+   inline void setCenter(float x, float y, float z) { this->center.x = x; this->center.y = y; this->center.z = z; }
+   /** \brief returns the center of the rectangle to a defined vector @returns center the new center */
+   inline const Vector* getCenter() const { return &this->center; }
+
+   /** \brief sets both axis of the rectangle to a defined vector @param unityLength the new center */
+   inline void setAxis(float unityLength) { this->axis[0] = unityLength; this->axis[1] = unityLength; }
+   /** \brief sets both axis of the rectangle to a defined vector @param v1 the length of the x axis @param v2 the length of the z axis*/
+   inline void setAxis(float v1, float v2) { this->axis[0] = v1; this->axis[1] = v2; }
+
+  private:
+    Vector center;
+    float axis[2];
+};
 #endif /* _VECTOR_H */
