Index: orxonox/trunk/src/lib/collision_detection/cd_engine.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/cd_engine.cc	(revision 4709)
+++ orxonox/trunk/src/lib/collision_detection/cd_engine.cc	(revision 4710)
@@ -130,2 +130,8 @@
   this->rootTree->spawnBVTree(depth, vertices, numVertices);
 }
+
+void CDEngine::debugDraw(int depth, int drawMode)
+{
+  if(this-> rootTree != NULL)
+    this->rootTree->drawBV(depth, drawMode);
+}
Index: orxonox/trunk/src/lib/collision_detection/cd_engine.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/cd_engine.h	(revision 4709)
+++ orxonox/trunk/src/lib/collision_detection/cd_engine.h	(revision 4710)
@@ -52,4 +52,5 @@
   void debug();
   void debugSpawnTree(int depth, sVec3D* vertices, int numVertices);
+  void debugDraw(int depth, int drawMode);
 
  private:
Index: orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4709)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4710)
@@ -114,5 +114,5 @@
 
 
-    if(this->tmpLen1 > 0)
+    if(this->tmpLen1 > 2)
     {
       OBBTreeNode* node1 = new OBBTreeNode();
@@ -125,5 +125,5 @@
     }
 
-    if( this->tmpLen2 > 0)
+    if( this->tmpLen2 > 2)
     {
       OBBTreeNode* node2 = new OBBTreeNode();
@@ -133,5 +133,5 @@
     else
     {
-      PRINTF(0)("Aboarding tree walk: less than 3 vertices left\n");
+      PRINTF(0)("Abording tree walk: less than 3 vertices left\n");
     }
 
@@ -420,6 +420,6 @@
 
   /* get the maximal dimensions of the body in all directions */
-   maxLength[0] = 0.0f;
-   minLength[0] = 0.0f;
+    maxLength[0] = p0.distancePoint(vertices[0]);
+    minLength[0] = p0.distancePoint(vertices[0]);
    for(int j = 0; j < length; ++j)
    {
@@ -431,6 +431,6 @@
    }
 
-   maxLength[1] = 0.0f;
-   minLength[1] = 0.0f;
+   maxLength[1] = p1.distancePoint(vertices[0]);
+   minLength[1] = p1.distancePoint(vertices[0]);
    for(int j = 0; j < length; ++j)
    {
@@ -442,6 +442,6 @@
    }
 
-   maxLength[2] = 0.0f;
-   minLength[2] = 0.0f;
+   maxLength[2] = p2.distancePoint(vertices[0]);
+   minLength[2] = p2.distancePoint(vertices[0]);
    for(int j = 0; j < length; ++j)
    {
@@ -460,6 +460,6 @@
      {
        PRINTF(3)("max: %f, min: %f \n", maxLength[i], minLength[i]);
-       centerOffset[i] = (maxLength[i] + minLength[i]) / 2.0f; // min length is negatie
-       newHalfLength[i] = (maxLength[i] - minLength[i]) / 2.0f; // min length is negative
+       centerOffset[i] = (maxLength[i] + minLength[i]) / 2.0f;       // min length is negatie
+       newHalfLength[i] = (maxLength[i] - minLength[i]) / 2.0f;      // min length is negative
        *box->center +=  (box->axis[i] * centerOffset[i]);            // update the new center vector
        halfLength[i] = newHalfLength[i];
@@ -478,5 +478,14 @@
   {
     //if( box->halfLength[i] == 0.0)
-    PRINTF(3)("length[%i] = %f\n", i, box->halfLength[i]);
+    if(fabs(box->halfLength[i]) > 5.0f)
+    {
+      PRINTF(0)("length[%i] = %f\n", i, box->halfLength[i]);
+      PRINTF(0)("MaxLength = %f, MinLength = %f\n", maxLength[i], minLength[i]);
+      PRINTF(0)("\nVertex Data:\n");
+      for(int i = 0; i < length; i++)
+      {
+        PRINTF(0)("vertex %i: %f, %f, %f\n", i, box->vertices[i][0], box->vertices[i][1], box->vertices[i][2]);
+      }
+    }
   }
 }
@@ -525,5 +534,5 @@
   }
 
-//   PRINTF(3)("\nthe clostest vertex is nr: %i, with a dist of: %f\n", vertexIndex ,dist);
+  PRINTF(3)("\nthe clostest vertex is nr: %i, with a dist of: %f\n", vertexIndex ,dist);
 
 
@@ -534,4 +543,5 @@
   tList<sVec3D>      partition2;                           //!< the vertex partition 2
 
+
   PRINTF(3)("vertex index: %i, of %i\n", vertexIndex, box->numOfVertices);
   this->separationPlane = new Plane(box->axis[axisIndex], box->vertices[vertexIndex]);  //!< separation plane
@@ -541,12 +551,15 @@
   for(int i = 0; i < box->numOfVertices; ++i)
   {
-    if( this->separationPlane->distancePoint(box->vertices[i]) > 0.0f)
-      partition1.add(&box->vertices[i]);
+    if( i == vertexIndex) continue;
+    tmpDist = this->separationPlane->distancePoint(box->vertices[i]);
+    if( tmpDist > 0.0)
+      partition1.add(&box->vertices[i]); /* positive numbers plus zero */
     else
-      partition2.add(&box->vertices[i]);
+      partition2.add(&box->vertices[i]); /* negatice numbers */
   }
   partition1.add(&box->vertices[vertexIndex]);
-
-//   PRINTF(3)("\npartition1: got %i vertices/ partition 2: got %i vertices\n", partition1.getSize(), partition2.getSize());
+  partition2.add(&box->vertices[vertexIndex]);
+
+  PRINTF(3)("\npartition1: got %i vertices/ partition 2: got %i vertices\n", partition1.getSize(), partition2.getSize());
 
 
@@ -827,4 +840,6 @@
   if( drawMode & DRAW_BV_POLYGON || drawMode & DRAW_ALL || drawMode & DRAW_BV_BLENDED)
   {
+    if(this->nodeLeft == NULL && this->nodeRight == NULL)
+      depth = 0;
     if( !(drawMode & DRAW_SINGLE && depth != 0))
     {
