Index: /branches/collision_detection/src/lib/collision_detection/bounding_volume.cc
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/bounding_volume.cc	(revision 5705)
+++ /branches/collision_detection/src/lib/collision_detection/bounding_volume.cc	(revision 5706)
@@ -17,5 +17,4 @@
 
 #include "bounding_volume.h"
-#include "vector.h"
 
 using namespace std;
@@ -27,7 +26,6 @@
 BoundingVolume::BoundingVolume ()
 {
-   this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume");
-   this->center = new Vector();
-   this->vertices = NULL;
+  this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume");
+  this->vertices = NULL;
 }
 
@@ -39,7 +37,4 @@
 BoundingVolume::~BoundingVolume ()
 {
-  // delete what has to be deleted here
-  delete this->center;
-  
   if( this->triangleIndexes)
     delete[] this->triangleIndexes;
Index: /branches/collision_detection/src/lib/collision_detection/bounding_volume.h
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/bounding_volume.h	(revision 5705)
+++ /branches/collision_detection/src/lib/collision_detection/bounding_volume.h	(revision 5706)
@@ -11,5 +11,5 @@
 #include "abstract_model.h"
 
-class Vector;
+
 template<class T> class tList;
 
@@ -22,5 +22,5 @@
     virtual ~BoundingVolume();
 
-    inline const Vector* getCenter() const { return this->center; }
+    inline const Vector& getCenter() const { return this->center; }
 
     const sVec3D* getVertices() const { return this->vertices; }
@@ -32,5 +32,5 @@
 
   public:
-    Vector*             center;                     //!< Center point of box
+    Vector              center;                     //!< Center point of box
 
     const sVec3D*       vertices;                   //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
Index: /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5705)
+++ /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5706)
@@ -232,171 +232,57 @@
   Vector    t1, t2;                                  //!< temporary values
   float     covariance[3][3] = {0,0,0, 0,0,0, 0,0,0};//!< the covariance matrix
