Index: orxonox/trunk/src/lib/graphics/importer/material.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 3802)
+++ orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 3803)
@@ -326,5 +326,5 @@
    \param dMap the Name of the Image to Use
 */
-void Material::setDiffuseMap(char* dMap)
+void Material::setDiffuseMap(const char* dMap)
 {
   PRINTF(4)("setting Diffuse Map %s\n", dMap);
@@ -342,5 +342,5 @@
    \todo implement this
 */
-void Material::setAmbientMap(char* aMap)
+void Material::setAmbientMap(const char* aMap)
 {
   SDL_Surface* ambientMap;
@@ -353,5 +353,5 @@
    \todo implement this
 */
-void Material::setSpecularMap(char* sMap)
+void Material::setSpecularMap(const char* sMap)
 {
   SDL_Surface* specularMap;
@@ -364,6 +364,6 @@
    \todo implemet this
 */
-void Material::setBump(char* bump)
-{
-
-}
+void Material::setBump(const char* bump)
+{
+
+}
Index: orxonox/trunk/src/lib/graphics/importer/material.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/material.h	(revision 3802)
+++ orxonox/trunk/src/lib/graphics/importer/material.h	(revision 3803)
@@ -48,8 +48,8 @@
   void addTexturePath(char* pathName);
  // MAPPING //
-  void setDiffuseMap(char* dMap);
-  void setAmbientMap(char* aMap);
-  void setSpecularMap(char* sMap);
-  void setBump(char* bump);
+  void setDiffuseMap(const char* dMap);
+  void setAmbientMap(const char* aMap);
+  void setSpecularMap(const char* sMap);
+  void setBump(const char* bump);
 
  private:
Index: orxonox/trunk/src/story_entities/world.cc
===================================================================
--- orxonox/trunk/src/story_entities/world.cc	(revision 3802)
+++ orxonox/trunk/src/story_entities/world.cc	(revision 3803)
@@ -30,4 +30,5 @@
 #include "environment.h"
 #include "skysphere.h"
+#include "skybox.h"
 #include "satellite.h"
 #include "terrain.h"
@@ -327,8 +328,10 @@
 
 	    // Create SkySphere
-	    this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
-	    this->skySphere->setName("SkySphere");
-	    this->localCamera->addChild(this->skySphere);
-	    this->spawn(this->skySphere);
+	    //	    this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
+	    //	    this->skySphere->setName("SkySphere");
+	    //	    this->localCamera->addChild(this->skySphere);
+	    //	    this->spawn(this->skySphere);
+	    skyBox = new SkyBox();
+	    this->spawn(skyBox);
 
 	    /*monitor progress*/
Index: orxonox/trunk/src/story_entities/world.h
===================================================================
--- orxonox/trunk/src/story_entities/world.h	(revision 3802)
+++ orxonox/trunk/src/story_entities/world.h	(revision 3803)
@@ -20,4 +20,5 @@
 class GLMenuImageScreen;
 class Skysphere;
+class SkyBox;
 class LightManager;
 class Terrain;
@@ -109,4 +110,5 @@
   Camera* localCamera;                //!< The current Camera
   Skysphere* skySphere;               //!< The Environmental Heaven of orxonox \todo insert this to environment insted
+  SkyBox* skyBox;
   LightManager* lightMan;             //!< The Lights of the Level
   Terrain* terrain;                   //!< The Terrain of the World.
Index: orxonox/trunk/src/world_entities/skybox.cc
===================================================================
--- orxonox/trunk/src/world_entities/skybox.cc	(revision 3802)
+++ orxonox/trunk/src/world_entities/skybox.cc	(revision 3803)
@@ -46,12 +46,4 @@
 {
   this->setClassName("SkyBox");
-
-  this->model = NULL;
-
-  this->setMode(PNODE_MOVEMENT);
-
-  this->setSize(1900.0);
-  this->rebuild();
-
   this->material = new Material*[6];
   for (int i = 0; i <6; i++) 
@@ -61,4 +53,10 @@
       this->material[i]->setAmbient(1.0, 1.0, 1.0);
     }
+  this->setMode(PNODE_MOVEMENT);
+
+
+
+  this->setSize(1900.0);
+  this->rebuild();
 }
 
@@ -76,5 +74,72 @@
 }
 
-
+/**
+   \brief sets A set of textures when just giving a Name and an extension:
+
+   usage: give this function an argument like
+   setTexture("skybox", "jpg");
+   and it will convert this to 
+   setTextures("skybox_top.jpg", "skybox_bottom.jpg", "skybox_left.jpg",
+               "skybox_right.jpg", "skybox_front.jpg", "skybox_back.jpg");
+*/
+void SkyBox::setTexture(const char* name, const char* extension)
+{
+  char* top    = new char[strlen(name)+strlen(extension)+ 6];
+  char* bottom = new char[strlen(name)+strlen(extension)+ 9];
+  char* left   = new char[strlen(name)+strlen(extension)+ 7];
+  char* right  = new char[strlen(name)+strlen(extension)+ 8];
+  char* front  = new char[strlen(name)+strlen(extension)+ 8];
+  char* back   = new char[strlen(name)+strlen(extension)+ 7];
+
+  sprintf(top, "%s_top.%s", name, extension);
+  sprintf(bottom, "%s_bottom.%s", name, extension);
+  sprintf(left, "%s_left.%s", name, extension);
+  sprintf(right, "%s_right.%s", name, extension);
+  sprintf(front, "%s_front.%s", name, extension);
+  sprintf(back, "%s_back.%s", name, extension);
+  
+  this->setTextures(top, bottom, left, right, front, back);
+
+  delete []top;
+  delete []bottom;
+  delete []left;
+  delete []right;
+  delete []front;
+  delete []back;
+}
+
+/**
+   \brief Defines which textures should be loaded onto the SkyBox.
+   \param top the top texture.
+   \param bottom the bottom texture.
+   \param left the left texture.
+   \param right the right texture.
+   \param front the front texture.
+   \param back the back texture.
+*/
+void SkyBox::setTextures(const char* top, const char* bottom, const char* left, const char* right, const char* front, const char* back)
+{
+  this->material[0]->setDiffuseMap(top);
+  this->material[1]->setDiffuseMap(bottom);
+  this->material[2]->setDiffuseMap(left);
+  this->material[3]->setDiffuseMap(right);
+  this->material[4]->setDiffuseMap(front);
+  this->material[5]->setDiffuseMap(back);
+}
+
+/**
+   \brief sets the Radius of the Sphere.
+   \param radius The Radius of The Sphere
+*/
+void SkyBox::setSize(float size)
+{
+  this->size = size;
+}
+
+/**
+   \brief rebuilds the SkyBox
+   
+   this must be done, when changing the Size of the Skybox (runtime-efficency)
+*/
 void SkyBox::rebuild()
 {
@@ -144,47 +209,5 @@
   model->addUseMtl(material[5]);
   model->addFace (4, 3, 7,13,21, 1,1,22, 3,3,23, 5,14,24);
-}
-
-/**
-   \brief Defines which texture should be loaded onto the SkyBox.
-   \param fileName The filename of the Texture
-*/
-void SkyBox::setTexture(char* top, char* bottom, char* left, char* right, char* front, char* back)
-{
-  this->material[0]->setDiffuseMap(top);
-  this->material[1]->setDiffuseMap(bottom);
-  this->material[2]->setDiffuseMap(left);
-  this->material[3]->setDiffuseMap(right);
-  this->material[4]->setDiffuseMap(front);
-  this->material[5]->setDiffuseMap(back);
-}
-
-
-/**
-   \brief draws the SkyBox
-   
-   This part is normally precessed in the "Painting Phase".
-*/
-void SkyBox::draw()
-{
-  glPushMatrix();
-  glMatrixMode(GL_MODELVIEW);
-  Vector r = this->getAbsCoor();
-  glTranslatef(r.x, r.y, r.z);
-
-  this->material[1]->select();
-
-  this->model->draw();
-
-  glPopMatrix();
-}
-
-
-/**
-   \brief sets the Radius of the Sphere.
-   \param radius The Radius of The Sphere
-*/
-void SkyBox::setSize(float size)
-{
-  this->size = size;
-}
+  
+  model->finalize();
+}
Index: orxonox/trunk/src/world_entities/skybox.h
===================================================================
--- orxonox/trunk/src/world_entities/skybox.h	(revision 3802)
+++ orxonox/trunk/src/world_entities/skybox.h	(revision 3803)
@@ -26,10 +26,10 @@
 
   void setSize(float size);
