Index: branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5929)
+++ branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5932)
@@ -199,5 +199,5 @@
     }
   }
-  for(int i = 0; i < 3; ++i)
+  for( int i = 0; i < 3; ++i)
   {
     box.covarianceMatrix[i][0] = covariance[i][0];
@@ -216,27 +216,27 @@
 
   /* go thourgh all vertices, add only the used vertices indexes */
-  for( int i = 0; i < length; ++i)
-  {
-    for(int j = 0; j < 3; ++j)
-    {
-      vertIndex = modelInf.pTriangles[triangleIndexes[i]].indexToVertices[j];
-
-      vertexFound = false;
-      for( int i = 0; i < vertIndexVector.size(); i++)
-      {
-        if( vertIndexVector[i] == vertIndex)
-          vertexFound = true;
-      }
-      if( !vertexFound)
-        vertIndexVector.push_back(vertIndex);
-    }
-  }
-  /* now realy calculate the center */
-  for( int i = 0; i < vertIndexVector.size(); ++i)
-  {
-    tmpVec = (sVec3D*)(&modelInf.pVertices[vertIndexVector[i]]);
-    arithCenter += *tmpVec;
-  }
-  box.arithCenter = arithCenter / vertIndexVector.size();
+//   for( int i = 0; i < length; ++i)
+//   {
+//     for(int j = 0; j < 3; ++j)
+//     {
+//       vertIndex = modelInf.pTriangles[triangleIndexes[i]].indexToVertices[j];
+//
+//       vertexFound = false;
+//       for( int i = 0; i < vertIndexVector.size(); i++)
+//       {
+//         if( vertIndexVector[i] == vertIndex)
+//           vertexFound = true;
+//       }
+//       if( !vertexFound)
+//         vertIndexVector.push_back(vertIndex);
+//     }
+//   }
+//   /* now realy calculate the center */
+//   for( int i = 0; i < vertIndexVector.size(); ++i)
+//   {
+//     tmpVec = (sVec3D*)(&modelInf.pVertices[vertIndexVector[i]]);
+//     arithCenter += *tmpVec;
+//   }
+//   box.arithCenter = arithCenter / vertIndexVector.size();
 
 
@@ -254,5 +254,5 @@
   }
   PRINTF(3)("\nWeighteed OBB Center:\n\t\t%11.4f\t %11.4f\t %11.4f\n", center.x, center.y, center.z);
-  PRINTF(3)("\nArithmetical OBB Center:\n\t\t%11.4f\t %11.4f\t %11.4f\n", box.arithCenter.x, box.arithCenter.y, box.arithCenter.z);
+//   PRINTF(3)("\nArithmetical OBB Center:\n\t\t%11.4f\t %11.4f\t %11.4f\n", box.arithCenter.x, box.arithCenter.y, box.arithCenter.z);
 
   /* write back the covariance matrix data to the object oriented bouning box */
@@ -320,48 +320,4 @@
   const sVec3D*       tmpVec;                                //!< variable taking tmp vectors
 
-  /*
-  this step is split up in three: first there will be made a bounding box which is
-  very badly centered. In the section step there will be calculated a new center
-  and a better bounding box.
-  */
-
-  /* get a bad bounding box axis */
-//   halfLength[0] = -1.0f;
-//   for( int j = 0; j < length; ++j)
-//   {
-//     for( int i = 0; i < 3; ++i)
-//     {
-//       tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
-//       tmpLength = fabs(p0.distancePoint(*tmpVec));
-//       if( tmpLength > halfLength[0])
-//         halfLength[0] = tmpLength;
-//     }
-//   }
-//
-//   halfLength[1] = -1.0f;
-//   for( int j = 0; j < length; ++j)
-//   {
-//     for( int i = 0; i < 3; ++i)
-//     {
-//       tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
-//       tmpLength = fabs(p0.distancePoint(*tmpVec));
-//       if( tmpLength > halfLength[1])
-//         halfLength[1] = tmpLength;
-//     }
-//   }
-//
-//   halfLength[2] = -1.0f;
-//   for( int j = 0; j < length; ++j)
-//   {
-//     for( int i = 0; i < 3; ++i)
-//     {
-//       tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
-//       tmpLength = fabs(p0.distancePoint(*tmpVec));
-//       if( tmpLength > halfLength[2])
-//         halfLength[2] = tmpLength;
-//     }
-//   }
-
-
 
   /* get the maximal dimensions of the body in all directions */
@@ -420,13 +376,14 @@
   /* calculate the real centre of the body by using the axis length */
   float               centerOffset[3];
-  float               newHalfLength[3];
 
   for( int i = 0; i < 3; ++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
-    box.center +=  (box.axis[i] * centerOffset[i]);               // update the new center vector
-    halfLength[i] = newHalfLength[i];
-  }
+    box.halfLength[i] = (maxLength[i] - minLength[i]) / 2.0f;      // min length is negative
+  }
+  box.center.x += centerOffset[0];
+  box.center.y += centerOffset[1];
+  box.center.z += centerOffset[2];
+
   PRINTF(3)("\n");
   PRINT(3)("\tAxis Length x: %f (max: %11.2f, \tmin: %11.2f)\n", halfLength[0], maxLength[0], minLength[0]);
@@ -435,7 +392,7 @@
 
 
-  box.halfLength[0] = halfLength[0];
-  box.halfLength[1] = halfLength[1];
-  box.halfLength[2] = halfLength[2];
+//   box.halfLength[0] = halfLength[0];
+//   box.halfLength[1] = halfLength[1];
+//   box.halfLength[2] = halfLength[2];
 }
 
@@ -808,5 +765,5 @@
     }
 
-    if(this->nodeLeft == NULL || this->nodeRight == NULL)
+    if( this->nodeLeft == NULL || this->nodeRight == NULL)
       depth = 0;
     if( !(drawMode & DRAW_SINGLE && depth != 0))
