Index: /orxonox/branches/shadows/src/Makefile.am
===================================================================
--- /orxonox/branches/shadows/src/Makefile.am	(revision 3697)
+++ /orxonox/branches/shadows/src/Makefile.am	(revision 3698)
@@ -38,5 +38,6 @@
 		 curve.cc \
 		 glmenu_imagescreen.cc\
-		 shadow.cc
+		 shadow.cc \
+		 skysphere.cc
 
 
@@ -80,7 +81,8 @@
 		 curve.h \
 		 glmenu_imagescreen.h \
-		 debug.h
 		 debug.h \
-		 shadow.h
+		 debug.h \
+		 shadow.h \
+		 skysphere.h
 
 
Index: /orxonox/branches/shadows/src/Makefile.in
===================================================================
--- /orxonox/branches/shadows/src/Makefile.in	(revision 3697)
+++ /orxonox/branches/shadows/src/Makefile.in	(revision 3698)
@@ -64,5 +64,6 @@
 	base_object.$(OBJEXT) helper_parent.$(OBJEXT) \
 	track_manager.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \
-	glmenu_imagescreen.$(OBJEXT) shadow.$(OBJEXT)
+	glmenu_imagescreen.$(OBJEXT) shadow.$(OBJEXT) \
+	skysphere.$(OBJEXT)
 orxonox_OBJECTS = $(am_orxonox_OBJECTS)
 orxonox_LDADD = $(LDADD)
@@ -86,4 +87,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/player.Po ./$(DEPDIR)/shadow.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/skysphere.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/track.Po ./$(DEPDIR)/track_manager.Po \
@@ -240,5 +242,6 @@
 		 curve.cc \
 		 glmenu_imagescreen.cc\
-		 shadow.cc
+		 shadow.cc \
+		 skysphere.cc
 
 noinst_HEADERS = ability.h \
@@ -281,5 +284,8 @@
 		 curve.h \
 		 glmenu_imagescreen.h \
-		 debug.h
+		 debug.h \
+		 debug.h \
+		 shadow.h \
+		 skysphere.h
 
 EXTRA_DIST = orxonox.conf
@@ -309,7 +315,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/Makefile
+	  $(AUTOMAKE) --foreign  src/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -387,4 +393,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skysphere.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/story_entity.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
@@ -749,6 +756,4 @@
 	uninstall-binPROGRAMS uninstall-info-am
 
-		 debug.h \
-		 shadow.h
 
 #  uncomment the following if orxonox requires the math library
Index: /orxonox/branches/shadows/src/camera.cc
===================================================================
--- /orxonox/branches/shadows/src/camera.cc	(revision 3697)
+++ /orxonox/branches/shadows/src/camera.cc	(revision 3698)
@@ -171,5 +171,5 @@
 	{
 	  //FIXME: camera should be made via relative coordinates
-	  Vector* cameraOffset = new Vector (-10, 5, 0);
+	  Vector* cameraOffset = new Vector (-22, 10, 0);
 	  this->setRelCoor (cameraOffset);
 	} 
Index: /orxonox/branches/shadows/src/console/Makefile.in
===================================================================
--- /orxonox/branches/shadows/src/console/Makefile.in	(revision 3697)
+++ /orxonox/branches/shadows/src/console/Makefile.in	(revision 3698)
@@ -195,7 +195,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/console/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/console/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/console/Makefile
+	  $(AUTOMAKE) --foreign  src/console/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Index: /orxonox/branches/shadows/src/gui/Makefile.in
===================================================================
--- /orxonox/branches/shadows/src/gui/Makefile.in	(revision 3697)
+++ /orxonox/branches/shadows/src/gui/Makefile.in	(revision 3698)
@@ -222,7 +222,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/gui/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/gui/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/gui/Makefile
+	  $(AUTOMAKE) --foreign  src/gui/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Index: /orxonox/branches/shadows/src/importer/Makefile.in
===================================================================
--- /orxonox/branches/shadows/src/importer/Makefile.in	(revision 3697)
+++ /orxonox/branches/shadows/src/importer/Makefile.in	(revision 3698)
@@ -207,7 +207,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/importer/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/importer/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/importer/Makefile
+	  $(AUTOMAKE) --foreign  src/importer/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Index: /orxonox/branches/shadows/src/player.cc
===================================================================
--- /orxonox/branches/shadows/src/player.cc	(revision 3697)
+++ /orxonox/branches/shadows/src/player.cc	(revision 3698)
@@ -66,5 +66,5 @@
   bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
   bFire = false;
