Index: /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5711)
+++ /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5712)
@@ -125,12 +125,12 @@
 
   /* create the boxes in three steps */
-  this->calculateBoxCovariance(this->bvElement, modelInf, triangleIndexes, length);
-  this->calculateBoxEigenvectors(this->bvElement, modelInf, triangleIndexes, length);
-  this->calculateBoxAxis(this->bvElement, modelInf, triangleIndexes, length);
+  this->calculateBoxCovariance(*this->bvElement, modelInf, triangleIndexes, length);
+  this->calculateBoxEigenvectors(*this->bvElement, modelInf, triangleIndexes, length);
+  this->calculateBoxAxis(*this->bvElement, modelInf, triangleIndexes, length);
 
   /* do we need to descent further in the obb tree?*/
   if( likely( this->depth > 0))
   {
-    this->forkBox(this->bvElement);
+    this->forkBox(*this->bvElement);
 
 
@@ -218,5 +218,5 @@
 
 
-void OBBTreeNode::calculateBoxCovariance(OBB* box, const modelInfo& modelInf,
+void OBBTreeNode::calculateBoxCovariance(OBB& box, const modelInfo& modelInf,
                                          const int* triangleIndexes, unsigned int length)
 {
@@ -284,5 +284,5 @@
   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)(" 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"); }
@@ -292,9 +292,9 @@
   for(int i = 0; i < 3; ++i)
   {
-    box->covarianceMatrix[i][0] = covariance[i][0];
-    box->covarianceMatrix[i][1] = covariance[i][1];
-    box->covarianceMatrix[i][2] = covariance[i][2];
-  }
-  box->center = center;
+    box.covarianceMatrix[i][0] = covariance[i][0];
+    box.covarianceMatrix[i][1] = covariance[i][1];
+    box.covarianceMatrix[i][2] = covariance[i][2];
+  }
+  box.center = center;
 
   PRINTF(3)("-- Written Result to OBB\n");
@@ -302,9 +302,9 @@
 
 
-void OBBTreeNode::calculateBoxEigenvectors(OBB* box, const modelInfo& modInfo,
+void OBBTreeNode::calculateBoxEigenvectors(OBB& box, const modelInfo& modInfo,
                                            const int* triangleIndexes, unsigned int length)
 {}
 
-void OBBTreeNode::calculateBoxEigenvectors(OBB* box, const sVec3D* verticesList, unsigned int length)
+void OBBTreeNode::calculateBoxEigenvectors(OBB& box, const sVec3D* verticesList, unsigned int length)
 {
   PRINTF(3)("Calculated attributes1\n");
@@ -317,5 +317,5 @@
   Vector axis[3];                //!< the references to the obb axis
 
-  Matrix covMat(  box->covarianceMatrix  );
+  Matrix covMat(  box.covarianceMatrix  );
   covMat.getEigenVectors(axis[0], axis[1], axis[2] );
 
@@ -343,17 +343,17 @@
   axis[1].normalize();
   axis[2].normalize();*/
-  box->axis[0] = axis[0];
-  box->axis[1] = axis[1];
-  box->axis[2] = axis[2];
+  box.axis[0] = axis[0];
+  box.axis[1] = axis[1];
+  box.axis[2] = axis[2];
 
 //   PRINTF(0)("-- Got Axis\n");
 //
-//   PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[0].x, box->axis[0].y, box->axis[0].z);
-//   PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[1].x, box->axis[1].y, box->axis[1].z);
-//   PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[2].x, box->axis[2].y, box->axis[2].z);
-}
-
-
-void OBBTreeNode::calculateBoxAxis(OBB* box, const modelInfo& modInfo, const int* triangleIndexes, unsigned int length)
+//   PRINTF(0)("eigenvector: %f, %f, %f\n", box.axis[0].x, box.axis[0].y, box.axis[0].z);
+//   PRINTF(0)("eigenvector: %f, %f, %f\n", box.axis[1].x, box.axis[1].y, box.axis[1].z);
+//   PRINTF(0)("eigenvector: %f, %f, %f\n", box.axis[2].x, box.axis[2].y, box.axis[2].z);
+}
+
+
+void OBBTreeNode::calculateBoxAxis(OBB& box, const modelInfo& modInfo, const int* triangleIndexes, unsigned int length)
 {
   this->calculateBoxAxis(box, (const sVec3D*)modInfo.pVertices, modInfo.numVertices);
@@ -362,5 +362,5 @@
 
 
-void OBBTreeNode::calculateBoxAxis(OBB* box, const sVec3D* verticesList, unsigned int length)
+void OBBTreeNode::calculateBoxAxis(OBB& box, const sVec3D* verticesList, unsigned int length)
 {
   PRINTF(3)("Calculated attributes3\n");
@@ -369,7 +369,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];
@@ -446,5 +446,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];
      }
@@ -452,7 +452,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];
   PRINTF(3)("-- Written Axis to obb\n");
   PRINTF(3)("-- Finished Calculating Attributes\n");
@@ -467,5 +467,5 @@
   this will separate the box into to smaller boxes. the separation is done along the middle of the longest axis
  */
