Index: branches/collision_detection/src/lib/collision_detection/bv_tree_node.h
===================================================================
--- branches/collision_detection/src/lib/collision_detection/bv_tree_node.h	(revision 6140)
+++ branches/collision_detection/src/lib/collision_detection/bv_tree_node.h	(revision 6447)
@@ -34,5 +34,5 @@
   inline const int getIndex() const { return this->treeIndex; }
 
-  virtual void spawnBVTree(const modelInfo& modInfo, const int* triangleIndexes, unsigned int length) = 0;
+  virtual void spawnBVTree(const modelInfo& modInfo, const int* triangleIndexes, int length) = 0;
   virtual void collideWith(const BVTreeNode& treeNode, const WorldEntity& nodeA, const WorldEntity& nodeB) const = 0;
   virtual void drawBV(int depth, int drawMode, const Vector& color = Vector(1,0,0), bool top = true) const = 0;
Index: branches/collision_detection/src/lib/collision_detection/obb_tree.cc
===================================================================
--- branches/collision_detection/src/lib/collision_detection/obb_tree.cc	(revision 6140)
+++ branches/collision_detection/src/lib/collision_detection/obb_tree.cc	(revision 6447)
@@ -66,5 +66,5 @@
     this->flushTree();
   }
-  this->rootNode = new OBBTreeNode(*this, depth-1);
+  this->rootNode = new OBBTreeNode(*this, NULL, depth-1);
 
   /* triangles indexes created */
Index: branches/collision_detection/src/lib/collision_detection/obb_tree.h
===================================================================
--- branches/collision_detection/src/lib/collision_detection/obb_tree.h	(revision 6140)
+++ branches/collision_detection/src/lib/collision_detection/obb_tree.h	(revision 6447)
@@ -32,5 +32,5 @@
 
     /** returns the next if for the obb tree node @return integer id number of the next node */
-    const int getID() { return ++this->id;}
+    inline const int getID() { return ++this->id;}
     /** returns the root node of the bounding volume tree @return reference to the root node */
     inline const OBBTreeNode* getRootNode() const { return this->rootNode; }
@@ -40,5 +40,5 @@
   private:
     OBBTreeNode*         rootNode;                        //!< reference to the root node of the tree
-    int                  id;
+    int                  id;                              //!< the next id of a obb tree node
     int                  depth;                           //!< the depth of the tree to generate
 };
Index: branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 6140)
+++ branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 6447)
@@ -11,5 +11,4 @@
 ### File Specific:
    main-programmer: Patrick Boenzli
-   co-programmer: ...
 */
 
@@ -44,5 +43,5 @@
  * @param depth: the depth of the obb tree to generate
  */
-OBBTreeNode::OBBTreeNode (const OBBTree& tree, unsigned int depth)
+OBBTreeNode::OBBTreeNode (const OBBTree& tree, OBBTreeNode* prev, int depth)
     : BVTreeNode()
 {
@@ -50,5 +49,7 @@
 
   this->obbTree = &tree;
+  this->nodePrev = prev;
   this->depth = depth;
+  this->nextID = 0;
 
   this->nodeLeft = NULL;
@@ -64,4 +65,10 @@
   if( OBBTreeNode_sphereObj == NULL)
     OBBTreeNode_sphereObj = gluNewQuadric();
+
+  /* debug ids */
+  if( this->nodePrev)
+    this->treeIndex = 100 * this->depth + this->nodePrev->getID();
+  else
+    this->treeIndex = 0;
 }
 
@@ -95,9 +102,9 @@
  * on the triangle informations (triangle soup not polygon soup)
  */