-  acceleration = 10.0;
+  acceleration = 20.0;
   setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
 }
@@ -103,5 +103,5 @@
   glLoadIdentity();
   float matrix[4][4];
-  
+  //glRotatef(90.0f,1.0f,0.0f,0.0f); 
   /* translate */
   glTranslatef (this->getAbsCoor ().x, 
@@ -111,5 +111,5 @@
   this->getAbsDir ().matrix (matrix);
   glMultMatrixf((float*)matrix);
-  
+  glRotatef(angle,1.0f,0.0f,0.0f);
   glMatrixMode(GL_MODELVIEW);
   this->model->draw();
@@ -132,5 +132,7 @@
 void Player::move (float time)
 {
+ 
   Vector accel(0.0, 0.0, 0.0);
+  
   /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
   //Placement *pos = getPlacement();
@@ -138,14 +140,20 @@
   /* calculate the direction in which the craft is heading  */
   Vector direction (1.0, 0.0, 0.0);
+    
+  
+  
   //direction = this->absDirection.apply (direction);
   Vector orthDirection (0.0, 0.0, 1.0);
+  
   //orthDirection = orthDirection.cross (direction);
 
-  if( bUp) { accel = accel+(direction*acceleration); }
-  if( bDown) { accel = accel-(direction*acceleration); }
-  if( bLeft ) { accel = accel - (orthDirection*acceleration); }
-  if( bRight ) { accel = accel + (orthDirection*acceleration); }
+  if( bUp) { accel = accel+(direction*acceleration);accelSlipDirection=accel; }
+  if( bDown) { accel = accel-(direction*acceleration);accelSlipDirection=accel; }
+  if( bLeft ) {if(angle<0) {accel = accel-(orthDirection*acceleration);}rotate(time);accelSlip=accel; }
+  if( bRight ) { if(angle>0){accel = accel+(orthDirection*acceleration);}rotate(time);accelSlip=accel;}
   if( bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */}
   if( bDescend) {/* FIXME */} /* \todo up and down player movement */
+  if((int)angle!=0&&!bLeft&&!bRight){backRotate(time);accelSlip=accelSlip-slip(time,accelSlip);}
+  if(!bUp&&!bDown){accelSlipDirection=accelSlipDirection-slip(time,accelSlipDirection);}
 
   //Location* l = getLocation();
@@ -159,10 +167,50 @@
   //l->dist = l->dist + travelSpeed * time;
   
-  Vector* shift = new Vector (this->travelSpeed * time, 0, 0);
-  this->shiftCoor (shift);
+  //Vector* shift = new Vector (this->travelSpeed * time, 0, 0);
+  Vector shift(this->travelSpeed*time,0,0);
+  
+  this->shiftCoor (&shift);
   
   /* this updates the player position on the track - user interaction */
   //l->pos = l->pos + accel*time;
+  
   Vector move = accel * time;
   this->shiftCoor (&move);
-}
+  
+}
+void Player::rotate(float time){
+    if(bLeft&&angle>-40.0f){
+	angle=angle-time*200.0f;
+		
+    }
+    if(bRight&&angle<40.0f){
+        angle=angle+time*200.0f;
+		
+    }
+}
+
+void Player::backRotate(float time){
+    if(angle<0){
+    angle=angle+3.0f*(exp(angle*.0015f*time));
+    
+    
+    }
+    if(angle>0){
+    angle=angle-3.0f*(exp(-angle*.0015f*time));
+    
+    
+    }
+
+}
+//When the sidewords movement is finished, the ship will still slip untill it stands still
+Vector Player::slip(float time,Vector accel){
+	Vector move= accel*time;
+	this->shiftCoor(&move);
+	return accel*time*3.0f;
+    
+}
+
+
+
+
+
Index: /orxonox/branches/shadows/src/player.h
===================================================================
--- /orxonox/branches/shadows/src/player.h	(revision 3697)
+++ /orxonox/branches/shadows/src/player.h	(revision 3698)
@@ -32,14 +32,21 @@
   virtual void leftWorld();
   
