Index: orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4613)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4614)
@@ -64,12 +64,17 @@
 /**
    \brief creates a new BVTree or BVTree partition
-   \param depth: the depth of the tree
+   \param depth: how much more depth-steps to go: if == 1 don't go any deeper!
    \param verticesList: the list of vertices of the object - each vertices triple is interpreted as a triangle
 */
 void OBBTreeNode::spawnBVTree(const int depth, sVec3D *verticesList, const int length)
 {
-  this->bvElement = this->createBox();
-  this->calculateBoxAttributes(this->bvElement, verticesList, length);
-  this->forkBox(this->bvElement);
+  this->depth = depth;
+
+  if( likely( this->depth > 0))
+  {
+    this->bvElement = this->createBox();
+    this->calculateBoxAttributes(this->bvElement, verticesList, length);
+    this->forkBox(this->bvElement);
+  }
 }
 
@@ -366,4 +371,13 @@
   }
 
+  /* now spawn the obb tree: create the nodes and descent */
+  OBBTreeNode*       node1 = new OBBTreeNode();
+  OBBTreeNode*       node2 = new OBBTreeNode();
+
+  this->nodeLeft = node1;
+  this->nodeRight = node2;
+
+  this->nodeLeft->spawnBVTree(this->depth - 1, vertList1, partition1.getSize());
+  this->nodeRight->spawnBVTree(this->depth - 1, vertList2, partition2.getSize());
 }
 
Index: orxonox/trunk/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree_node.h	(revision 4613)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree_node.h	(revision 4614)
@@ -1,7 +1,7 @@
-/*! 
+/*!
     \file bv_tree.h
     \brief Definition of a bounding volume tree
 
-*/
+ */
 
 #ifndef _OBB_TREE_NODE_H
@@ -21,37 +21,38 @@
 
 
- public:
-  OBBTreeNode();
-  virtual ~OBBTreeNode();
+  public:
+    OBBTreeNode();
+    virtual ~OBBTreeNode();
 
-  virtual void spawnBVTree(const int depth, sVec3D *verticesList, const int length);
+    virtual void spawnBVTree(const int depth, sVec3D *verticesList, const int length);
 
-  BoundingVolume* getBV(int index) const { return (BoundingVolume*)this->bvElement; }
-  inline const int getIndex() { return this->treeIndex; }  
+    BoundingVolume* getBV(int index) const { return (BoundingVolume*)this->bvElement; }
+    inline const int getIndex() { return this->treeIndex; }
 
-  virtual void collideWith(const BVTree &tree);
+    virtual void collideWith(const BVTree &tree);
 
-  virtual void drawBV(int currentDepth, const int depth) const;
-  virtual void drawBVPolygon(int currentDepth, const int depth) const;
-  virtual void drawBVBlended(int currentDepth, const int depth) const;
+    virtual void drawBV(int currentDepth, const int depth) const;
+    virtual void drawBVPolygon(int currentDepth, const int depth) const;
+    virtual void drawBVBlended(int currentDepth, const int depth) const;
 
-  void debug();
+    void debug();
 
- private:
-  OBB* createBox();
-  void calculateBoxAttributes(OBB* box, sVec3D* verticesList, int length);
-  void forkBox(OBB* box);
-  
-
- protected:
-  OBB* bvElement;
-  OBBTreeNode* nodeLeft;
-  OBBTreeNode* nodeRight;
+  private:
+    OBB* createBox();
+    void calculateBoxAttributes(OBB* box, sVec3D* verticesList, int length);
+    void forkBox(OBB* box);
 
 
- private:
-  unsigned int        treeIndex;                  //!< Index number of the BV in the tree
-  sVec3D*             vertices;                   //!< pointer to the vertices data
-  int                 numOfVertices;              //!< number of vertices in vertices data
+  protected:
+    OBB* bvElement;                                 //!< the obb element
+    OBBTreeNode* nodeLeft;                          //!< ref to the left tree node
+    OBBTreeNode* nodeRight;                         //!< ref to the right tree node
+
+
+  private:
+    unsigned int        treeIndex;                  //!< Index number of the BV in the tree
+    sVec3D*             vertices;                   //!< pointer to the vertices data
+    int                 numOfVertices;              //!< number of vertices in vertices data
+    int                 depth;                      //!< the depth of the node in the tree
 
 };
