Index: branches/cd_merge/src/lib/collision_detection/bv_tree.h
===================================================================
--- branches/cd_merge/src/lib/collision_detection/bv_tree.h	(revision 6657)
+++ branches/cd_merge/src/lib/collision_detection/bv_tree.h	(revision 6890)
@@ -44,5 +44,5 @@
     virtual void flushTree() = 0;
 
-    virtual void collideWith(const WorldEntity& entity1, const WorldEntity& entity2) const = 0;
+    virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2) const = 0;
 
     virtual void drawBV(int depth, int drawMode) const = 0;
Index: branches/cd_merge/src/lib/collision_detection/bv_tree_node.h
===================================================================
--- branches/cd_merge/src/lib/collision_detection/bv_tree_node.h	(revision 6657)
+++ branches/cd_merge/src/lib/collision_detection/bv_tree_node.h	(revision 6890)
@@ -35,5 +35,5 @@
 
   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 collideWith(const BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) = 0;
   virtual void drawBV(int depth, int drawMode, const Vector& color = Vector(1,0,0), bool top = true) const = 0;
 
Index: branches/cd_merge/src/lib/collision_detection/obb_tree.cc
===================================================================
--- branches/cd_merge/src/lib/collision_detection/obb_tree.cc	(revision 6657)
+++ branches/cd_merge/src/lib/collision_detection/obb_tree.cc	(revision 6890)
@@ -31,10 +31,10 @@
  *  standard constructor
 */
-OBBTree::OBBTree(int depth, const modelInfo& modelInf)
+OBBTree::OBBTree(int depth, const modelInfo* modelInf)
   : BVTree()
 {
   this->depth = depth;
   this->init();
-  this->spawnBVTree(modelInf);
+  this->spawnBVTree(*modelInf);
 }
 
@@ -92,8 +92,8 @@
  * @param nodeB: Pnode of object B
  */
-void OBBTree::collideWith(const WorldEntity& entity1, const WorldEntity& entity2) const
+void OBBTree::collideWith(WorldEntity* entity1, WorldEntity* entity2) const
 {
-  if( likely(entity2.getOBBTree() != NULL) )
-    this->rootNode->collideWith(*(((OBBTree*)entity2.getOBBTree())->getRootNode()), entity1, entity2);
+  if( likely(entity2->getOBBTree() != NULL) )
+    this->rootNode->collideWith(((OBBTree*)entity2->getOBBTree())->getRootNode(), entity1, entity2);
 }
 
Index: branches/cd_merge/src/lib/collision_detection/obb_tree.h
===================================================================
--- branches/cd_merge/src/lib/collision_detection/obb_tree.h	(revision 6657)
+++ branches/cd_merge/src/lib/collision_detection/obb_tree.h	(revision 6890)
@@ -21,5 +21,5 @@
 
   public:
-    OBBTree(int depth, const modelInfo& modInfo);
+    OBBTree(int depth, const modelInfo* modInfo);
     virtual ~OBBTree();
     void init();
@@ -28,5 +28,5 @@
     virtual void flushTree();
 
-    virtual void collideWith(const WorldEntity& entity1, const WorldEntity& entity2) const;
+    virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2) const;
     virtual void drawBV(int depth, int drawMode) const;
 