-  int       mode = 0;                                //!< mode = 0: vertex soup, no connections, mode = 1: 3 following verteces build a triangle
-
-  this->numOfVertices = length;
-  this->vertices = verticesList;
-
-
-  if( likely(mode == 0))
-  {
-    /* fist compute all the convex hull face/facelets and centroids */
-    for( int i = 0; i+3 < length ; i+=3)          /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/
-    {
-      p = verticesList[i];
-      q = verticesList[i + 1];
-      r = verticesList[i + 2];
-
-      t1 = p - q; t2 = p - r;
-
-      /* finding the facelet surface via cross-product */
-      facelet[i] = 0.5f * fabs( t1.cross(t2).len() );
-      /* update the entire convex hull surface */
-      face += facelet[i];
-
-      /* calculate the cetroid of the hull triangles */
-      centroid[i] = (p + q + r) * 1/3;
-      /* now calculate the centroid of the entire convex hull, weighted average of triangle centroids */
-      center += centroid[i] * facelet[i];
-    }
-    /* take the average of the centroid sum */
-    center /= face;
-    PRINTF(3)("-- Calculated Center\n");
-
-
-    /* now calculate the covariance matrix - if not written in three for-loops, it would compute faster: minor */
-    for( int j = 0; j < 3; ++j)
-    {
-      for( int k = 0; k < 3; ++k)
+
+
+ 
+  /* fist compute all the convex hull face/facelets and centroids */
+  for( int i = 0; i+3 < length ; i+=3)          /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/
+  {
+    p = verticesList[i];
+    q = verticesList[i + 1];
+    r = verticesList[i + 2];
+
+    t1 = p - q; t2 = p - r;
+
+    /* finding the facelet surface via cross-product */
+    facelet[i] = 0.5f * fabs( t1.cross(t2).len() );
+    /* update the entire convex hull surface */
+    face += facelet[i];
+
+    /* calculate the cetroid of the hull triangles */
+    centroid[i] = (p + q + r) * 1/3;
+    /* now calculate the centroid of the entire convex hull, weighted average of triangle centroids */
+    center += centroid[i] * facelet[i];
+  }
+  /* take the average of the centroid sum */
+  center /= face;
+  PRINTF(3)("-- Calculated Center\n");
+
+
+  /* now calculate the covariance matrix - if not written in three for-loops, 
+     it would compute faster: minor */
+  for( int j = 0; j < 3; ++j)
+  {
+    for( int k = 0; k < 3; ++k)
+    {
+      for( int i = 0; i + 3 < length; i+=3)
       {
-        for( int i = 0; i + 3 < length; i+=3)
-        {
-          p = verticesList[i];
-          q = verticesList[i + 1];
-          r = verticesList[i + 2];
-
-          covariance[j][k] = facelet[i] / (12.0f * face) * (9.0f * centroid[i][j] * centroid[i][k] + p[j] * p[k] +
-              q[j] * q[k] + r[j] * r[k]) - center[j] * center[k];
-        }
+        p = verticesList[i];
+        q = verticesList[i + 1];
+        r = verticesList[i + 2];
+
+        covariance[j][k] = facelet[i] / (12.0f * face) * (9.0f * centroid[i][j] * centroid[i][k] + p[j] * p[k] +
+            q[j] * q[k] + r[j] * r[k]) - center[j] * center[k];
       }
     }
-    PRINTF(3)("-- Calculated Covariance\n");
-  }
-  else if( mode == 1)
-  {
-    for( int i = 0; i + 3 < length; i+=3)          /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/
-    {
-      p = verticesList[i];
-      q = verticesList[i + 1];
-      r = verticesList[i + 2];
-
-      centroid[i] = (p + q + r) / 3.0f;
-      center += centroid[i];
-    }
-    center /= length;
-
-    for( int j = 0; j < 3; ++j)
-    {
-      for( int k = 0; k < 3; ++k)
-      {
-        for( int i = 0; i + 3 < length; i+=3)
-        {
-          p = verticesList[i];
-          q = verticesList[i +1];
-          r = verticesList[i + 2];
-
-          covariance[j][k] = p[j] * p[k] + q[j] * q[k] + r[j] + r[k];
-        }
-        covariance[j][k] /= (3.0f * length);
-      }
-    }
-    PRINTF(3)("-- Calculated Covariance\n");
-  }
-  else if( mode == 2)
-  {
-    /* fist compute all the convex hull face/facelets and centroids */
-    for(int i = 0; i + 3 < length; i+=3)          /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/
-    {
-      p = verticesList[i];
-      q = verticesList[i + 1];
-      r = verticesList[i + 2];
-
-      t1 = p - q; t2 = p - r;
-
-      /* finding the facelet surface via cross-product */
-      facelet[i] = 0.5f * fabs( t1.cross(t2).len() );
-      /* update the entire convex hull surface */
-      face += facelet[i];
-
-      /* calculate the cetroid of the hull triangles */
-      centroid[i] = (p + q + r) * 1/3;
-      /* now calculate the centroid of the entire convex hull, weighted average of triangle centroids */
-      center += centroid[i] * facelet[i];
-    }
-    /* take the average of the centroid sum */
-    center /= face;
-    PRINTF(3)("-- Calculated Center\n");
-
-    for( int j = 0; j < 3; ++j)
-    {
-      for( int k = 0; k < 3; ++k)
-      {
-        for( int i = 0; i + 3 < length; i+=3)
-        {
-          p = verticesList[i];
-          q = verticesList[i +1];
-          r = verticesList[i + 2];
-
-          covariance[j][k] = p[j] * p[k] + q[j] * q[k] + r[j] + r[k];
-        }
-        covariance[j][k] /= (3.0f * length);
-      }
-    }
-    PRINTF(3)("-- Calculated Covariance\n");
-  }
-  else
-  {
-    for( int i = 0; i < length; ++i)          /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/
-    {
-      center += verticesList[i];
-    }
-    center /= length;
-
-    for( int j = 0; j < 3; ++j)
-    {
-      for( int k = 0; k < 3; ++k)
-      {
-        for( int i = 0; i + 3 < length; i+=3)
-        {
-          p = verticesList[i];
-          q = verticesList[i +1];
-          r = verticesList[i + 2];
-
-          covariance[j][k] = p[j] * p[k] + q[j] * q[k] + r[j] + r[k];
-        }
-        covariance[j][k] /= (3.0f * length);
-      }
-    }
-    PRINTF(3)("-- Calculated Covariance\n");
-  }
-
+  }
+  PRINTF(3)("-- Calculated Covariance\n");
+
+    
   PRINTF(3)("\nVertex Data:\n");
   for(int i = 0; i < length; i++)
-  {
-    PRINTF(3)("vertex %i: %f, %f, %f\n", i, box->vertices[i][0], box->vertices[i][1], box->vertices[i][2]);
-  }
-
-
-  PRINTF(3)("\nCovariance Matrix:\n");
-  for(int j = 0; j < 3; ++j)
-  {
-    PRINT(3)(" |");
-    for(int k = 0; k < 3; ++k)
-    {
-      PRINT(3)(" \b%f ", covariance[j][k]);
-    }
-    PRINT(3)(" |\n");
-  }
-
-  PRINTF(3)("center: %f, %f, %f\n", center.x, center.y, center.z);
+    PRINTF(3)(" Vertex[%i]: %f, %f, %f\n", i, box->vertices[i][0], box->vertices[i][1], box->vertices[i][2]);
+  PRINTF(3)("\nOBB Covariance Matrix:\n");
+  for(int j = 0; j < 3; ++j) { PRINT(3)(" |"); for(int k = 0; k < 3; ++k) { PRINT(3)(" \b%f ", covariance[j][k]); } PRINT(3)(" |\n"); }
+  PRINTF(3)("OBB Center: %f, %f, %f\n", center.x, center.y, center.z);
 
 
@@ -407,6 +293,7 @@
     box->covarianceMatrix[i][2] = covariance[i][2];
   }
