Index: orxonox/trunk/src/lib/collision_detection/bounding_volume.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/bounding_volume.h	(revision 4587)
+++ orxonox/trunk/src/lib/collision_detection/bounding_volume.h	(revision 4588)
@@ -1,3 +1,3 @@
-/*! 
+/*!
     \file bounding_volume.h
     \brief Definition of a bounding volume for collision detection algorithms
@@ -9,6 +9,6 @@
 
 #include "base_object.h"
+#include "abstract_model.h"
 
-class sVect3D;
 class Vector;
 template<class T> class tList;
@@ -24,5 +24,5 @@
   inline const Vector* getCenter() const { return this->center; }
 
-  virtual sVect3D* getVertices() const = NULL;
+  sVec3D* getVertices() const { return this->vertices; }
   virtual void mergeWith(const BoundingVolume &bv) = NULL;
 
@@ -35,5 +35,5 @@
   Vector*             center;                     //!< Center point of box
 
-  sVect3D*            vertices;                   //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
+  sVec3D*             vertices;                   //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
   int                 numOfVertices;              //!< number of vertices in the vertices buffer
 };
Index: orxonox/trunk/src/lib/collision_detection/obb.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb.h	(revision 4587)
+++ orxonox/trunk/src/lib/collision_detection/obb.h	(revision 4588)
@@ -24,5 +24,4 @@
   inline const float* getHalfLength() const { return this->halfLength; }
 
-  virtual sVect3D* getVertices() const { return this->vertices; }
   virtual void mergeWith(const BoundingVolume &bv);
 
Index: orxonox/trunk/src/lib/collision_detection/obb_tree.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree.cc	(revision 4587)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree.cc	(revision 4588)
@@ -97,7 +97,7 @@
   /* generate some test vertices */
   sVec3D* vertList = new sVec3D[4];
-  sVec3D data[]  = {{0.0, 0.0, 0.0},{10.0, -5.0, 5.0},{10.0, 5.0, 0.0}, {5.0, 4.0, 1.0}};
+  sVec3D data[]  = {{0.0, 0.0, 0.0},{2.0, -8.0, 5.0},{10.0, 5.0, 0.0}, {5.0, 4.0, 1.0}};
 
-  for(int i = 0; i < 3; ++i)
+  for(int i = 0; i < 4; ++i)
     {
       vertList[i][0] = data[i][0];
Index: orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4587)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4588)
@@ -1,3 +1,3 @@
-/* 
+/*
    orxonox - the future of 3D-vertical-scrollers
 
@@ -44,7 +44,7 @@
    \brief standard constructor
 */