Index: branches/cd_merge/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- branches/cd_merge/src/lib/collision_detection/obb_tree_node.cc	(revision 6657)
+++ branches/cd_merge/src/lib/collision_detection/obb_tree_node.cc	(revision 6890)
@@ -515,24 +515,24 @@
 
 
-void OBBTreeNode::collideWith(const BVTreeNode& treeNode, const WorldEntity& nodeA, const WorldEntity& nodeB) const
+void OBBTreeNode::collideWith(const BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB)
 {
   PRINTF(3)("collideWith\n");
   /* if the obb overlap, make subtests: check which node is realy overlaping  */
-  PRINTF(3)("Checking OBB %i vs %i: ", this->getIndex(), treeNode.getIndex());
+  PRINTF(3)("Checking OBB %i vs %i: ", this->getIndex(), treeNode->getIndex());
   //   if( unlikely(treeNode == NULL)) return;
 
 
-  if( this->overlapTest(*this->bvElement, *(((const OBBTreeNode*)&treeNode)->bvElement), nodeA, nodeB))
-  {
-    PRINTF(3)("collision @ lvl %i, object %s vs. %s, (%p, %p)\n", this->depth, nodeA.getClassName(), nodeB.getClassName(), this->nodeLeft, this->nodeRight);
+  if( this->overlapTest(this->bvElement, ((const OBBTreeNode*)&treeNode)->bvElement, nodeA, nodeB))
+  {
+    PRINTF(3)("collision @ lvl %i, object %s vs. %s, (%p, %p)\n", this->depth, nodeA->getClassName(), nodeB->getClassName(), this->nodeLeft, this->nodeRight);
 
     /* check if left node overlaps */
     if( likely( this->nodeLeft != NULL))
     {
-      PRINTF(3)("Checking OBB %i vs %i: ", this->nodeLeft->getIndex(), treeNode.getIndex());
-      if( this->overlapTest(*this->nodeLeft->bvElement, *(((const OBBTreeNode*)&treeNode)->bvElement), nodeA, nodeB))
+      PRINTF(3)("Checking OBB %i vs %i: ", this->nodeLeft->getIndex(), treeNode->getIndex());
+      if( this->overlapTest(this->nodeLeft->bvElement, ((const OBBTreeNode*)&treeNode)->bvElement, nodeA,nodeB))
       {
-        this->nodeLeft->collideWith(*(((const OBBTreeNode*)&treeNode)->nodeLeft), nodeA, nodeB);
-        this->nodeLeft->collideWith(*(((const OBBTreeNode*)&treeNode)->nodeRight), nodeA, nodeB);
+        this->nodeLeft->collideWith(((const OBBTreeNode*)&treeNode)->nodeLeft, nodeA, nodeB);
+        this->nodeLeft->collideWith(((const OBBTreeNode*)&treeNode)->nodeRight, nodeA, nodeB);
       }
     }
@@ -540,9 +540,9 @@
     if( likely( this->nodeRight != NULL))
     {
-      PRINTF(3)("Checking OBB %i vs %i: ", this->nodeRight->getIndex(), treeNode.getIndex());
-      if(this->overlapTest(*this->nodeRight->bvElement, *(((const OBBTreeNode*)&treeNode)->bvElement), nodeA, nodeB))
+      PRINTF(3)("Checking OBB %i vs %i: ", this->nodeRight->getIndex(), treeNode->getIndex());
+      if(this->overlapTest(this->nodeRight->bvElement, ((const OBBTreeNode*)&treeNode)->bvElement, nodeA, nodeB))
       {
-        this->nodeRight->collideWith(*(((const OBBTreeNode*)&treeNode)->nodeLeft), nodeA, nodeB);
-        this->nodeRight->collideWith(*(((const OBBTreeNode*)&treeNode)->nodeRight), nodeA, nodeB);
+        this->nodeRight->collideWith(((const OBBTreeNode*)&treeNode)->nodeLeft, nodeA, nodeB);
+        this->nodeRight->collideWith(((const OBBTreeNode*)&treeNode)->nodeRight, nodeA, nodeB);
       }
     }
@@ -552,15 +552,15 @@
     if( unlikely(this->nodeRight == NULL && this->nodeLeft == NULL))
     {
-      nodeA.collidesWith(nodeB, (((const OBBTreeNode*)&treeNode)->bvElement->center));
-
-      nodeB.collidesWith(nodeA, this->bvElement->center);
-    }
-
-  }
-}
-
-
-
-bool OBBTreeNode::overlapTest(const OBB& boxA, const OBB& boxB, const WorldEntity& nodeA, const WorldEntity& nodeB) const
+      nodeA->collidesWith(nodeB, ((const OBBTreeNode*)&treeNode)->bvElement->center);
+
+      nodeB->collidesWith(nodeA, this->bvElement->center);
+    }
+
+  }
+}
+
+
+
+bool OBBTreeNode::overlapTest(const OBB* boxA, const OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB)
 {
   //   if( boxB == NULL || boxA == NULL)
@@ -575,14 +575,14 @@
   Vector rotAxisB[3];
 
-  rotAxisA[0] =  nodeA.getAbsDir().apply(boxA.axis[0]);
-  rotAxisA[1] =  nodeA.getAbsDir().apply(boxA.axis[1]);
-  rotAxisA[2] =  nodeA.getAbsDir().apply(boxA.axis[2]);
-
-  rotAxisB[0] =  nodeB.getAbsDir().apply(boxB.axis[0]);
-  rotAxisB[1] =  nodeB.getAbsDir().apply(boxB.axis[1]);
-  rotAxisB[2] =  nodeB.getAbsDir().apply(boxB.axis[2]);
-
-
-  t = nodeA.getAbsCoor() + nodeA.getAbsDir().apply(boxA.center) - ( nodeB.getAbsCoor() + nodeB.getAbsDir().apply(boxB.center));
+  rotAxisA[0] =  nodeA->getAbsDir().apply(boxA->axis[0]);
+  rotAxisA[1] =  nodeA->getAbsDir().apply(boxA->axis[1]);
+  rotAxisA[2] =  nodeA->getAbsDir().apply(boxA->axis[2]);
+
+  rotAxisB[0] =  nodeB->getAbsDir().apply(boxB->axis[0]);
+  rotAxisB[1] =  nodeB->getAbsDir().apply(boxB->axis[1]);
+  rotAxisB[2] =  nodeB->getAbsDir().apply(boxB->axis[2]);
+
+
+  t = nodeA->getAbsCoor() + nodeA->getAbsDir().apply(boxA->center) - ( nodeB->getAbsCoor() + nodeB->getAbsDir().apply(boxB->center));
 
   //   printf("\n");
@@ -603,11 +603,11 @@
     l = rotAxisA[j];
 
-    rA += fabs(boxA.halfLength[0] * rotAxisA[0].dot(l));
-    rA += fabs(boxA.halfLength[1] * rotAxisA[1].dot(l));
-    rA += fabs(boxA.halfLength[2] * rotAxisA[2].dot(l));
-
-    rB += fabs(boxB.halfLength[0] * rotAxisB[0].dot(l));
-    rB += fabs(boxB.halfLength[1] * rotAxisB[1].dot(l));
-    rB += fabs(boxB.halfLength[2] * rotAxisB[2].dot(l));
+    rA += fabs(boxA->halfLength[0] * rotAxisA[0].dot(l));
+    rA += fabs(boxA->halfLength[1] * rotAxisA[1].dot(l));
+    rA += fabs(boxA->halfLength[2] * rotAxisA[2].dot(l));
+
+    rB += fabs(boxB->halfLength[0] * rotAxisB[0].dot(l));
+    rB += fabs(boxB->halfLength[1] * rotAxisB[1].dot(l));
+    rB += fabs(boxB->halfLength[2] * rotAxisB[2].dot(l));
 
     PRINTF(3)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
@@ -627,11 +627,11 @@
     l = rotAxisB[j];
 
-    rA += fabs(boxA.halfLength[0] * rotAxisA[0].dot(l));
-    rA += fabs(boxA.halfLength[1] * rotAxisA[1].dot(l));
-    rA += fabs(boxA.halfLength[2] * rotAxisA[2].dot(l));
-
-    rB += fabs(boxB.halfLength[0] * rotAxisB[0].dot(l));
-    rB += fabs(boxB.halfLength[1] * rotAxisB[1].dot(l));
-    rB += fabs(boxB.halfLength[2] * rotAxisB[2].dot(l));
+    rA += fabs(boxA->halfLength[0] * rotAxisA[0].dot(l));
+    rA += fabs(boxA->halfLength[1] * rotAxisA[1].dot(l));
+    rA += fabs(boxA->halfLength[2] * rotAxisA[2].dot(l));
+
+    rB += fabs(boxB->halfLength[0] * rotAxisB[0].dot(l));
+    rB += fabs(boxB->halfLength[1] * rotAxisB[1].dot(l));
+    rB += fabs(boxB->halfLength[2] * rotAxisB[2].dot(l));
 
     PRINTF(3)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
@@ -655,11 +655,11 @@
       l = rotAxisA[j].cross(rotAxisB[k]);
 
-      rA += fabs(boxA.halfLength[0] * rotAxisA[0].dot(l));
-      rA += fabs(boxA.halfLength[1] * rotAxisA[1].dot(l));
-      rA += fabs(boxA.halfLength[2] * rotAxisA[2].dot(l));
-
-      rB += fabs(boxB.halfLength[0] * rotAxisB[0].dot(l));
-      rB += fabs(boxB.halfLength[1] * rotAxisB[1].dot(l));
-      rB += fabs(boxB.halfLength[2] * rotAxisB[2].dot(l));
+      rA += fabs(boxA->halfLength[0] * rotAxisA[0].dot(l));
+      rA += fabs(boxA->halfLength[1] * rotAxisA[1].dot(l));
+      rA += fabs(boxA->halfLength[2] * rotAxisA[2].dot(l));
+
+      rB += fabs(boxB->halfLength[0] * rotAxisB[0].dot(l));
+      rB += fabs(boxB->halfLength[1] * rotAxisB[1].dot(l));
+      rB += fabs(boxB->halfLength[2] * rotAxisB[2].dot(l));
 
       PRINTF(3)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
@@ -674,6 +674,6 @@
 
   /* FIXME: there is no collision mark set now */
-  //   boxA.bCollided = true; /* use this ONLY(!!!!) for drawing operations */
-  //   boxB.bCollided = true;
+  //   boxA->bCollided = true; /* use this ONLY(!!!!) for drawing operations */
+  //   boxB->bCollided = true;
 
 
Index: branches/cd_merge/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- branches/cd_merge/src/lib/collision_detection/obb_tree_node.h	(revision 6657)
+++ branches/cd_merge/src/lib/collision_detection/obb_tree_node.h	(revision 6890)
@@ -9,4 +9,5 @@
 
 #include "bv_tree_node.h"
+#include "plane.h"
 
 
@@ -32,5 +33,5 @@
     virtual void spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, int length);
 
-    virtual void collideWith(const BVTreeNode& treeNode, const WorldEntity& nodeA, const WorldEntity& nodeB) const;
+    virtual void collideWith(const BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB);
     virtual void drawBV(int depth, int drawMode, const Vector& color = Vector(1,0,0), bool top = true) const;
     void debug() const;
@@ -48,5 +49,5 @@
     void forkBox(OBB& box);
 
-    bool overlapTest(const OBB& boxA, const OBB& boxB, const WorldEntity& nodeA, const WorldEntity& nodeB) const;
+    bool overlapTest(const OBB* boxA, const OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB);
 
 
