Index: /branches/collision_detection/src/lib/collision_detection/bounding_volume.cc
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/bounding_volume.cc	(revision 5701)
+++ /branches/collision_detection/src/lib/collision_detection/bounding_volume.cc	(revision 5702)
@@ -45,3 +45,6 @@
   if( this->vertices && !this->bOrigVertices)
     delete[] this->vertices;
+  
+  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 5701)
+++ /branches/collision_detection/src/lib/collision_detection/bounding_volume.h	(revision 5702)
@@ -37,4 +37,7 @@
     int                 numOfVertices;              //!< number of vertices in the vertices buffer
     bool                bOrigVertices;              //!< is true if the vertices pointer points to the original model data - only important for deleting
+    const modelInfo*    modelInf;                   //!< Reference to the model's ModelInfo
+    const int*          triangleIndexes;            //!< Array with the triangle indexes in modelInfo
+    unsigned int        numTriangles;               //!< Number of triangles in this BV
 };
 
Index: /branches/collision_detection/src/lib/collision_detection/bv_tree.h
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/bv_tree.h	(revision 5701)
+++ /branches/collision_detection/src/lib/collision_detection/bv_tree.h	(revision 5702)
@@ -40,5 +40,5 @@
 
   virtual void spawnBVTree(int depth, sVec3D *verticesList, const int length) = 0;
-  virtual void spawnBVTree(int depth, const modelInfo& modInfo) = 0;
+  virtual void spawnBVTree(int depth, const modelInfo& modelInf) = 0;
   virtual void flushTree() = 0;
 
Index: /branches/collision_detection/src/lib/collision_detection/bv_tree_node.h
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/bv_tree_node.h	(revision 5701)
+++ /branches/collision_detection/src/lib/collision_detection/bv_tree_node.h	(revision 5702)
@@ -27,5 +27,5 @@
 
   virtual void spawnBVTree(const int depth, const sVec3D *verticesList, unsigned int length ) = 0;
-  virtual void spawnBVTree(const int depth, const modelInfo& modInfo) = 0;
+  virtual void spawnBVTree(const int depth, const modelInfo& modInfo, const int* triangleIndexes, unsigned int length) = 0;
 
   virtual BoundingVolume* getBV(int index) const = 0;
Index: /branches/collision_detection/src/lib/collision_detection/obb_tree.cc
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/obb_tree.cc	(revision 5701)
+++ /branches/collision_detection/src/lib/collision_detection/obb_tree.cc	(revision 5702)
@@ -83,5 +83,5 @@
 
 
-void OBBTree::spawnBVTree(int depth, const modelInfo& modInfo)
+void OBBTree::spawnBVTree(int depth, const modelInfo& modelInf)
 {
   if( unlikely(this->rootNode != NULL))
@@ -93,5 +93,9 @@
   this->rootNode = node;
   this->rootNode->setTreeRef(this);
-  this->rootNode->spawnBVTree(--depth, modInfo);
+  
+  /* triangles indexes created */
+  int* triangleIndexes = new int[modelInf.numTriangles];
+  
+  this->rootNode->spawnBVTree(--depth, modelInf, triangleIndexes, modelInf.numTriangles);
 }
 
Index: /branches/collision_detection/src/lib/collision_detection/obb_tree.h
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/obb_tree.h	(revision 5701)
+++ /branches/collision_detection/src/lib/collision_detection/obb_tree.h	(revision 5702)
@@ -27,5 +27,5 @@
 
     virtual void spawnBVTree(int depth, sVec3D *verticesList, const int length);
-    virtual void spawnBVTree(int depth, const modelInfo& modInfo);
+    virtual void spawnBVTree(int depth, const modelInfo& modelInf);
     virtual void flushTree();
 
Index: /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5701)
+++ /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5702)
@@ -111,7 +111,7 @@
  * on the triangle informations (triangle soup not polygon soup)
  */
-void OBBTreeNode::spawnBVTree(const int depth, const modelInfo& modInfo)
-{
-  int length = 0;
+void OBBTreeNode::spawnBVTree(const int depth, const modelInfo& modelInf, 
+                              const int* triangleIndexes, unsigned int length)
+{
   sVec3D* verticesList;
 
@@ -123,12 +123,15 @@
 
   this->bvElement = new OBB();
-  this->bvElement->vertices = verticesList;
-  this->bvElement->numOfVertices = length;
+  
+  this->bvElement->modelInf = &modelInf;
+  this->bvElement->triangleIndexes = triangleIndexes;
+  this->bvElement->numTriangles = length;
+  
   PRINTF(3)("Created OBBox\n");
-  this->calculateBoxCovariance(this->bvElement, modInfo);
+  this->calculateBoxCovariance(this->bvElement, modelInf, triangleIndexes, length);
   PRINTF(3)("Calculated attributes1\n");
-  this->calculateBoxEigenvectors(this->bvElement, modInfo);
+  this->calculateBoxEigenvectors(this->bvElement, modelInf, triangleIndexes, length);
   PRINTF(3)("Calculated attributes2\n");
-  this->calculateBoxAxis(this->bvElement,modInfo);
+  this->calculateBoxAxis(this->bvElement, modelInf, triangleIndexes, length);
   PRINTF(3)("Calculated attributes3\n");
 
@@ -228,5 +231,5 @@
 
 
-void OBBTreeNode::calculateBoxCovariance(OBB* box, const modelInfo& modInfo)
+void OBBTreeNode::calculateBoxCovariance(OBB* box, const modelInfo& modInfo, const int* triangleIndexes, unsigned int length)
 {}
 
@@ -421,5 +424,6 @@
 
 
-void OBBTreeNode::calculateBoxEigenvectors(OBB* box, const modelInfo& modInfo)
+void OBBTreeNode::calculateBoxEigenvectors(OBB* box, const modelInfo& modInfo, 
+                                           const int* triangleIndexes, unsigned int length)
 {}
 
@@ -473,5 +477,5 @@
 
 
-void OBBTreeNode::calculateBoxAxis(OBB* box, const modelInfo& modInfo)
+void OBBTreeNode::calculateBoxAxis(OBB* box, const modelInfo& modInfo, const int* triangleIndexes, unsigned int length)
 {
   this->calculateBoxAxis(box, (const sVec3D*)modInfo.pVertices, modInfo.numVertices);
Index: /branches/collision_detection/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/obb_tree_node.h	(revision 5701)
+++ /branches/collision_detection/src/lib/collision_detection/obb_tree_node.h	(revision 5702)
@@ -29,5 +29,6 @@
 
     virtual void spawnBVTree(const int depth, const sVec3D *verticesList, unsigned int length);
-    virtual void spawnBVTree(const int depth, const modelInfo& modInfo);
+    virtual void spawnBVTree(const int depth, const modelInfo& modelInf, 
+                             const int* triangleIndexes, unsigned int length);
 
     BoundingVolume* getBV(int index) const { return (BoundingVolume*)this->bvElement; }
@@ -46,7 +47,7 @@
     void calculateBoxAxis(OBB* box, const sVec3D* verticesList, unsigned int length);
 
-    void calculateBoxCovariance(OBB* box, const modelInfo& modInfo);
-    void calculateBoxEigenvectors(OBB* box, const modelInfo& modInfo);
-    void calculateBoxAxis(OBB* box, const modelInfo& modInfo);
+    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);
 
 
