Index: orxonox/trunk/src/lib/collision_detection/Makefile.am
===================================================================
--- orxonox/trunk/src/lib/collision_detection/Makefile.am	(revision 4539)
+++ orxonox/trunk/src/lib/collision_detection/Makefile.am	(revision 4541)
@@ -8,5 +8,7 @@
 		     obb.cc \
                      obb_tree.cc \
+		     obb_tree_node.cc \
                      bv_tree.cc \
+		     bv_tree_node.cc \
 		     bounding_volume.cc \
 		     bounding_sphere.cc
@@ -19,5 +21,7 @@
 		     obb.h \
                      obb_tree.h \
+		     obb_tree_node.h \
                      bv_tree.h \
+		     bv_tree_node.h \
 		     bounding_volume.h \
 		     bounding_sphere.h
Index: orxonox/trunk/src/lib/collision_detection/Makefile.in
===================================================================
--- orxonox/trunk/src/lib/collision_detection/Makefile.in	(revision 4539)
+++ orxonox/trunk/src/lib/collision_detection/Makefile.in	(revision 4541)
@@ -55,5 +55,6 @@
 libORXcd_a_LIBADD =
 am_libORXcd_a_OBJECTS = cd_engine.$(OBJEXT) collision.$(OBJEXT) \
-	obb.$(OBJEXT) obb_tree.$(OBJEXT) bv_tree.$(OBJEXT) \
+	obb.$(OBJEXT) obb_tree.$(OBJEXT) obb_tree_node.$(OBJEXT) \
+	bv_tree.$(OBJEXT) bv_tree_node.$(OBJEXT) \
 	bounding_volume.$(OBJEXT) bounding_sphere.$(OBJEXT)
 libORXcd_a_OBJECTS = $(am_libORXcd_a_OBJECTS)
@@ -63,7 +64,8 @@
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bounding_sphere.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/bounding_volume.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/bv_tree.Po ./$(DEPDIR)/cd_engine.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/collision.Po ./$(DEPDIR)/obb.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/obb_tree.Po
+@AMDEP_TRUE@	./$(DEPDIR)/bv_tree.Po ./$(DEPDIR)/bv_tree_node.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/cd_engine.Po ./$(DEPDIR)/collision.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/obb.Po ./$(DEPDIR)/obb_tree.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/obb_tree_node.Po
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -191,5 +193,7 @@
 		     obb.cc \
                      obb_tree.cc \
+		     obb_tree_node.cc \
                      bv_tree.cc \
+		     bv_tree_node.cc \
 		     bounding_volume.cc \
 		     bounding_sphere.cc
@@ -200,5 +204,7 @@
 		     obb.h \
                      obb_tree.h \
+		     obb_tree_node.h \
                      bv_tree.h \
+		     bv_tree_node.h \
 		     bounding_volume.h \
 		     bounding_sphere.h
@@ -254,8 +260,10 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bounding_volume.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bv_tree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bv_tree_node.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cd_engine.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obb.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obb_tree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obb_tree_node.Po@am__quote@
 
 .cc.o:
Index: orxonox/trunk/src/lib/collision_detection/bounding_volume.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/bounding_volume.h	(revision 4539)
+++ orxonox/trunk/src/lib/collision_detection/bounding_volume.h	(revision 4541)
@@ -12,4 +12,6 @@
 class sVect3D;
 class Vector;
+template<class T> class tList;
+
 
 //! An abstract class representing a bounding volume
@@ -20,8 +22,9 @@
   virtual ~BoundingVolume();
 
+  virtual void createBV() = NULL;
+
   inline const Vector* getCenter() const { return this->center; }
-  inline const int getIndex() { return this->treeIndex; }
 
-  virtual sVect3D* getVertices() const = NULL;
+  virtual tList<sVect3D>* getVertices() const = NULL;
   virtual void mergeWith(const BoundingVolume &bv) = NULL;
 
@@ -34,5 +37,5 @@
   Vector*             center;                     //!< Center point of box
 
-  unsigned int        treeIndex;                  //!< Index number of the BV in the tree
+  tList<sVect3D>*     verticesBuffer;             //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
 };
 
