Index: branches/collision_detection/src/defs/debug.h
===================================================================
--- branches/collision_detection/src/defs/debug.h	(revision 5716)
+++ branches/collision_detection/src/defs/debug.h	(revision 5717)
@@ -36,5 +36,5 @@
 #define WARN            2
 #define INFO            3
-//#define DEBUG           4
+#define DEBUG           4
 #define vDEBUG          5
 
@@ -75,5 +75,5 @@
   #define DEBUG_MODULE_OBJECT_MANAGER        2
   #define DEBUG_MODULE_ANIM                  2
-  #define DEBUG_MODULE_COLLISON_DETECTION    5
+  #define DEBUG_MODULE_COLLISON_DETECTION    4
   #define DEBUG_MODULE_SPATIAL_SEPARATION    2
   #define DEBUG_MODULE_GUI                   2
Index: branches/collision_detection/src/lib/collision_detection/bv_tree_node.h
===================================================================
--- branches/collision_detection/src/lib/collision_detection/bv_tree_node.h	(revision 5716)
+++ branches/collision_detection/src/lib/collision_detection/bv_tree_node.h	(revision 5717)
@@ -26,11 +26,11 @@
   virtual ~BVTreeNode();
 
+  virtual const BoundingVolume* getBV() const = 0;
+  inline const int getIndex() const { return this->treeIndex; }
+
   virtual void spawnBVTree(const sVec3D *verticesList, unsigned int length ) = 0;
   virtual void spawnBVTree(const modelInfo& modInfo, const int* triangleIndexes, unsigned int length) = 0;
 
-  virtual const BoundingVolume* getBV() const = 0;
-  inline const int getIndex() { return this->treeIndex; }
-
-  virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) = 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/cd_engine.cc
===================================================================
--- branches/collision_detection/src/lib/collision_detection/cd_engine.cc	(revision 5716)
+++ branches/collision_detection/src/lib/collision_detection/cd_engine.cc	(revision 5717)
@@ -14,5 +14,5 @@
 */
 
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_DETECTION
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION
 
 #include "cd_engine.h"
@@ -78,5 +78,5 @@
 void CDEngine::checkCollisionObjects()
 {
-  BVTree* tree;
+  const BVTree* tree;
   tIterator<WorldEntity>* iterator1 = entityList->getIterator();
   tIterator<WorldEntity>* iterator2 = entityList->getIterator();
@@ -94,7 +94,10 @@
         if( likely(entity2 != this->terrain))
         {
-          PRINTF(4)("checking object %s against %s\n", entity1->getName(), entity2->getName());
+          printf("checking object %s against %s\n", entity1->getName(), entity2->getName());
           tree = entity1->getOBBTree();
-          if( likely(tree != NULL) && entity2->getOBBTree() != NULL) tree->collideWith(entity1, entity2);
+
+          if( likely(tree != NULL) && entity2->getOBBTree() != NULL)
+            //tree->collideWith(entity1, entity2);
+            PRINTF(5)("Collision check\n");
         }
         entity2 = iterator2->nextElement();
Index: branches/collision_detection/src/lib/collision_detection/obb_tree.cc
===================================================================
--- branches/collision_detection/src/lib/collision_detection/obb_tree.cc	(revision 5716)
+++ branches/collision_detection/src/lib/collision_detection/obb_tree.cc	(revision 5717)
@@ -87,6 +87,5 @@
     this->flushTree();
   }
-  OBBTreeNode* node = new OBBTreeNode(*this, depth);
-  this->rootNode = node;
+  this->rootNode = new OBBTreeNode(*this, depth-1);
 
   /* triangles indexes created */
@@ -97,4 +96,6 @@
   this->rootNode->spawnBVTree(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 5716)
+++ branches/collision_detection/src/lib/collision_detection/obb_tree.h	(revision 5717)
@@ -34,6 +34,6 @@
     virtual void drawBV(int depth, int drawMode) const;
 
-    int getID() { return ++this->id;}
-    inline OBBTreeNode* getRootNode() { return this->rootNode; }
+    const int getID() { return ++this->id;}
+    inline const OBBTreeNode* getRootNode() const { return this->rootNode; }
 
     void debug();
Index: branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5716)
+++ branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc	(revision 5717)
@@ -600,5 +600,5 @@
 
 
-void OBBTreeNode::collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB)
+void OBBTreeNode::collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) const
 {
   PRINTF(3)("collideWith\n");
@@ -645,5 +645,5 @@
 
 
-bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB)
+bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB) const
 {
   if( boxB == NULL || boxA == NULL)
Index: branches/collision_detection/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- branches/collision_detection/src/lib/collision_detection/obb_tree_node.h	(revision 5716)
+++ branches/collision_detection/src/lib/collision_detection/obb_tree_node.h	(revision 5717)
@@ -34,5 +34,5 @@
     virtual void spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, unsigned int length);
 
-    virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB);
+    virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) const;
     virtual void drawBV(int depth, int drawMode, const Vector& color = Vector(1,0,0), bool top = true) const;
     void debug() const;
@@ -48,5 +48,5 @@
     void forkBox(OBB& box);
 
-    bool overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB);
+    bool overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB) const;
 
 
Index: branches/collision_detection/src/world_entities/world_entity.cc
===================================================================
--- branches/collision_detection/src/world_entities/world_entity.cc	(revision 5716)
+++ branches/collision_detection/src/world_entities/world_entity.cc	(revision 5717)
@@ -104,5 +104,8 @@
   }
   else
-    this->model = NULL;
+  {
+        this->model = NULL;
+        this->obbTree = NULL;
+  }
 }
 
@@ -113,12 +116,6 @@
 bool WorldEntity::buildObbTree(unsigned int depth)
 {
-  if (this->obbTree)
-    delete this->obbTree;
-
-  if (this->model != NULL)
-  {
+  if( this->model != NULL) {
     PRINTF(4)("creating obb tree\n");
-
-
     //this->obbTree = new OBBTree(depth, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
     this->obbTree = new OBBTree(depth, *model->getModelInfo());
@@ -127,5 +124,5 @@
   else
   {
-    PRINTF(2)("could not create obb-tree, because no model was loaded yet\n");
+    PRINTF(1)("could not create obb-tree, because no model was loaded yet\n");
     this->obbTree = NULL;
     return false;
Index: branches/collision_detection/src/world_entities/world_entity.h
===================================================================
--- branches/collision_detection/src/world_entities/world_entity.h	(revision 5716)
+++ branches/collision_detection/src/world_entities/world_entity.h	(revision 5717)
@@ -47,5 +47,5 @@
   void drawBVTree(unsigned int depth, int drawMode) const;
   /** @returns a reference to the obb tree of this worldentity */
-  BVTree* getOBBTree() const { return this->obbTree; };
+  inline const BVTree* getOBBTree() const { return this->obbTree; };
 
   /* @returns the Count of Faces on this WorldEntity */
@@ -59,5 +59,5 @@
  protected:
   Model*                  model;            //!< The model that should be loaded for this entity.
-  BVTree*                 obbTree;          //!< this is the obb tree reference needed for collision detection
+  const BVTree*           obbTree;          //!< this is the obb tree reference needed for collision detection
   //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
 
