Index: orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 4922)
+++ orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 4923)
@@ -17,4 +17,5 @@
 
 #include "quadtree.h"
+
 #include "quadtree_node.h"
 #include "material.h"
Index: orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 4922)
+++ orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 4923)
@@ -17,4 +17,5 @@
 
 #include "quadtree_node.h"
+
 #include "quadtree.h"
 #include "material.h"
@@ -94,5 +95,5 @@
 
 /**
- * takes the rest of the initialisation process
+ *  takes the rest of the initialisation process
  */
 void QuadtreeNode::init()
@@ -136,5 +137,10 @@
 
 /**
-
+  \brief this functions builds up a hash table containing all leafs of the Quadtree in a sorted array
+  \param nodeList the nodelist array to add them
+  \param index the current index in the array
+
+  The algorithm used for this purpose is home-brown. its not to fast but and the nodes are not always in the right
+  order. this is why there will be needed a quicksort later on.
  */
 void QuadtreeNode::buildHashTable(QuadtreeNode** nodeList, int* index)
@@ -160,5 +166,5 @@
  *  gives the signal to separate the model into a quadtree
  * @param treeDepth the max depth, the steps to go if treeDept == 0 leaf reached
-*/
+ */
 void QuadtreeNode::separateNode(float minLength)
 {
@@ -361,4 +367,9 @@
 
 
+ /**
+  * checks if a point is included in this quadtree
+  * @param v the vector to be checked
+  * @returns true if the vector is included
+  */
 bool QuadtreeNode::includesPoint(const Vector& v)
 {
@@ -377,5 +388,5 @@
 
 /**
- *  draws the debug quadtree boxes around the model
+ *  draws all the debug quadtree squares
  */
 void QuadtreeNode::drawTree() const
@@ -408,4 +419,7 @@
 
 
+/**
+ *  draws only this quadtree square
+ */
 void QuadtreeNode::draw() const
 {
Index: orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
===================================================================
--- orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4922)
+++ orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h	(revision 4923)
@@ -1,6 +1,13 @@
 /*!
-    \file proto_class.h
- *  Definition of ...
+ *  \file proto_class.h
+ *  Definition of a QuadtreeNode which represents a quad in a Quadtree
 
+  This struct is used to partition big land scapes into smaller ones for different reasons:
+    - for collision detection: only a subset of all triangles need to be tested vs a given body
+    - for object culling purposes: the quadtrees that are not in the field of view can be ommitted in the draw process
+    - for LOD (level of Detail). The models can be drawn using different LODs depending on the distance
+
+  This struct includes all the triangles, vertices, normal informations needed to make something usefull with
+  a terrain partition.
  */
 
@@ -23,14 +30,13 @@
                  const float* pVertices, int numVertices,
                  Quadtree* quadtree, QuadtreeNode* parent,
-                 Rectangle* rect, int treeDepth, const int maxDepth, int index);
+                 Rectangle* rect, int treeDepth, const int maxDepth, int index
+                );
     QuadtreeNode(modelInfo* pModelInfo, Quadtree* quadtree, const int maxDepth);
     virtual ~QuadtreeNode();
 
     void buildHashTable(QuadtreeNode** nodeList, int* index);
-
+    bool includesPoint(const Vector& v);
     float getHeight(const Vector& position);
-    Rectangle* getDimension() { return this->pDimension; }
-
-    bool includesPoint(const Vector& v);
+    inline Rectangle* getDimension() { return this->pDimension; }
 
     void drawTree() const;
@@ -43,6 +49,6 @@
     void separateNode(float minLength);
     void separateNode();
+    Rectangle* getDimFromModel();
 
-    Rectangle* getDimFromModel();
 
   protected:
@@ -53,5 +59,5 @@
     QuadtreeNode*                   nodeD;              //!< reference to the node D
     QuadtreeNode**                  nodes;              //!< reference to the quadtree nodes
-    int                             nodeIter;           //!< temp helping variable for the hashing algorithm
+
 
   private:
@@ -65,4 +71,5 @@
     int                             maxDepth;           //!< the maximal depth of the tree
     int                             indexNode;          //!< the index number of the node
+    int                             nodeIter;           //!< temp helping variable for the hashing algorithm
 
     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 4922)
+++ orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc	(revision 4923)
@@ -9,5 +9,5 @@
    any later version.
 
-   ### File Specific:
+### File Specific:
    main-programmer: Patrick Boenzli
    co-programmer: ...
@@ -30,15 +30,15 @@
    The boxes are overlaping because this makes collision detection a lot simpler
 
-*/
+ */
 SpatialSeparation::SpatialSeparation (AbstractModel* model, float overlapSize)
 {
-  PRINT(3)("\n");
   PRINT(3)("+---------Debug Information SpatialSeparation----------\n");
   PRINT(3)("+-| (Event) Spatial Separation process kicked on\n");
 
-   this->setClassID(CL_SPATIAL_SEPARATION, "SpatialSeparation");
-   /* debug vice */
-   this->createQuadtree(model);
+  this->setClassID(CL_SPATIAL_SEPARATION, "SpatialSeparation");
+  /* debug vice */
+  this->createQuadtree(model);
 }
+
 
 /**
@@ -48,5 +48,4 @@
 
    The boxes are overlaping because this makes collision detection a lot simpler
-
  */
 SpatialSeparation::SpatialSeparation (AbstractModel* model, AbstractModel* playerModel)
@@ -59,6 +58,5 @@
 /**
  *  standard deconstructor
-
-*/
+ */
 SpatialSeparation::~SpatialSeparation ()
 {
@@ -67,8 +65,8 @@
 
 /**
-  \brief creates a quadtree
-* @param model the model to do a quadtree on
-* @param minLength the minimal length of a quadtree node
-  \return the new quadtree
+ *  creates a quadtree
+ * @param model the model to do a quadtree on
+ * @param minLength the minimal length of a quadtree node
+ * @return the new quadtree
  */
 Quadtree* SpatialSeparation::createQuadtree(AbstractModel* model, float minLength)
@@ -80,8 +78,8 @@
 
 /**
-  \brief creates a quadtree
-* @param model the model to do a quadtree on
-* @param minLength the minimal length of a quadtree node
-  \return the new quadtree
+ *  brief creates a quadtree
+ * @param model the model to do a quadtree on
+ * @param minLength the minimal length of a quadtree node
+ * @return the new quadtree
  */
 Quadtree* SpatialSeparation::createQuadtree(AbstractModel* model, int treeDepth)
@@ -92,9 +90,9 @@
 
 /**
-  \brief creates a quadtree
-* @param model the model to do a quadtree on
-* @param minLength the minimal length of a quadtree node
-  \return the new quadtree
-*/
+ *  creates a quadtree
+ * @param model the model to do a quadtree on
+ * @param minLength the minimal length of a quadtree node
+ * @return the new quadtree
+ */
 Quadtree* SpatialSeparation::createQuadtree(AbstractModel* model)
 {
@@ -105,5 +103,7 @@
 
 
-
+/**
+ *  draws all the quadtrees
+ */
 void SpatialSeparation::drawQuadtree()
 {