Index: orxonox/trunk/src/lib/collision_detection/bv_tree_node.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/bv_tree_node.cc	(revision 4541)
+++ orxonox/trunk/src/lib/collision_detection/bv_tree_node.cc	(revision 4541)
@@ -0,0 +1,42 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION
+
+#include "bv_tree_node.h"
+
+using namespace std;
+
+
+/**
+   \brief standard constructor
+*/
+BVTreeNode::BVTreeNode () 
+{
+   this->setClassID(CL_BV_TREE_NODE, "BVTreeNode"); 
+
+}
+
+
+/**
+   \brief standard deconstructor
+
+*/
+BVTreeNode::~BVTreeNode () 
+{
+  // delete what has to be deleted here
+}
+
+
Index: orxonox/trunk/src/lib/collision_detection/bv_tree_node.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/bv_tree_node.h	(revision 4541)
+++ orxonox/trunk/src/lib/collision_detection/bv_tree_node.h	(revision 4541)
@@ -0,0 +1,41 @@
+/*! 
+    \file bv_tree.h
+    \brief Definition of a bounding volume tree
+
+*/
+
+#ifndef _BV_TREE_NODE_H
+#define _BV_TREE_NODE_H
+
+#include "base_object.h"
+
+// FORWARD DEFINITION
+class BoundingVolume;
+class sVec3D;
+class BVTree;
+
+//! A class that represents a bounding volume tree
+class BVTreeNode : public BaseObject {
+
+ public:
+  BVTreeNode();
+  virtual ~BVTreeNode();
+
+  virtual void spawnBVTree(int depth) = NULL;
+
+  virtual BoundingVolume* getBV(int index) const = NULL;
+  inline const int getIndex() { return this->treeIndex; }  
+
+  virtual void collideWith(const BVTree &tree) = NULL;
+
+  virtual void drawBV(int currentDepth, const int depth) const = NULL;
+  virtual void drawBVPolygon(int currentDepth, const int depth) const = NULL;
+  virtual void drawBVBlended(int currentDepth, const int depth) const = NULL;
+
+
+ private:
+  unsigned int        treeIndex;                  //!< Index number of the BV in the tree
+
+};
+
+#endif /* _BV_TREE_NODE_H */
Index: orxonox/trunk/src/lib/collision_detection/cd_engine.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/cd_engine.h	(revision 4539)
+++ orxonox/trunk/src/lib/collision_detection/cd_engine.h	(revision 4541)
@@ -22,5 +22,7 @@
     CD_DEBUG_DRAW_BLENDED = 1<<2,
     CD_DEBUG_DRAW_HIT_BV = 1<<3,
-    CD_DEBUG_VERBOSE = 1<<4
+    CD_DEBUG_VERBOSE = 1<<4,
+
+    CD_STORE_VERTICES = 1<<5
   };
 
Index: orxonox/trunk/src/lib/collision_detection/obb.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb.cc	(revision 4539)
+++ orxonox/trunk/src/lib/collision_detection/obb.cc	(revision 4541)
@@ -17,4 +17,5 @@
 
 #include "obb.h"
+#include "list.h"
 
 using namespace std;
@@ -40,5 +41,5 @@
 
 
-sVect3D* OBB::getVertices() const
+void OBB::createBV() const
 {}
 
Index: orxonox/trunk/src/lib/collision_detection/obb.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb.h	(revision 4539)
+++ orxonox/trunk/src/lib/collision_detection/obb.h	(revision 4541)
@@ -11,4 +11,5 @@
 #include "bounding_volume.h"
 
+template<class T> class tList;
 
 //! A class representing an extended bounding volume tree: an obb tree
@@ -19,8 +20,10 @@
   virtual ~OBB();
 
+  virtual void createBV() const;
+
   inline const Vector* getAxis () const { return this->axis; }
   inline const sVect3D* getHalfLength() const { return this->halfLength; } 
 
-  virtual sVect3D* getVertices() const;
+  virtual tList<sVect3D>* getVertices() const { return this->verticesBuffer; }
   virtual void mergeWith(const BoundingVolume &bv);
 
Index: orxonox/trunk/src/lib/collision_detection/obb_tree.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree.cc	(revision 4539)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree.cc	(revision 4541)
@@ -44,5 +44,10 @@
 void OBBTree::spawnBVTree(int depth)
 {
-  OBB obb();
+  float area[this->numberOfVertices];  //!< surface area of the i'th triangle of the convex hull
+  float areaTotal; //!< surface area of the entire convex hull
+  float centroid[this->numberOfVertices]; //!< centroid of the i'th convex hull
+  
+
+  //OBB obb();
   float muX, muY, muZ;
   for(int i = 0; i < this->numberOfVertices; ++i)
Index: orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4541)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 4541)
@@ -0,0 +1,42 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION
+
+#include "obb_tree_node.h"
+
+using namespace std;
+
+
+/**
+   \brief standard constructor
+*/
+OBBTreeNode::OBBTreeNode () 
+{
+   this->setClassID(CL_OBB_TREE_NODE, "OBBTreeNode"); 
+
+}
+
+
+/**
+   \brief standard deconstructor
+
+*/
+OBBTreeNode::~OBBTreeNode () 
+{
+  // delete what has to be deleted here
+}
+
+
Index: orxonox/trunk/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- orxonox/trunk/src/lib/collision_detection/obb_tree_node.h	(revision 4541)
+++ orxonox/trunk/src/lib/collision_detection/obb_tree_node.h	(revision 4541)
@@ -0,0 +1,47 @@
+/*! 
+    \file bv_tree.h
+    \brief Definition of a bounding volume tree
+
+*/
+
+#ifndef _OBB_TREE_NODE_H
+#define _OBB_TREE_NODE_H
+
+#include "bv_tree_node.h"
+
+// FORWARD DEFINITION
+class BoundingVolume;
+class sVec3D;
+
+//! A class that represents a bounding volume tree
+class OBBTreeNode : public BVTreeNode {
+
+
+ public:
+  OBBTreeNode();
+  virtual ~OBBTreeNode();
+
+  virtual void spawnBVTree(int depth);
+
+  BoundingVolume* getBV(int index) const { return this->bvElement; }
+  inline const int getIndex() { return this->treeIndex; }  
+
+  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;
+
+
+ protected:
+  BoundingVolume* bvElement;
+  OBBTreeNode* nodeLeft;
+  OBBTreeNode* nodeRight;
+
+
+ private:
+  unsigned int        treeIndex;                  //!< Index number of the BV in the tree
+
+};
+
+#endif /* _OBB_TREE_NODE_H */
