Index: branches/current_cd/src/lib/collision_detection/cd_engine.cc
===================================================================
--- branches/current_cd/src/lib/collision_detection/cd_engine.cc	(revision 6919)
+++ branches/current_cd/src/lib/collision_detection/cd_engine.cc	(revision 6921)
@@ -59,51 +59,6 @@
 
 /**
- *  this is the collision checking function
-
-    there are some speed improvements that can be done here. a rewrite of the list a would be appropriate to
-    be able to enhance iteration speed.
+ *
  */
-//void CDEngine::checkCollisions()
-//{
-//  this->checkCollisionObjects();
-  //this->checkCollisionGround();
-//}
-
-/**
- *  this checks the collisions with the objects
- */
-//void CDEngine::checkCollisionObjects()
-//{
-//   BVTree* tree;
-//   tIterator<WorldEntity>* iterator1 = entityList->getIterator();
-//   tIterator<WorldEntity>* iterator2 = entityList->getIterator();
-//   WorldEntity* entity1 = iterator1->firstElement();
-//   WorldEntity* entity2 = iterator2->iteratorElement(iterator1);
-//   PRINTF(3)("checking for collisions\n");
-//   while( entity1 != NULL)
-//   {
-//     if( likely(entity1 != this->terrain))
-//     {
-//       entity2 = iterator2->nextElement();
-//
-//       while( entity2 != NULL)
-//       {
-//         if( likely(entity2 != this->terrain))
-//         {
-//           PRINTF(4)("checking object %s against %s\n", entity1->getName(), entity2->getName());
-//           tree = entity1->getOBBTree();
-//           if( likely(tree != NULL) && entity2->getOBBTree() != NULL) tree->collideWith(entity1, entity2);
-//         }
-//         entity2 = iterator2->nextElement();
-//       }
-//     }
-//     entity1 = iterator1->nextElement();
-//     entity2 = iterator2->iteratorElement(iterator1);
-//     entity2 = iterator2->nextElement();
-//   }
-//   delete iterator1;
-//   delete iterator2;
-//}
-
 void CDEngine::checkCollisions(std::list<WorldEntity*>& list1, std::list<WorldEntity*>& list2)
 {
@@ -151,25 +106,4 @@
 
 /**
- *  this draws the bounding volume tree
- * @param depth until which depth to draw the tree
- * @param drawMode mod which states how to draw it
- */
-void CDEngine::drawBV(int depth, int drawMode) const
-{
-  /* this would operate on  worldList bases, for testing purposes, we only use one OBBTree */
-  //this->rootTree->drawBV(depth, drawMode);
-  /// FIXME
-/*  tIterator<WorldEntity>* iterator = entityList->getIterator();
-  WorldEntity* entity = iterator->firstElement();
-  while( entity != NULL)
-  {
-    entity->drawBVTree(depth, drawMode);
-    entity = iterator->nextElement();
-  }
-  delete iterator;*/
-}
-
-
-/**
  * some debug output on the class
  */
@@ -199,6 +133,5 @@
   std::list<WorldEntity*>::const_iterator entity;
   for (entity = drawList.begin(); entity != drawList.end(); entity++)
-    if ((*entity)->isVisible())
-      (*entity)->drawBVTree(3, 226);
+    (*entity)->drawBVTree(1, 226);
 }
 
Index: branches/current_cd/src/lib/collision_detection/cd_engine.h
===================================================================
--- branches/current_cd/src/lib/collision_detection/cd_engine.h	(revision 6919)
+++ branches/current_cd/src/lib/collision_detection/cd_engine.h	(revision 6921)
@@ -50,9 +50,5 @@
 
   inline void setTerrain(Terrain* terrain) { this->terrain = terrain; }
-  //  inline void setPlayer(Player* player) { this->player = player; } /* only for debug purposes \todo: delete*/
 
-  void drawBV(int depth, int drawMode) const;
-
-//  void checkCollisions();
   void checkCollisions(std::list<WorldEntity*>& list1, std::list<WorldEntity*>& list2);
 
Index: branches/current_cd/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- branches/current_cd/src/lib/collision_detection/obb_tree_node.cc	(revision 6919)
+++ branches/current_cd/src/lib/collision_detection/obb_tree_node.cc	(revision 6921)
@@ -515,6 +515,9 @@
 
 
-void OBBTreeNode::collideWith(const BVTreeNode& treeNode, WorldEntity* nodeA, WorldEntity* nodeB)
-{
+void OBBTreeNode::collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB)
+{
+  if( unlikely(treeNode == 1))
+    return;
+
   PRINTF(3)("collideWith\n");
   /* if the obb overlap, make subtests: check which node is realy overlaping  */
@@ -772,8 +775,11 @@
     }
 
-    if( this->nodeLeft == NULL || this->nodeRight == NULL)
+    if( this->nodeLeft == NULL && this->nodeRight == NULL)
       depth = 0;
+
     if( !(drawMode & DRAW_SINGLE && depth != 0))
     {
+      PRINTF(0)("debug poly draw: depth: %i, mode: %i\n", depth, drawMode);
+
       Vector cen = this->bvElement->center;
       Vector* axis = this->bvElement->axis;