+  
  private:
   bool bUp, bDown, bLeft, bRight, bAscend, bDescend;
   bool bFire;
+  
   Vector velocity;
+  Vector accelSlip;
+  Vector accelSlipDirection;
   float travelSpeed;
   float acceleration;
+  float angle;
   GLuint objectList;
   
   void move(float time);
-  
+  void rotate(float time);
+  void backRotate(float time);
+  Vector slip (float time,Vector accel);
 };
 
Index: /orxonox/branches/shadows/src/world.cc
===================================================================
--- /orxonox/branches/shadows/src/world.cc	(revision 3697)
+++ /orxonox/branches/shadows/src/world.cc	(revision 3698)
@@ -28,4 +28,6 @@
 #include "helper_parent.h"
 #include "glmenu_imagescreen.h"
+#include "skysphere.h"
+#include "importer/material.h"
 
 using namespace std;
@@ -92,4 +94,6 @@
   {20.0, 10.0, 5.0}, {40.0, -10.0, 0.0},
   {60.0, -10.0, 5.0}, {80.0, 10.0, 5.0}};
+
+
 
 
@@ -286,4 +290,9 @@
 	    orx->getLocalInput()->bind (myPlayer);
 	    
+	    
+	    // create skybox
+	    this->skysphere =new Skysphere();
+	    	    
+	    	    
 	    // bind camera
 	    this->localCamera = new Camera(this);
@@ -330,5 +339,5 @@
 	    this->pathnodes[5] = Vector(30, 50, 0);
 	    
-
+	    
 
 
@@ -368,14 +377,37 @@
 
   // initialize debug coord system
+  
+ 
+  
+  
+    
+ 
+  // Initializing the Ground, and loading a Texture into it.
+  Material* boden = new Material("Ground");
+  boden->setDiffuseMap("../data/pictures/ground.tga");
+  // Setting the illumination mode otherwise it is flat-shaded.
+  boden->setIllum(3);
+  
+    
   objectList = glGenLists(1);
   glNewList (objectList, GL_COMPILE);
   glLoadIdentity();
-  glColor3f(1.0,0,0);
+  //glColor3f(1.0,0,0);
+  
+  // Enabling Textures
+  glEnable(GL_TEXTURE_2D);
+  
+  // Selecting the new Ground Material.
+  boden->select();
+  
+  
   glBegin(GL_QUADS);
-
+  
+  
+  
   int sizeX = 100;
   int sizeZ = 80;
   float length = 1000;
-  float width = 200;
+  float width = 300;
   float widthX = float (length /sizeX);
   float widthZ = float (width /sizeZ);
@@ -419,5 +451,5 @@
       }
 
-  int snowheight=3;
+  
   for ( int i = 0; i<sizeX; i+=1)
     for (int j = 0; j<sizeZ;j+=1)
@@ -428,107 +460,38 @@
 	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);
-	    
-	}
+	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);
+	glTexCoord2f(0.0f,0.0f);
+	//glTexCoord2f((float)i/(float)sizeX,(float)j/(float)sizeZ);
 	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);
+	glTexCoord2f(1.0f,0.0f);
+	//glTexCoord2f((float)(i+1.0)/(float)sizeX,(float)j/(float)sizeZ);
 	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);
+	glTexCoord2f(1.0f,1.0f);
+	//glTexCoord2f((float)(i+1.0)/(float)sizeX,(float)(j+1.0)/(float)sizeZ);
 	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);