-  void setTexture(char* top, char* bottom, char* left, char* right, char* front, char* back);
-
-  virtual void draw();
+  void setTexture(const char* name, const char* extension);
+  void setTextures(const char* top, const char* bottom, const char* left, const char* right, const char* front, const char* back);
 
  private:
   void rebuild();
+  
 
   Material **material;    //!< A Material for the Skybox.
Index: orxonox/trunk/src/world_entities/world_entity.cc
===================================================================
--- orxonox/trunk/src/world_entities/world_entity.cc	(revision 3802)
+++ orxonox/trunk/src/world_entities/world_entity.cc	(revision 3803)
@@ -19,6 +19,7 @@
 
 #include "world_entity.h"
-#include "objModel.h"
+#include "model.h"
 #include "list.h"
+#include "vector.h"
 
 //#include "stdincl.h"
@@ -41,5 +42,5 @@
   this->setClassName ("WorldEntity");
   this->bDraw = true;
-  //this->model = NULL;
+  this->model = NULL;
   //  collisioncluster = NULL;
 }
@@ -171,5 +172,5 @@
    Handle all stuff that should update with time inside this method (movement, animation, etc.)
 */
-inline void WorldEntity::tick(float time) 
+void WorldEntity::tick(float time) 
 {
 }
@@ -181,6 +182,22 @@
    This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
 */
-inline void WorldEntity::draw() 
-{}
+void WorldEntity::draw() 
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  float matrix[4][4];
+  
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x, 
+		this->getAbsCoor ().y, 
+		this->getAbsCoor ().z);
+  /* rotate */
+  this->getAbsDir ().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+
+  if (this->model)
+    this->model->draw();
+  glPopMatrix();
+}
 
 
