Index: branches/terrain/src/lib/collision_detection/cd_engine.cc
===================================================================
--- branches/terrain/src/lib/collision_detection/cd_engine.cc	(revision 9135)
+++ branches/terrain/src/lib/collision_detection/cd_engine.cc	(revision 9140)
@@ -24,5 +24,5 @@
 #include "model.h"
 #include "world_entity.h"
-#include "terrain.h"
+#include "terrain_entity.h"
 // #include "player.h"
 
@@ -45,5 +45,5 @@
 
   this->bAbordOnFirstCollision = false;
-  
+
   this->terrain = NULL;
 }
@@ -106,15 +106,40 @@
   std::list<WorldEntity*>::iterator entityIterator;
   const std::list<BaseObject*>* bspList = ClassList::getList(CL_BSP_ENTITY);
-  if( bspList == NULL)
-    return;
+  if( bspList != NULL)
+  {
 
-  // for all bsp managers check all entities
-  for( bspIterator = bspList->begin(); bspIterator != bspList->end(); bspIterator++) {
+    // for all bsp managers check all entities
+    for( bspIterator = bspList->begin(); bspIterator != bspList->end(); bspIterator++)
+    {
       for(entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++)
       {
-//         PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getName(), (*entityIterator)->getClassName());
+        //               PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getName(), (*entityIterator)->getClassName());
         (dynamic_cast<BspEntity*>(*bspIterator)->getBspManager())->checkCollision(*entityIterator);
       }
+    }
   }
+
+  /// COLLISION OF THE Modular-TERRAIN
+/*  const std::list<BaseObject*>* tl = ClassList::getList( CL_TERRAIN );
+  std::list<BaseObject*>::const_iterator ti;
+  if ( tl == NULL )
+    return;
+  float offset = 8.0f;
+  for ( ti = tl->begin(); ti != tl->end(); ++ti )
+  {
+    TerrainEntity* terrain = dynamic_cast<TerrainEntity*>( *ti );
+    for( entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++ )
+    {
+      Vector pos( (*entityIterator)->getAbsCoor() );
+      Vector normal;
+      float height = pos.y;
+      terrain->getAltitude( pos, normal );
+      if ( height-offset < pos.y )
+      {
+        ( *entityIterator )->registerCollision(
+          *entityIterator, terrain, pos, normal );
+      }
+    }
+  }*/
 }
 
@@ -138,6 +163,6 @@
 void CDEngine::debugSpawnTree(int depth, sVec3D* vertices, int numVertices)
 {
-//   if ( this->rootTree == NULL)
-//     this->rootTree = new OBBTree(depth, vertices, numVertices);
+  //   if ( this->rootTree == NULL)
+  //     this->rootTree = new OBBTree(depth, vertices, numVertices);
 }
 
@@ -156,5 +181,5 @@
 void CDEngine::debugDraw(int depth, int drawMode)
 {
-//   if(this-> rootTree != NULL)
-//     this->rootTree->drawBV(depth, drawMode);
+  //   if(this-> rootTree != NULL)
+  //     this->rootTree->drawBV(depth, drawMode);
 }
Index: branches/terrain/src/lib/collision_detection/cd_engine.h
===================================================================
--- branches/terrain/src/lib/collision_detection/cd_engine.h	(revision 9135)
+++ branches/terrain/src/lib/collision_detection/cd_engine.h	(revision 9140)
@@ -16,5 +16,5 @@
 class WorldEntity;
 class OBBTree;
-class Terrain;
+class TerrainEntity;
 class BspManager;
 //class Player;
@@ -50,5 +50,5 @@
   inline void disable(const int options) { int temp = this->state & options; this->state ^= temp; }
 
-  inline void setTerrain(Terrain* terrain) { this->terrain = terrain; }
+  inline void setTerrain( TerrainEntity* terrain) { this->terrain = terrain; }
   inline void setBSPModel(BspManager* bspManager) { this->bspManager = bspManager; }
 
@@ -83,5 +83,5 @@
   OBBTree*                rootTree;                         //!< for testing purposes a root tree
 
-  Terrain*                terrain;                          //!< this it a ref to the terrain, serving as a ground for all WE
+  TerrainEntity*                terrain;                          //!< this it a ref to the terrain, serving as a ground for all WE
   BspManager*             bspManager;
 };