-  *box->center = center;
-  PRINTF(3)("-- Written Result to obb\n");
+  box->center = center;
+  
+  PRINTF(3)("-- Written Result to OBB\n");
 }
 
@@ -479,7 +366,7 @@
   float               halfLength[3];                         //!< half length of the axis
   float               tmpLength;                             //!< tmp save point for the length
-  Plane               p0(box->axis[0], *box->center);        //!< the axis planes
-  Plane               p1(box->axis[1], *box->center);
-  Plane               p2(box->axis[2], *box->center);
+  Plane               p0(box->axis[0], box->center);        //!< the axis planes
+  Plane               p1(box->axis[1], box->center);
+  Plane               p2(box->axis[2], box->center);
   float               maxLength[3];
   float               minLength[3];
@@ -556,5 +443,5 @@
        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
+       box->center +=  (box->axis[i] * centerOffset[i]);            // update the new center vector
        halfLength[i] = newHalfLength[i];
      }
@@ -599,5 +486,5 @@
   float               tmpDist;                             //!< temporary distance
   int                 vertexIndex;
-  Plane               middlePlane(box->axis[axisIndex], *box->center); //!< the middle plane
+  Plane               middlePlane(box->axis[axisIndex], box->center); //!< the middle plane
 
   vertexIndex = 0;
@@ -738,7 +625,7 @@
     if( unlikely(this->nodeRight == NULL && this->nodeLeft == NULL))
     {
-      nodeA->collidesWith(nodeB, *((OBBTreeNode*)treeNode)->bvElement->center);
-
-      nodeB->collidesWith(nodeA, *this->bvElement->center);
+      nodeA->collidesWith(nodeB, ((OBBTreeNode*)treeNode)->bvElement->center);
+
+      nodeB->collidesWith(nodeA, this->bvElement->center);
     }
 