-void OBBTreeNode::spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, unsigned int length)
+void OBBTreeNode::spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, int length)
 {
   PRINTF(3)("\n==============================Creating OBB Tree Node==================\n");
   PRINT(3)(" OBB Tree Infos: \n");
-  PRINT(3)("\tDepth: %i \n\tTree Index: %i \n\tNumber of Triangles: %i\n", depth, treeIndex, length);
+  PRINT(3)("\tDepth: %i \n\tTree Index: %i \n\tNumber of Triangles: %i\n", depth, this->treeIndex, length);
   this->depth = depth;
 
@@ -107,5 +114,5 @@
   this->bvElement->triangleIndexesLength = length;
 
-  /* create the boxes in three steps */
+  /* create the bounding boxes in three steps */
   this->calculateBoxCovariance(*this->bvElement, modelInf, triangleIndexes, length);
   this->calculateBoxEigenvectors(*this->bvElement, modelInf, triangleIndexes, length);
@@ -119,10 +126,10 @@
     if( this->triangleIndexLength1 >= 3)
     {
-      this->nodeLeft = new OBBTreeNode(*this->obbTree, depth - 1);
+      this->nodeLeft = new OBBTreeNode(*this->obbTree, this, depth - 1);
       this->nodeLeft->spawnBVTree(modelInf, this->triangleIndexList1, this->triangleIndexLength1);
     }
     if( this->triangleIndexLength2 >= 3)
     {
-      this->nodeRight = new OBBTreeNode(*this->obbTree, depth - 1);
+      this->nodeRight = new OBBTreeNode(*this->obbTree, this, depth - 1);
       this->nodeRight->spawnBVTree(modelInf, this->triangleIndexList2, this->triangleIndexLength2);
     }
@@ -139,5 +146,5 @@
  * @param length: the length of the indexes array
  */
-void OBBTreeNode::calculateBoxCovariance(OBB& box, const modelInfo& modelInf, const int* triangleIndexes, unsigned int length)
+void OBBTreeNode::calculateBoxCovariance(OBB& box, const modelInfo& modelInf, const int* triangleIndexes, int length)
 {
   float     facelet[length];                         //!< surface area of the i'th triangle of the convex hull
@@ -269,5 +276,5 @@
  */
 void OBBTreeNode::calculateBoxEigenvectors(OBB& box, const modelInfo& modelInf,
-    const int* triangleIndexes, unsigned int length)
+    const int* triangleIndexes, int length)
 {
 
@@ -305,5 +312,5 @@
  * @param length: the length of the indexes array
  */
-void OBBTreeNode::calculateBoxAxis(OBB& box, const modelInfo& modelInf, const int* triangleIndexes, unsigned int length)
+void OBBTreeNode::calculateBoxAxis(OBB& box, const modelInfo& modelInf, const int* triangleIndexes, int length)
 {
 
@@ -448,5 +455,4 @@
 
   /* find the center of the box */
-
   this->separationPlane = Plane(box.axis[longestAxisIndex], box.center);
   this->sepPlaneCenter[0] = box.center.x;
Index: branches/collision_detection/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- branches/collision_detection/src/lib/collision_detection/obb_tree_node.h	(revision 6140)
+++ branches/collision_detection/src/lib/collision_detection/obb_tree_node.h	(revision 6447)
@@ -25,5 +25,5 @@
 
   public:
-    OBBTreeNode(const OBBTree& tree, unsigned int depth);
+    OBBTreeNode(const OBBTree& tree, OBBTreeNode* prev, int depth);
     virtual ~OBBTreeNode();
 
@@ -31,5 +31,5 @@
     virtual inline const BoundingVolume* getBV() const { return (BoundingVolume*)this->bvElement; }
 
-    virtual void spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, unsigned int length);
+    virtual void spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, int length);
 
     virtual void collideWith(const BVTreeNode& treeNode, const WorldEntity& nodeA, const WorldEntity& nodeB) const;
@@ -37,11 +37,13 @@
     void debug() const;
 
+    /**  gets the id of the current child @return id of the child */
+    inline const int getID() { return this->nextID++; }
 
   private:
     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, int length);
+    void calculateBoxEigenvectors(OBB& box, const modelInfo& modelInf, const int* triangleIndexes, int length);
+    void calculateBoxAxis(OBB& box, const modelInfo& modelInf, const int* triangleIndexes, int length);
     void forkBox(OBB& box);
 
@@ -51,4 +53,5 @@
   protected:
     OBB*                bvElement;                  //!< the obb element
+    OBBTreeNode*        nodePrev;                   //!< ref to the previous (parent) tree node = NULL if first
     OBBTreeNode*        nodeLeft;                   //!< ref to the left tree node
     OBBTreeNode*        nodeRight;                  //!< ref to the right tree node
@@ -56,5 +59,6 @@
 
   private:
-    unsigned int        treeIndex;                  //!< Index number of the BV in the tree
+    int                 treeIndex;                  //!< Index number of the BV in the tree
+    int                 nextID;                     //!< the id of the next child
     int                 depth;                      //!< the depth of the node in the tree
     const OBBTree*      obbTree;                    //!< reference to the obb tree
