Index: orxonox/trunk/src/world_entities/skybox.cc
===================================================================
--- orxonox/trunk/src/world_entities/skybox.cc	(revision 4621)
+++ orxonox/trunk/src/world_entities/skybox.cc	(revision 4680)
@@ -74,5 +74,4 @@
   this->size = 100.0;
 
-  this->skyModel = NULL;
   this->material = new Material*[6];
   for (int i = 0; i < 6; i++)
@@ -179,5 +178,5 @@
   glTranslatef(r.x, r.y, r.z);
 
-  this->skyModel->draw();
+  this->model->draw();
 
   glPopMatrix();
@@ -192,42 +191,42 @@
 void SkyBox::rebuild()
 {
-  if (this->skyModel)
-    delete skyModel;
-  skyModel = new Model();
-
-  this->skyModel->addVertex (-0.5*size, -0.5*size, 0.5*size);
-  this->skyModel->addVertex (0.5*size, -0.5*size, 0.5*size);
-  this->skyModel->addVertex (-0.5*size, 0.5*size, 0.5*size);
-  this->skyModel->addVertex (0.5*size, 0.5*size, 0.5*size);
-  this->skyModel->addVertex (-0.5*size, 0.5*size, -0.5*size);
-  this->skyModel->addVertex (0.5*size, 0.5*size, -0.5*size);
-  this->skyModel->addVertex (-0.5*size, -0.5*size, -0.5*size);
-  this->skyModel->addVertex (0.5*size, -0.5*size, -0.5*size);
-
-  this->skyModel->addVertexTexture (0.0, 1.0);
-  this->skyModel->addVertexTexture (1.0, 1.0);
-  this->skyModel->addVertexTexture (1.0, 0.0);
-  this->skyModel->addVertexTexture (0.0, 0.0);
-
-  this->skyModel->addVertexNormal (0.0, 0.0, 1.0);
-  this->skyModel->addVertexNormal (0.0, 1.0, 0.0);
-  this->skyModel->addVertexNormal (0.0, 0.0, -1.0);
-  this->skyModel->addVertexNormal (0.0, -1.0, 0.0);
-  this->skyModel->addVertexNormal (1.0, 0.0, 0.0);
-  this->skyModel->addVertexNormal (-1.0, 0.0, 0.0);
-
-  this->skyModel->setMaterial(material[0]);
-  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,0,3, 3,1,3, 5,2,3, 4,3,3); // top
-  this->skyModel->setMaterial(material[1]);
-  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,1, 7,1,1, 1,2,1, 0,3,1); // bottom
-  this->skyModel->setMaterial(material[2]);
-  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,2, 5,3,2, 7,0,2, 6,1,2); // left
-  this->skyModel->setMaterial(material[3]);
-  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,0, 3,2,0, 2,3,0); // right
-  this->skyModel->setMaterial(material[4]);
-  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,5); // front
-  this->skyModel->setMaterial(material[5]);
-  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
-
-  this->skyModel->finalize();
-}
+  if (this->model)
+    delete this->model;
+  model = new Model();
+
+  this->model->addVertex (-0.5*size, -0.5*size, 0.5*size);
+  this->model->addVertex (0.5*size, -0.5*size, 0.5*size);
+  this->model->addVertex (-0.5*size, 0.5*size, 0.5*size);
+  this->model->addVertex (0.5*size, 0.5*size, 0.5*size);
+  this->model->addVertex (-0.5*size, 0.5*size, -0.5*size);
+  this->model->addVertex (0.5*size, 0.5*size, -0.5*size);
+  this->model->addVertex (-0.5*size, -0.5*size, -0.5*size);
+  this->model->addVertex (0.5*size, -0.5*size, -0.5*size);
+
+  this->model->addVertexTexture (0.0, 1.0);
+  this->model->addVertexTexture (1.0, 1.0);
+  this->model->addVertexTexture (1.0, 0.0);
+  this->model->addVertexTexture (0.0, 0.0);
+
+  this->model->addVertexNormal (0.0, 0.0, 1.0);
+  this->model->addVertexNormal (0.0, 1.0, 0.0);
+  this->model->addVertexNormal (0.0, 0.0, -1.0);
+  this->model->addVertexNormal (0.0, -1.0, 0.0);
+  this->model->addVertexNormal (1.0, 0.0, 0.0);
+  this->model->addVertexNormal (-1.0, 0.0, 0.0);
+
+  this->model->setMaterial(material[0]);
+  this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,0,3, 3,1,3, 5,2,3, 4,3,3); // top
+  this->model->setMaterial(material[1]);
+  this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,1, 7,1,1, 1,2,1, 0,3,1); // bottom
+  this->model->setMaterial(material[2]);
+  this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,2, 5,3,2, 7,0,2, 6,1,2); // left
+  this->model->setMaterial(material[3]);
+  this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,0, 3,2,0, 2,3,0); // right
+  this->model->setMaterial(material[4]);
+  this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,5); // front
+  this->model->setMaterial(material[5]);
+  this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
+
+  this->model->finalize();
+}