-OBBTreeNode::OBBTreeNode () 
-{
-   this->setClassID(CL_OBB_TREE_NODE, "OBBTreeNode"); 
+OBBTreeNode::OBBTreeNode ()
+{
+   this->setClassID(CL_OBB_TREE_NODE, "OBBTreeNode");
 
 }
@@ -55,5 +55,5 @@
 
 */
-OBBTreeNode::~OBBTreeNode () 
+OBBTreeNode::~OBBTreeNode ()
 {
   // delete what has to be deleted here
@@ -85,12 +85,14 @@
   float     facelet[length];                         //!< surface area of the i'th triangle of the convex hull
   float     face;                                    //!< surface area of the entire convex hull
-  Vector    centroid[length];                        //!< centroid of the i'th convex hull  
+  Vector    centroid[length];                        //!< centroid of the i'th convex hull
   Vector    center;                                  //!< the center of the entire hull
   Vector    p, q, r;                                 //!< holder of the polygon data, much more conveniant to work with Vector than sVec3d
   Vector    t1, t2;                                  //!< temporary values
   float     covariance[3][3];                        //!< the covariance matrix
-    
+
   this->numOfVertices = length;
   this->vertices = verticesList;
+  box->vertices = verticesList;
+  box->numOfVertices = length;
 
 
@@ -101,7 +103,7 @@
       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() );
@@ -118,20 +120,20 @@
 
 
-  
+
   /* 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 < 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];
-	    }
-	}
+        {
+          for(int i = 0; i < 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];
+            }
+        }
     }
 
@@ -141,5 +143,5 @@
       printf("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]);
     }
-  
+
   printf("\nCovariance Matrix:\n");
   for(int j = 0; j < 3; ++j)
@@ -147,15 +149,15 @@
       printf(" |");
       for(int k = 0; k < 3; ++k)
-	{
-	  printf(" \b%f ", covariance[j][k]);
- 	}
+        {
+          printf(" \b%f ", covariance[j][k]);
+        }
       printf(" |\n");
     }
   printf("center: %f, %f, %f\n\n", center.x, center.y, center.z);
 
-   
+
   for(int i = 0; i < 3; ++i)
     {
-    
+
       box->covarianceMatrix[i][0] = covariance[i][0];
       box->covarianceMatrix[i][1] = covariance[i][1];
@@ -168,18 +170,18 @@
      the eigenvectors of a symmertric matrix, such as the
      covarience matrix are mutually orthogonal.
-     after normalizing them, they can be used as a the basis 
+     after normalizing them, they can be used as a the basis
      vectors
   */
   Matrix                V(3,3);                               //!< for eigenvectors
-  DiagonalMatrix        D(3);                                 //!< for eigenvalues    
+  DiagonalMatrix        D(3);                                 //!< for eigenvalues
   SymmetricMatrix       C(3);                                 //!< for the covariance symmetrical matrix
   Vector**              axis = new Vector*[3];                //!< the references to the obb axis
-  
+
   C(1,1) = covariance[0][0];
   C(1,2) = covariance[0][1];
   C(1,3) = covariance[0][2];
-  C(2,1) = covariance[1][0];    
+  C(2,1) = covariance[1][0];
   C(2,2) = covariance[1][1];
-  C(2,3) = covariance[1][2]; 
+  C(2,3) = covariance[1][2];
   C(3,1) = covariance[2][0];
   C(3,2) = covariance[2][1];
@@ -204,15 +206,15 @@
   axis[2] = new Vector(V(1, 3), V(2, 3), V(3, 3));
   box->axis = axis;
-  
+
   printf("eigenvector: %f, %f, %f\n", box->axis[0]->x, box->axis[0]->y, box->axis[0]->z);
   printf("eigenvector: %f, %f, %f\n", box->axis[1]->x, box->axis[1]->y, box->axis[1]->z);
   printf("eigenvector: %f, %f, %f\n", box->axis[2]->x, box->axis[2]->y, box->axis[2]->z);
 
-  
+
   /* now get the axis length */
   Line                ax[3];                                 //!< the axis
   float*              halfLength = new float[3];             //!< half length of the axis
   float               tmpLength;                             //!< tmp save point for the length
-  
+
   ax[0].r = *box->center; ax[0].a = *box->axis[0];
   ax[1].r = *box->center; ax[1].a = *box->axis[1];
@@ -222,5 +224,5 @@
   Plane p1(*box->axis[1], *box->center);
   Plane p2(*box->axis[2], *box->center);
-  
+
 
 
@@ -252,6 +254,6 @@
   box->halfLength = halfLength;
 
-  
-  
+
+
   printf("we got length: \n");
   for(int i = 0; i < 3; ++i)
@@ -268,12 +270,12 @@
     {
       if( aLength < box->axis[i]->len())
-	{
-	  aLength = box->axis[i]->len();
-	  axisNr = i;
-	}
-    }
-  
+        {
+          aLength = box->axis[i]->len();
+          axisNr = i;
+        }
+    }
+
   /* get the closest vertex near the center */
-  
+
 }
 
@@ -287,7 +289,7 @@
   glBegin(GL_LINE_LOOP);
   glColor3f(1.0, 1.0, 1.0);
-  for(int i = 0; i < this->numOfVertices; ++i)
-    {
-      glVertex3f(this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]);
+  for(int i = 0; i < this->bvElement->numOfVertices; ++i)
+    {
+      glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
       //printf("v(%f, %f, %f)\n", this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]);
     }
@@ -298,4 +300,6 @@
 void OBBTreeNode::drawBVPolygon(int currentDepth, const int depth) const
 {
+
+  /* draw the obb axes */
   glBegin(GL_LINES);
   glColor3f(0.0, 0.4, 0.3);
@@ -304,5 +308,5 @@
              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],
@@ -315,4 +319,84 @@
              this->bvElement->center->z + this->bvElement->axis[2]->z * this->bvElement->halfLength[2]);
   glEnd();
+
+
+  Vector cen = *this->bvElement->center;
+  Vector** axis = this->bvElement->axis;
+  float* len = this->bvElement->halfLength;
+
+  /* draw bounding box */
+  glBegin(GL_LINE_LOOP);
+  glColor3f(0.3, 0.4, 0.7);
+  glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2],
+             cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2],
+             cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]);
+  glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2],
+             cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2],
+             cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]);
+  glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2],
+             cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2],
+             cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]);
+  glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2],
+             cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2],
+             cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]);
+  glEnd();
+
+  glBegin(GL_LINE_LOOP);
+  glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2],
+             cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2],
+             cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]);
+  glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2],
+             cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2],
+             cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]);
+  glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]);
+  glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]);
+  glEnd();
+
+  glBegin(GL_LINE_LOOP);
+  glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]);
+  glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]);
+  glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]);
+  glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]);
+  glEnd();
+
+  glBegin(GL_LINE_LOOP);
+  glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]);
+  glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]);
+  glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2],
+             cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2],
+             cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]);
+  glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2],
+             cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2],
+             cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]);
+  glEnd();
+
+/*
+  glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]);
+  glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2],
+             cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2],
+             cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]);*/
+
+
+  glEnd();
+
+
 }
 