+	glTexCoord2f(0.0f,1.0f);
+	//glTexCoord2f((float)(i)/(float)sizeX,(float)(j+1.0)/(float)sizeZ);
 	glVertex3f(v4.x, v4.y, v4.z);
 	
       }
   glEnd();
-  /*  
-  glBegin(GL_LINES);
-  for( float x = -128.0; x < 128.0; x += 25.0)
-    {
-      for( float y = -128.0; y < 128.0; y += 25.0)
-	{
-	  glColor3f(1,0,0);
-	  glVertex3f(x,y,-128.0);
-	  glVertex3f(x,y,0.0);
-	  glColor3f(0.5,0,0);
-	  glVertex3f(x,y,0.0);
-	  glVertex3f(x,y,128.0);
-	}
-    }
-  for( float y = -128.0; y < 128.0; y += 25.0)
-    {
-      for( float z = -128.0; z < 128.0; z += 25.0)
-	{
-	  glColor3f(0,1,0);
-	  glVertex3f(-128.0,y,z);
-	  glVertex3f(0.0,y,z);
-	  glColor3f(0,0.5,0);
-	  glVertex3f(0.0,y,z);
-	  glVertex3f(128.0,y,z);
-	}
-    }
-  for( float x = -128.0; x < 128.0; x += 25.0)
-    {
-      for( float z = -128.0; z < 128.0; z += 25.0)
-	{
-	  glColor3f(0,0,1);
-	  glVertex3f(x,-128.0,z);
-	  glVertex3f(x,0.0,z);
-	  glColor3f(0,0,0.5);
-	  glVertex3f(x,0.0,z);
-	  glVertex3f(x,128.0,z);
-	}
-      
-    }
-  */  
+  
+  // Disable Textures Again, for Performance reasons.
+  //glLoadIdentity();
+  glDisable(GL_TEXTURE_2D);
+
+  
   //draw track
   glBegin(GL_LINES);
@@ -541,29 +504,11 @@
   glEnd();
   
-  /*
-  glBegin(GL_LINE_STRIP);
-  glColor3f(1.0, 5.0, 1.0);
-  for( int i = 0; i <= 30; i++)
-    {
-      glEvalCoord1f ((GLfloat) i/30.0);
-    }
-  glEnd();
-  */
+
 
   trackManager->drawGraph(.01);
   trackManager->debug(2);
   delete trackManager;
-  
-  /*
-  glBegin(GL_LINES);
-  float i;
-  for(i = 0.0; i<1; i+=.01)
-    {
-      printf("%f, %f, %f\n",tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);
-      glVertex3f(tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);
-    }
-  glEnd();
-  */
-  glEndList();
+    
+  glEndList();  
 }
 
@@ -630,6 +575,15 @@
 
   // draw debug coord system
+  //glLoadIdentity();
+  
   glCallList (objectList);
 
+
+  //After calling the list, draw the skysphere
+  
+  glEnable(GL_TEXTURE_2D);
+  
+  skysphere->draw();
+  
 }
 
@@ -644,4 +598,5 @@
 void World::update ()
 {
+    
   /*
   //List<WorldEntity> *l;
@@ -711,5 +666,7 @@
       entity = entities->nextElement();
     }
-
+  
+  skysphere->updatePosition(localPlayer->absCoordinate.x,localPlayer->absCoordinate.y,localPlayer->absCoordinate.z);
+  
   //for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
 }
Index: /orxonox/branches/shadows/src/world.h
===================================================================
--- /orxonox/branches/shadows/src/world.h	(revision 3697)
+++ /orxonox/branches/shadows/src/world.h	(revision 3698)
@@ -7,6 +7,9 @@
 #define _WORLD_H
 
+
 #include "stdincl.h"
 #include "story_entity.h"
+#include "skysphere.h"
+class Material;
 
 
@@ -58,5 +61,7 @@
   tList<WorldEntity>* entities;
   
+  
   // base level data
+  
   TrackManager* trackManager;
   Track* track;
@@ -81,5 +86,5 @@
 
   WorldEntity* localPlayer;
- 
+  Skysphere* skysphere;
   PNode* nullParent;
  
