Index: /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5868)
+++ /branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5869)
@@ -18,4 +18,5 @@
 #include "obb_tree_node.h"
 #include "list.h"
+#include <list>
 #include "obb.h"
 #include "obb_tree.h"
@@ -373,6 +374,6 @@
 
   /*
-  this step is split up in two: first there will be made a bounding box which is
-  very badly centered. In the secon step there will be calculated a new center
+  this step is split up in three: first there will be made a bounding box which is
+  very badly centered. In the section step there will be calculated a new center
   and a better bounding box.
   */
@@ -494,11 +495,12 @@
 
 /**
-  \brief this separates an ob-box in the middle
-* @param box: the box to separate
-
-  this will separate the box into to smaller boxes. the separation is done along the middle of the longest axis
+ *  this separates an ob-box in the middle
+ * @param box: the box to separate
+ *
+ * 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)
 {
+
   /* get the longest axis of the box */
   float               aLength = -1.0f;                     //!< the length of the longest axis
@@ -540,6 +542,18 @@
   the points depending on which side they are located
   */
-  tList<const sVec3D>      partition1;                           //!< the vertex partition 1
-  tList<const sVec3D>      partition2;                           //!< the vertex partition 2
+  std::list<const sVec3D*> partition1;                           //!< the vertex partition 1
+  std::list<const sVec3D*> partition2;                           //!< the vertex partition 2
+
+
+  //nameList.push_back("Pumba");
+  //nameList.push_back("Mogli");
+  //nameList.push_back("Timon");
+
+//   std::list<char*>::iterator element;
+//   for (element = nameList.begin(); element != nameList.end(); element++)
+//   {
+//     PRINTF(3)("found name: %s in list\n", (*name));
+//   }
+
 
 
@@ -555,36 +569,33 @@
     tmpDist = this->separationPlane.distancePoint(box.vertices[i]);
     if( tmpDist > 0.0)
-      partition1.add(&box.vertices[i]); /* positive numbers plus zero */
+      partition1.push_back(&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]);
-
-  PRINTF(3)("\npartition1: got %i vertices/ partition 2: got %i vertices\n", partition1.getSize(), partition2.getSize());
+      partition2.push_back(&box.vertices[i]); /* negatice numbers */
+  }
+  partition1.push_back(&box.vertices[vertexIndex]);
+  partition2.push_back(&box.vertices[vertexIndex]);
+
+  PRINTF(3)("\npartition1: got %i vertices/ partition 2: got %i vertices\n", partition1.size(), partition2.size());
 
 
   /* now comes the separation into two different sVec3D arrays */
   tIterator<const sVec3D>* iterator;                       //!< the iterator to go through the lists
-  const sVec3D*      element;                              //!< the elements
   int                index;                                //!< index storage place
   sVec3D*            vertList1;                            //!< the vertex list 1
   sVec3D*            vertList2;                            //!< the vertex list 2
-
-  vertList1 = new sVec3D[partition1.getSize()];
-  vertList2 = new sVec3D[partition2.getSize()];
-
-  iterator = partition1.getIterator();
-  element = iterator->firstElement();
-  index = 0;
-  while( element != NULL)
-  {
-    vertList1[index][0] = element[0][0];
-    vertList1[index][1] = element[0][1];
-    vertList1[index][2] = element[0][2];
+  std::list<const sVec3D*>::iterator element;              //!< the list iterator
+
+  vertList1 = new sVec3D[partition1.size()];
+  vertList2 = new sVec3D[partition2.size()];
+
+
+  for(element = partition1.begin(), index = 0; element != partition1.end(); element++, index++)
+  {
+    vertList1[index][0] = (*element)[0][0];
+    vertList1[index][1] = (*element)[0][1];
+    vertList1[index][2] = (*element)[0][2];
     ++index;
-    element = iterator->nextElement();
-  }
-  delete iterator;
+  }
+
   //   PRINTF(0)("\npartition 1:\n");
   //   for(int i = 0; i < partition1.getSize(); ++i)
@@ -593,14 +604,14 @@
   //   }
 
-  iterator = partition2.getIterator();
-  element = iterator->firstElement();
-  index = 0;
-  while( element != NULL)
-  {
-    vertList2[index][0] = element[0][0];
-    vertList2[index][1] = element[0][1];
-    vertList2[index][2] = element[0][2];
-    ++index;
-    element = iterator->nextElement();
+
+  //for (element = nameList.begin(); element != nameList.end(); element++)
+//   iterator = partition2.getIterator();
+//   element = iterator->firstElement();
+
+  for(element = partition2.begin(), index = 0; element != partition2.end(); element++, index++)
+  {
+    vertList2[index][0] = (*element)[0][0];
+    vertList2[index][1] = (*element)[0][1];
+    vertList2[index][2] = (*element)[0][2];
   }
 
@@ -611,8 +622,7 @@
     delete[] this->tmpVert2;
   this->tmpVert2 = vertList2;
-  this->tmpLen1 = partition1.getSize();
-  this->tmpLen2 = partition2.getSize();
-
-  delete iterator;
+  this->tmpLen1 = partition1.size();
+  this->tmpLen2 = partition2.size();
+
 
   //   PRINTF(0)("\npartition 2:\n");
