Index: branches/cd/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- branches/cd/src/lib/collision_detection/obb_tree_node.cc	(revision 7587)
+++ branches/cd/src/lib/collision_detection/obb_tree_node.cc	(revision 7588)
@@ -289,61 +289,65 @@
   float               minLength[3];                          //!< minimal length of the axis
   const float*        tmpVec;                                //!< variable taking tmp vectors
+  float               centerOffset[3];
 
 
   /* get the maximal dimensions of the body in all directions */
   /* for the initialisation the value just has to be inside of the polygon soup -> first vertices (rand) */
-  tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[0]].indexToVertices[0]]);
-  maxLength[0] = p0.distancePoint(tmpVec);
-  minLength[0] = p0.distancePoint(tmpVec);
-  for( int j = 0; j < length; ++j)
-  {
-    for( int i = 0; i < 3; ++i)
-    {
-      tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
-      tmpLength = p0.distancePoint(tmpVec);
-      if( tmpLength > maxLength[0])
-        maxLength[0] = tmpLength;
-      else if( tmpLength < minLength[0])
-        minLength[0] = tmpLength;
-    }
-  }
-
-  /* for the initialisation the value just has to be inside of the polygon soup -> first vertices (rand) */
-  tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[0]].indexToVertices[0]]);
-  maxLength[1] = p1.distancePoint(tmpVec);
-  minLength[1] = p1.distancePoint(tmpVec);
-  for( int j = 0; j < length; ++j)
-  {
-    for( int i = 0; i < 3; ++i)
-    {
-      tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
-      tmpLength = p1.distancePoint(tmpVec);
-      if( tmpLength > maxLength[1])
-        maxLength[1] = tmpLength;
-      else if( tmpLength < minLength[1])
-        minLength[1] = tmpLength;
-    }
-  }
-
-  /* for the initialisation the value just has to be inside of the polygon soup -> first vertices (rand) */
-  tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[0]].indexToVertices[0]]);
-  maxLength[2] = p2.distancePoint(tmpVec);
-  minLength[2] = p2.distancePoint(tmpVec);
-  for( int j = 0; j < length; ++j)
-  {
-    for( int i = 0; i < 3; ++i)
-    {
-      tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
-      tmpLength = p2.distancePoint(tmpVec);
-      if( tmpLength > maxLength[2])
-        maxLength[2] = tmpLength;
-      else if( tmpLength < minLength[2])
-        minLength[2] = tmpLength;
-    }
-  }
+  for( int k = 0; k  < 3; k++)
+  {
+    tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[0]].indexToVertices[0]]);
+    maxLength[0] = p0.distancePoint(tmpVec);
+    minLength[0] = p0.distancePoint(tmpVec);
+    for( int j = 0; j < length; ++j)
+    {
+      for( int i = 0; i < 3; ++i)
+      {
+        tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
+        tmpLength = p0.distancePoint(tmpVec);
+        if( tmpLength > maxLength[0])
+          maxLength[0] = tmpLength;
+        else if( tmpLength < minLength[0])
+          minLength[0] = tmpLength;
+      }
+    }
+  }
+
+
+//   tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[0]].indexToVertices[0]]);
+//   maxLength[1] = p1.distancePoint(tmpVec);
+//   minLength[1] = p1.distancePoint(tmpVec);
+//   for( int j = 0; j < length; ++j)
+//   {
+//     for( int i = 0; i < 3; ++i)
+//     {
+//       tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
+//       tmpLength = p1.distancePoint(tmpVec);
+//       if( tmpLength > maxLength[1])
+//         maxLength[1] = tmpLength;
+//       else if( tmpLength < minLength[1])
+//         minLength[1] = tmpLength;
+//     }
+//   }
+//
+//
+//   tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[0]].indexToVertices[0]]);
+//   maxLength[2] = p2.distancePoint(tmpVec);
+//   minLength[2] = p2.distancePoint(tmpVec);
+//   for( int j = 0; j < length; ++j)
+//   {
+//     for( int i = 0; i < 3; ++i)
+//     {
+//       tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);
+//       tmpLength = p2.distancePoint(tmpVec);
+//       if( tmpLength > maxLength[2])
+//         maxLength[2] = tmpLength;
+//       else if( tmpLength < minLength[2])
+//         minLength[2] = tmpLength;
+//     }
+//   }
 
 
   /* calculate the real centre of the body by using the axis length */
-  float               centerOffset[3];
+
 
   for( int i = 0; i < 3; ++i)
