Index: orxonox/trunk/src/story_entities/world.cc
===================================================================
--- orxonox/trunk/src/story_entities/world.cc	(revision 3560)
+++ orxonox/trunk/src/story_entities/world.cc	(revision 3564)
@@ -305,5 +305,5 @@
   glEndList();
 
-  terrain = new Terrain();
+  terrain = new Terrain(TERRAIN_BENSCH);
   this->spawn(terrain);
   // LIGHT initialisation
Index: orxonox/trunk/src/world_entities/terrain.cc
===================================================================
--- orxonox/trunk/src/world_entities/terrain.cc	(revision 3560)
+++ orxonox/trunk/src/world_entities/terrain.cc	(revision 3564)
@@ -28,6 +28,16 @@
 Terrain::Terrain () 
 {
-   this->setClassName ("Terrain");
-   this->build();
+  this->init();
+}
+
+/**
+   \brief a Constructor for the Debug-Worlds
+
+   \todo make it not compileable when not in debug-mode
+*/
+Terrain::Terrain(DebugTerrain debugTerrain)
+{
+  this->init();
+  this->buildDebugTerrain(debugTerrain);
 }
 
@@ -39,139 +49,14 @@
 Terrain::~Terrain () 
 {
-  // delete what has to be deleted here
-  //  delete this->model;
-  
-  glDeleteLists(this->objectList, 1);
-}
-
-
-void Terrain::build()
-{
-  objectList = glGenLists(1);
-  glNewList (objectList, GL_COMPILE);
-
-  glColor3f(1.0,0,0);
-
-  int sizeX = 100;
-  int sizeZ = 80;
-  float length = 1000;
-  float width = 200;
-  float widthX = float (length /sizeX);
-  float widthZ = float (width /sizeZ);
-  
-  float height [sizeX][sizeZ];
-  Vector normal_vectors[sizeX][sizeZ];
-  
-  
-  for ( int i = 0; i<sizeX-1; i+=1)
-    for (int j = 0; j<sizeZ-1;j+=1)
-      //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
-#ifdef __WIN32__
-      height[i][j]=(sin((float)j/3)*rand()*i/182400)*.5;
-#else
-      height[i][j]=(sin((float)j/3)*rand()*(long)i/6282450500.0)*.5;
-#endif
-
-  //Die Huegel ein wenig glaetten
-  for (int h=1; h<2;h++)
-    for (int i=1;i<sizeX-2 ;i+=1 )
-      for(int j=1;j<sizeZ-2;j+=1)
-	height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4;
-  
-  //Berechnung von normalen Vektoren
-  for(int i=1;i<sizeX-2;i+=1)
-    for(int j=1;j<sizeZ-2 ;j+=1)
-      {
-	Vector v1 = Vector (widthX*(1),      height[i][j],      widthZ*(j) );
-	Vector v2 = Vector (widthX*(i-1),    height[i-1][j],    widthZ*(j));
-	Vector v3 = Vector (widthX*(i),      height[i][j+1],    widthZ*(j+1));
-	Vector v4 = Vector (widthX*(i+1),    height[i+1][j],    widthZ*(j));
-	Vector v5 = Vector (widthX*(i),      height[i][j-1],    widthZ*(j-1));
-	
-	Vector c1 = v2 - v1;
-	Vector c2 = v3 - v1;
-	Vector c3=  v4 - v1;
-	Vector c4 = v5 - v1;
-	Vector zero = Vector (0,0,0);
-	normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4);
-	normal_vectors[i][j].normalize();
-      }
-
-  glBegin(GL_QUADS);
-  int snowheight=3;
-  for ( int i = 0; i<sizeX; i+=1)
-    for (int j = 0; j<sizeZ;j+=1)
-      {	  
-	Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
-	Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
-	Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
-	Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
-	float a[3];
-	if(height[i][j]<snowheight){
-	  a[0]=0;
-	  a[1]=1.0-height[i][j]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	    a[0]=1.0;
-	    a[1]=1.0;
-	    a[2]=1.0;
-	    glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	    
-	}
-	glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
-	glVertex3f(v1.x, v1.y, v1.z);
-	if(height[i+1][j]<snowheight){
-	  a[0]=0;
-	  a[1] =1.0-height[i+1][j]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	  a[0]=1.0;
-	  a[1]=1.0;
-	  a[2]=1.0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	  
-	}
-	glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
-	glVertex3f(v2.x, v2.y, v2.z);
-	if(height[i+1][j+1]<snowheight){
-	  a[0]=0;
-	  a[1] =1.0-height[i+1][j+1]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	  a[0]=1.0;
-	  a[1]=1.0;
-	  a[2]=1.0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	  
-	  
-	}
-	glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z);
-	glVertex3f(v3.x, v3.y, v3.z);
-	if(height[i][j+1]<snowheight){
-	  a[0]=0;
-	  a[1] =1.0-height[i+1][j+1]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	  a[0]=1.0;
-	  a[1]=1.0;
-	  a[2]=1.0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z);
-	glVertex3f(v4.x, v4.y, v4.z);
-	
-      }
-  glEnd();
-  glEndList();
-}
-
+  if (objectList)
+    glDeleteLists(this->objectList, 1);
+}
+
+
+void Terrain::init(void)
+{
+   this->setClassName ("Terrain");
+   this->objectList = 0;
+}
 
 
@@ -194,2 +79,169 @@
   glPopMatrix();
 }