-void OBBTreeNode::forkBox(OBB* box)
+void OBBTreeNode::forkBox(OBB& box)
 {
   /* get the longest axis of the box */
@@ -475,7 +475,7 @@
   for(int i = 0; i < 3; ++i)
   {
-    if( aLength < box->halfLength[i])
-    {
-      aLength = box->halfLength[i];
+    if( aLength < box.halfLength[i])
+    {
+      aLength = box.halfLength[i];
       axisIndex = i;
     }
@@ -489,10 +489,10 @@
   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;
-  for(int i = 0; i < box->numOfVertices; ++i)
-  {
-    tmpDist = fabs(middlePlane.distancePoint(box->vertices[i]));
+  for(int i = 0; i < box.numOfVertices; ++i)
+  {
+    tmpDist = fabs(middlePlane.distancePoint(box.vertices[i]));
     if( tmpDist < dist)
     {
@@ -512,20 +512,20 @@
 
 
-  PRINTF(3)("vertex index: %i, of %i\n", vertexIndex, box->numOfVertices);
-  this->separationPlane = Plane(box->axis[axisIndex], box->vertices[vertexIndex]);  //!< separation plane
-  this->sepPlaneCenter = &box->vertices[vertexIndex];
+  PRINTF(3)("vertex index: %i, of %i\n", vertexIndex, box.numOfVertices);
+  this->separationPlane = Plane(box.axis[axisIndex], box.vertices[vertexIndex]);  //!< separation plane
+  this->sepPlaneCenter = &box.vertices[vertexIndex];
   this->longestAxisIndex = axisIndex;
 
-  for(int i = 0; i < box->numOfVertices; ++i)
+  for(int i = 0; i < box.numOfVertices; ++i)
   {
     if( i == vertexIndex) continue;
-    tmpDist = this->separationPlane.distancePoint(box->vertices[i]);
+    tmpDist = this->separationPlane.distancePoint(box.vertices[i]);
     if( tmpDist > 0.0)
-      partition1.add(&box->vertices[i]); /* positive numbers plus zero */
+      partition1.add(&box.vertices[i]); /* positive numbers plus zero */
     else
-      partition2.add(&box->vertices[i]); /* negatice numbers */
-  }
-  partition1.add(&box->vertices[vertexIndex]);
-  partition2.add(&box->vertices[vertexIndex]);
+      partition2.add(&box.vertices[i]); /* negatice numbers */
+  }
+  partition1.add(&box.vertices[vertexIndex]);
+  partition2.add(&box.vertices[vertexIndex]);
 
   PRINTF(3)("\npartition1: got %i vertices/ partition 2: got %i vertices\n", partition1.getSize(), partition2.getSize());
Index: /branches/collision_detection/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/obb_tree_node.h	(revision 5711)
+++ /branches/collision_detection/src/lib/collision_detection/obb_tree_node.h	(revision 5712)
@@ -31,8 +31,8 @@
     /*  this function returns the bounding volume of this tree node @return: returns the BV */
     virtual inline const BoundingVolume* getBV() const { return (BoundingVolume*)this->bvElement; }
-    
-    
+
+
     virtual void spawnBVTree(const int depth, const sVec3D *verticesList, unsigned int length);
-    virtual void spawnBVTree(const int depth, const modelInfo& modelInf, 
+    virtual void spawnBVTree(const int depth, const modelInfo& modelInf,
                              const int* triangleIndexes, unsigned int length);
 
@@ -41,18 +41,18 @@
     void debug() const;
 
-    
+
   private:
-    void calculateBoxEigenvectors(OBB* box, const sVec3D* verticesList, unsigned int length);
-    void calculateBoxAxis(OBB* box, const sVec3D* verticesList, unsigned int length);
+    void calculateBoxEigenvectors(OBB& box, const sVec3D* verticesList, unsigned int length);
+    void calculateBoxAxis(OBB& box, const sVec3D* verticesList, unsigned int length);
 
-    void calculateBoxCovariance(OBB* box, const modelInfo& modelInf, const int* triangleIndexes, unsigned int length);
-    void calculateBoxEigenvectors(OBB* box, const modelInfo& modelInf, const int* triangleIndexes, unsigned int length);
-    void calculateBoxAxis(OBB* box, const modelInfo& modelInf, const int* triangleIndexes, unsigned int length);
+    void calculateBoxCovariance(OBB& box, const modelInfo& modelInf, const int* triangleIndexes, unsigned int length);
+    void calculateBoxEigenvectors(OBB& box, const modelInfo& modelInf, const int* triangleIndexes, unsigned int length);
+    void calculateBoxAxis(OBB& box, const modelInfo& modelInf, const int* triangleIndexes, unsigned int length);
 
-    void forkBox(OBB* box);
+    void forkBox(OBB& box);
 
     bool overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB);
 
-    
+
   protected:
     OBB*                bvElement;                  //!< the obb element
@@ -65,5 +65,5 @@
     int                 depth;                      //!< the depth of the node in the tree
     const OBBTree*      obbTree;                    //!< reference to the obb tree
-    
+
     const sVec3D*       vertices;                   //!< pointer to the vertices data
     int                 numOfVertices;              //!< number of vertices in vertices data
@@ -82,5 +82,5 @@
     static float*       eigvlMat;
     static int*         rotCount;
-    
+
 };
 