@@ -766,5 +653,6 @@
   rotAxisB[2] =  nodeB->getAbsDir().apply(boxB->axis[2]);
 
-  t = nodeA->getAbsCoor() + nodeA->getAbsDir().apply(*boxA->center) - ( nodeB->getAbsCoor() + nodeB->getAbsDir().apply(*boxB->center));
+
+  t = nodeA->getAbsCoor() + nodeA->getAbsDir().apply(boxA->center) - ( nodeB->getAbsCoor() + nodeB->getAbsDir().apply(boxB->center));
 
 //   printf("\n");
@@ -928,18 +816,18 @@
       glBegin(GL_LINES);
       glColor3f(0.0, 0.4, 0.3);
-      glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
-      glVertex3f(this->bvElement->center->x + this->bvElement->axis[0].x * this->bvElement->halfLength[0],
-                 this->bvElement->center->y + this->bvElement->axis[0].y * this->bvElement->halfLength[0],
-                 this->bvElement->center->z + this->bvElement->axis[0].z * this->bvElement->halfLength[0]);
-
-      glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
-      glVertex3f(this->bvElement->center->x + this->bvElement->axis[1].x * this->bvElement->halfLength[1],
-                 this->bvElement->center->y + this->bvElement->axis[1].y * this->bvElement->halfLength[1],
-                 this->bvElement->center->z + this->bvElement->axis[1].z * this->bvElement->halfLength[1]);
-
-      glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
-      glVertex3f(this->bvElement->center->x + this->bvElement->axis[2].x * this->bvElement->halfLength[2],
-                 this->bvElement->center->y + this->bvElement->axis[2].y * this->bvElement->halfLength[2],
-                 this->bvElement->center->z + this->bvElement->axis[2].z * this->bvElement->halfLength[2]);
+      glVertex3f(this->bvElement->center.x, this->bvElement->center.y, this->bvElement->center.z);
+      glVertex3f(this->bvElement->center.x + this->bvElement->axis[0].x * this->bvElement->halfLength[0],
+                 this->bvElement->center.y + this->bvElement->axis[0].y * this->bvElement->halfLength[0],
+                 this->bvElement->center.z + this->bvElement->axis[0].z * this->bvElement->halfLength[0]);
+
+      glVertex3f(this->bvElement->center.x, this->bvElement->center.y, this->bvElement->center.z);
+      glVertex3f(this->bvElement->center.x + this->bvElement->axis[1].x * this->bvElement->halfLength[1],
+                 this->bvElement->center.y + this->bvElement->axis[1].y * this->bvElement->halfLength[1],
+                 this->bvElement->center.z + this->bvElement->axis[1].z * this->bvElement->halfLength[1]);
+
+      glVertex3f(this->bvElement->center.x, this->bvElement->center.y, this->bvElement->center.z);
+      glVertex3f(this->bvElement->center.x + this->bvElement->axis[2].x * this->bvElement->halfLength[2],
+                 this->bvElement->center.y + this->bvElement->axis[2].y * this->bvElement->halfLength[2],
+                 this->bvElement->center.z + this->bvElement->axis[2].z * this->bvElement->halfLength[2]);
       glEnd();
     }
@@ -960,5 +848,5 @@
     if( !(drawMode & DRAW_SINGLE && depth != 0))
     {
-    Vector cen = *this->bvElement->center;
+    Vector cen = this->bvElement->center;
     Vector* axis = this->bvElement->axis;
     float* len = this->bvElement->halfLength;
@@ -1098,5 +986,5 @@
     Vector a1 = this->bvElement->axis[(this->longestAxisIndex + 1)%3];
     Vector a2 = this->bvElement->axis[(this->longestAxisIndex + 2)%3];
-    Vector c = *this->bvElement->center;
+    Vector c = this->bvElement->center;
     float l1 = this->bvElement->halfLength[(this->longestAxisIndex + 1)%3];
     float l2 = this->bvElement->halfLength[(this->longestAxisIndex + 2)%3];