+
+
+void Terrain::buildDebugTerrain(DebugTerrain debugTerrain)
+{
+  // if the terrain is the Terrain of Dave
+  if (debugTerrain == TERRAIN_DAVE)
+    {
+      objectList = glGenLists(1);
+      glNewList (objectList, GL_COMPILE);
+      
+      glColor3f(1.0,0,0);
+      
+      int sizeX = 100;
+      int sizeZ = 80;
+      float length = 1000;
+      float width = 200;
+      float widthX = float (length /sizeX);
+      float widthZ = float (width /sizeZ);
+      
+      float height [sizeX][sizeZ];
+      Vector normal_vectors[sizeX][sizeZ];
+      
+      
+      for ( int i = 0; i<sizeX-1; i+=1)
+	for (int j = 0; j<sizeZ-1;j+=1)
+	  //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
+#ifdef __WIN32__
+	  height[i][j]=(sin((float)j/3)*rand()*i/182400)*.5;
+#else
+      height[i][j]=(sin((float)j/3)*rand()*(long)i/6282450500.0)*.5;
+#endif
+      
+      //Die Huegel ein wenig glaetten
+      for (int h=1; h<2;h++)
+	for (int i=1;i<sizeX-2 ;i+=1 )
+	  for(int j=1;j<sizeZ-2;j+=1)
+	    height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4;
+      
+      //Berechnung von normalen Vektoren
+      for(int i=1;i<sizeX-2;i+=1)
+	for(int j=1;j<sizeZ-2 ;j+=1)
+	  {
+	    Vector v1 = Vector (widthX*(1),      height[i][j],      widthZ*(j) );
+	    Vector v2 = Vector (widthX*(i-1),    height[i-1][j],    widthZ*(j));
+	    Vector v3 = Vector (widthX*(i),      height[i][j+1],    widthZ*(j+1));
+	    Vector v4 = Vector (widthX*(i+1),    height[i+1][j],    widthZ*(j));
+	    Vector v5 = Vector (widthX*(i),      height[i][j-1],    widthZ*(j-1));
+	    
+	    Vector c1 = v2 - v1;
+	    Vector c2 = v3 - v1;
+	    Vector c3=  v4 - v1;
+	    Vector c4 = v5 - v1;
+	    Vector zero = Vector (0,0,0);
+	    normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4);
+	    normal_vectors[i][j].normalize();
+	  }
+      
+      glBegin(GL_QUADS);
+      int snowheight=3;
+      for ( int i = 0; i<sizeX; i+=1)
+	for (int j = 0; j<sizeZ;j+=1)
+	  {	  
+	    Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
+	    Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
+	    Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
+	    Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
+	    float a[3];
+	    if(height[i][j]<snowheight){
+	      a[0]=0;
+	      a[1]=1.0-height[i][j]/10-.3;
+	      a[2]=0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    else{
+	      a[0]=1.0;
+	      a[1]=1.0;
+	      a[2]=1.0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	      
+	    }
+	    glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
+	    glVertex3f(v1.x, v1.y, v1.z);
+	    if(height[i+1][j]<snowheight){
+	      a[0]=0;
+	      a[1] =1.0-height[i+1][j]/10-.3;
+	      a[2]=0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    else{
+	      a[0]=1.0;
+	      a[1]=1.0;
+	      a[2]=1.0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	      
+	    }
+	    glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
+	    glVertex3f(v2.x, v2.y, v2.z);
+	    if(height[i+1][j+1]<snowheight){
+	      a[0]=0;
+	      a[1] =1.0-height[i+1][j+1]/10-.3;
+	      a[2]=0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    else{
+	      a[0]=1.0;
+	      a[1]=1.0;
+	      a[2]=1.0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	      
+	      
+	    }
+	    glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z);
+	    glVertex3f(v3.x, v3.y, v3.z);
+	    if(height[i][j+1]<snowheight){
+	      a[0]=0;
+	      a[1] =1.0-height[i+1][j+1]/10-.3;
+	      a[2]=0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    else{
+	      a[0]=1.0;
+	      a[1]=1.0;
+	      a[2]=1.0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z);
+	    glVertex3f(v4.x, v4.y, v4.z);
+	    
+	  }
+      glEnd();
+      glEndList();
+    }
+
+  if (debugTerrain == TERRAIN_BENSCH)
+    {
+      /*
+	this->model = (OBJModel*) new Model();
+      this->model->setName("CUBE");
+      this->model->addVertex (-0.5, -0.5, 0.5);
+      this->model->addVertex (0.5, -0.5, 0.5);
+      this->model->addVertex (-0.5, 0.5, 0.5);
+      this->model->addVertex (0.5, 0.5, 0.5);
+      this->model->addVertex (-0.5, 0.5, -0.5);
+      this->model->addVertex (0.5, 0.5, -0.5);
+      this->model->addVertex (-0.5, -0.5, -0.5);
+      this->model->addVertex (0.5, -0.5, -0.5);
+      
+      this->model->addVertexTexture (0.0, 0.0);
+      this->model->addVertexTexture (1.0, 0.0);
+      this->model->addVertexTexture (0.0, 1.0);
+      this->model->addVertexTexture (1.0, 1.0);
+      this->model->addVertexTexture (0.0, 2.0);
+      this->model->addVertexTexture (1.0, 2.0);
+      this->model->addVertexTexture (0.0, 3.0);
+      this->model->addVertexTexture (1.0, 3.0);
+      this->model->addVertexTexture (0.0, 4.0);
+      this->model->addVertexTexture (1.0, 4.0);
+      this->model->addVertexTexture (2.0, 0.0);
+      this->model->addVertexTexture (2.0, 1.0);
+      this->model->addVertexTexture (-1.0, 0.0);
+      this->model->addVertexTexture (-1.0, 1.0);
+
+      this->model->finalize();
+      */
+    }
+  
+}
Index: orxonox/trunk/src/world_entities/terrain.h
===================================================================
--- orxonox/trunk/src/world_entities/terrain.h	(revision 3560)
+++ orxonox/trunk/src/world_entities/terrain.h	(revision 3564)
@@ -15,4 +15,8 @@
 // FORWARD DEFINITION \\
 
+//! A simple method to call a desired debug world.
+enum DebugTerrain {TERRAIN_DAVE, TERRAIN_BENSCH};
+
+
 //! A Class to handle Terrain of orxonox
 class Terrain : public WorldEntity 
@@ -21,7 +25,9 @@
  public:
   Terrain();
+  Terrain(DebugTerrain debugTerrain);
   virtual ~Terrain();
-
-  void build();
+  void init();
+  
+  void buildDebugTerrain(DebugTerrain debugTerrain);
   virtual void draw();
 
Index: orxonox/trunk/src/world_entities/world_entity.cc
===================================================================
--- orxonox/trunk/src/world_entities/world_entity.cc	(revision 3560)
+++ orxonox/trunk/src/world_entities/world_entity.cc	(revision 3564)
@@ -38,4 +38,5 @@
   this->setClassName ("WorldEntity");
   this->bDraw = true;
+  this->model = NULL;
   //  collisioncluster = NULL;
 }
Index: orxonox/trunk/src/world_entities/world_entity.h
===================================================================
--- orxonox/trunk/src/world_entities/world_entity.h	(revision 3560)
+++ orxonox/trunk/src/world_entities/world_entity.h	(revision 3564)
@@ -9,4 +9,5 @@
 #include "stdincl.h"
 #include "p_node.h"
+#include "model.h"
 
 //class CollisionCluster;
