Index: /trunk/src/story_entities/menu/game_menu.cc
===================================================================
--- /trunk/src/story_entities/menu/game_menu.cc	(revision 8718)
+++ /trunk/src/story_entities/menu/game_menu.cc	(revision 8719)
@@ -178,5 +178,5 @@
       image->setWidgetSize( 250, 200);
       image->setAbsCoor2D(400, 150);
-      image->setForegroundColor(Color(1,1,1,.6));
+      image->setForegroundColor(Color( 1,1,1,.6));
 
       const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);
Index: /trunk/src/world_entities/environments/mapped_water.cc
===================================================================
--- /trunk/src/world_entities/environments/mapped_water.cc	(revision 8718)
+++ /trunk/src/world_entities/environments/mapped_water.cc	(revision 8719)
@@ -21,9 +21,10 @@
 
 
-
-
 CREATE_FACTORY(MappedWater, CL_MAPPED_WATER);
 
-
+/**
+ * @brief constructor
+ * @param root xml data
+ */
 MappedWater::MappedWater(const TiXmlElement* root)
 {
@@ -31,53 +32,71 @@
   this->toList(OM_ENVIRON);
 
+  /// sets start values and parameters
+  this->initParams();
+  // now the standard values were loaded, if the values are specified in the .oxw file
+  // loadParams will overwrite the standard values with the specified values
   if (root != NULL)
     this->loadParams(root);
 
-  PRINTF(0)("MaxTextureUnits: %i\n", Material::getMaxTextureUnits());
-
-  // TODO rename texture to reflection texture
-  /// loads the textures
+  /// initialization of the textures
+  this->initTextures();
+
+  /// initialization of the shaders
+  this->initShaders();
+}
+
+/**
+ * @brief deltes shader and the uniform used by the camera
+ */
+MappedWater::~MappedWater()
+{
+  delete shader;
+  delete cam_uni;
+}
+
+/**
+ * @brief initialization of loadable parameters, sets start standard values
+ */
+void MappedWater::initParams()
+{
+  // those standardvalues will be overwritten if they're also set in the oxw file
+  this->setWaterPos(0, 0, 0);
+  this->setWaterSize(100, 100);
+  this->setWaterUV(9);
+  this->setWaterFlow(0.08);
+  this->setLightPos(0, 10, 0);
+  this->setWaterAngle(0);
+  this->setNormalMapScale(0.25f);
+
+  // initialization of the texture coords, speeds etc...
+  // normalUV wont change anymore
+  this->normalUV = this->waterUV * this->kNormalMapScale;
+  // move and move2 are used for the reflection and refraction, the values are changed in tick()
+  this->move = 0;
+  this->move2 = this->move * this->kNormalMapScale;
+}
+
+/**
+ * @brief initialization of the textures
+ */
+void MappedWater::initTextures()
+{
+  // sets parameters for the textures
+  this->textureSize = 512;
+  unsigned int channels = 32;
+  GLenum type = GL_RGBA;
+
   // set up refleciton texture
-  //mat.setDiffuseMap(this->texture, 0);
-  mat.setDiffuseMap("pictures/refl.bmp", GL_TEXTURE_2D, 0);
-  // load refraction texture
-  mat.setDiffuseMap("pictures/refr.bmp", GL_TEXTURE_2D, 1);
+  Texture reflTex(GL_TEXTURE_2D, this->textureSize, this->textureSize, channels, type);
+  mat.setDiffuseMap(reflTex, 0);
+  // set up refraction texture
+  Texture refrTex(GL_TEXTURE_2D, this->textureSize, this->textureSize, channels, type);
+  mat.setDiffuseMap(refrTex, 1);
   // load normal map
   mat.setDiffuseMap("pictures/normalmap.bmp", GL_TEXTURE_2D, 2);
   // load dudv map
   mat.setDiffuseMap("pictures/dudvmap.bmp", GL_TEXTURE_2D, 3);
-  // set up depth texture
-  //mat.setDiffuseMap("pictures/sky-replace.jpg", GL_TEXTURE_2D, 4);
-
-
-
-  /// MAKE THE MAPPING TEXTURE.
-  // THIS IS A HACK AND SHOULD BE IN TEXTURE SOMEWHERE
-  // set the size of the refraction and reflection textures
-  this->textureSize = 512;
-  //unsigned int channels = 32;
-  //GLenum type = GL_RGBA;
-  //unsigned int* pTextureReflection = new unsigned int [this->textureSize * this->textureSize * channels];
-  //memset(pTextureReflection, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
-  //unsigned int* pTextureRefraction = new unsigned int [this->textureSize * this->textureSize * channels];
-  //memset(pTextureRefraction, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
-  // Register the texture with OpenGL and bind it to the texture ID
-  //mat.select();
-  //glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
-
-  // Create the texture and store it on the video card
-  //glTexImage2D(GL_TEXTURE_2D, 0, channels, this->textureSize, this->textureSize, 0, type, GL_UNSIGNED_INT, pTextureReflection);
-
-  //gluBuild2DMipmaps(GL_TEXTURE_2D, channels, this->textureSize, this->textureSize, type,  GL_UNSIGNED_INT, pTexture);
-
-  //the same for the refraction
-  //glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(1));
-  //glTexImage2D(GL_TEXTURE_2D, 0, channels, this->textureSize, this->textureSize, 0, type, GL_UNSIGNED_INT, pTextureRefraction);
-
-  unsigned int channels = 32;
-  GLenum type = GL_RGBA;
-  unsigned int* pTextureReflection = new unsigned int [this->textureSize * this->textureSize * channels];
-  memset(pTextureReflection, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
-  //mat.select();
+
+  // sets texture parameters for reflection texture
   glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(0));
   glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
@@ -85,9 +104,5 @@
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-  glTexImage2D(GL_TEXTURE_2D, 0, channels, this->textureSize, this->textureSize, 0, type, GL_UNSIGNED_INT, pTextureReflection);
-
-
-  unsigned int* pTextureRefraction = new unsigned int [this->textureSize * this->textureSize * channels];
-  memset(pTextureRefraction, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
+  // sets texture parameters for refraction texture
   glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(1));
   glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
@@ -95,21 +110,11 @@
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-  glTexImage2D(GL_TEXTURE_2D, 0, channels, this->textureSize, this->textureSize, 0, type, GL_UNSIGNED_INT, pTextureRefraction);
-
-  // Set the texture quality
-
-
-  // Since we stored the texture space with OpenGL, we can delete the image data
-  //delete [] pTextureReflection;
-  //delete [] pTextureRefraction;
-
-
-  /// initialization of the texture coords, speeds etc...
-  this->move = 0.0f;
-  this->g_WaterUV = 35.0f;
-  this->kNormalMapScale = 0.25f;
-  this->g_WaterFlow = 0.0015f;
-
-  /// initialization of the shaders
+}
+
+/**
+ * @brief initialization of the shaders
+ */
+void MappedWater::initShaders()
+{
   // load shader files
   shader = new Shader( ResourceManager::getInstance()->getDataDir() + "/shaders/mapped_water.vert", ResourceManager::getInstance()->getDataDir() +"/shaders/mapped_water.frag");
@@ -136,19 +141,24 @@
 }
 
-MappedWater::~MappedWater()
-{
-  //delete shader;
-  //delete cam_uni;
-}
-
+/**
+ * @brief ends the refraction and saves the graphic buffer into a texture
+ * @param root xml data
+ */
 void MappedWater::loadParams(const TiXmlElement* root)
 {
   WorldEntity::loadParams(root);
 
-  LoadParam(root, "waterHeight", this, MappedWater, setHeight);
-  LoadParam(root, "lightPos", this, MappedWater, setLightPosition);
-}
-
-
+  LoadParam(root, "waterpos", this, MappedWater, setWaterPos);
+  LoadParam(root, "watersize", this, MappedWater, setWaterSize);
+  LoadParam(root, "lightpos", this, MappedWater, setLightPos);
+  LoadParam(root, "wateruv", this, MappedWater, setWaterUV);
+  LoadParam(root, "waterflow", this, MappedWater, setWaterFlow);
+  LoadParam(root, "normalmapscale", this, MappedWater, setNormalMapScale);
+  LoadParam(root, "waterangle", this, MappedWater, setWaterAngle);
+}
+
+/**
+ * @brief activates the water shader and draws a quad with four textures on it
+ */
 void MappedWater::draw() const
 {
@@ -156,7 +166,7 @@
 
   glPushMatrix();
-  glTranslatef(0,this->waterHeight,0);
-
-  mat.unselect();
+  // don't use a glTranslate here, the reflection point won't be at the right place anymore
+  glRotatef(this->waterAngle, 0, 1, 0);
+
   mat.select();
 
@@ -167,46 +177,34 @@
   cam_uni->set(pos.x, pos.y, pos.z, 1.0f);
 
-  //glDisable(GL_BLEND);
+  glDisable(GL_BLEND);
 
   glBegin(GL_QUADS);
   // The back left vertice for the water
- // glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0);//g_WaterUV);            // Reflection texture
- // glMultiTexCoord2f(GL_TEXTURE1, 0.0f, 0);//refrUV - move);        // Refraction texture
-  glMultiTexCoord2f(GL_TEXTURE0, 0.0f, g_WaterUV);            // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, 0.0f, refrUV - move);        // Refraction texture
-  glMultiTexCoord2f(GL_TEXTURE2, 0.0f, normalUV + move2);     // Normal map texture
+  glMultiTexCoord2f(GL_TEXTURE0, 0, waterUV);            // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, 0, waterUV - move);        // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE2, 0, normalUV + move2);     // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                       // DUDV map texture
-  //glMultiTexCoord2f(GL_TEXTURE4, 0, 0);                       // Depth texture
-  glVertex3f(0.0f, waterHeight, 0.0f);
+  glVertex3f(this->waterPos.x, this->waterPos.y, this->waterPos.z);
 
   // The front left vertice for the water
- // glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 1);//0.0f);                  // Reflection texture
- // glMultiTexCoord2f(GL_TEXTURE1, 0.0f, 1);//0.0f - move);           // Refraction texture
-  glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0.0f);                  // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, 0.0f, 0.0f - move);           // Refraction texture
-  glMultiTexCoord2f(GL_TEXTURE2, 0.0f, 0.0f + move2);          // Normal map texture
+  glMultiTexCoord2f(GL_TEXTURE0, 0, 0);                  // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, 0, -move);           // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE2, 0, move2);          // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
-  //glMultiTexCoord2f(GL_TEXTURE4, 0, 0);                        // Depth texture
-  glVertex3f(0.0f, waterHeight, 1000.0f);
+  glVertex3f(this->waterPos.x, this->waterPos.y, this->waterPos.z + this->zWidth);
 
   // The front right vertice for the water
-//  glMultiTexCoord2f(GL_TEXTURE0, 1,1); //g_WaterUV, 0.0f);             // Reflection texture
- // glMultiTexCoord2f(GL_TEXTURE1, 1,1);//refrUV, 0.0f - move);         // Refraction texture
-  glMultiTexCoord2f(GL_TEXTURE0, g_WaterUV, 0.0f);             // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, refrUV, 0.0f - move);         // Refraction texture
-  glMultiTexCoord2f(GL_TEXTURE2, normalUV, 0.0f + move2);      // Normal map texture
+  glMultiTexCoord2f(GL_TEXTURE0, waterUV, 0);             // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, waterUV, -move);         // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE2, normalUV, move2);      // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
-  //glMultiTexCoord2f(GL_TEXTURE4, 0, 0);                        // Depth texture
-  glVertex3f(1000.0f, waterHeight, 1000.0f);
+  glVertex3f(this->waterPos.x + this->xWidth, this->waterPos.y, this->waterPos.z + this->zWidth);
 
   // The back right vertice for the water
- // glMultiTexCoord2f(GL_TEXTURE0, 1,0);//g_WaterUV, g_WaterUV);        // Reflection texture
- // glMultiTexCoord2f(GL_TEXTURE1, 1,0);//refrUV, refrUV - move);       // Refraction texture
-  glMultiTexCoord2f(GL_TEXTURE0, g_WaterUV, g_WaterUV);        // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, refrUV, refrUV - move);       // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE0, waterUV, waterUV);        // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, waterUV, waterUV - move);       // Refraction texture
   glMultiTexCoord2f(GL_TEXTURE2, normalUV, normalUV + move2);  // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
-  //glMultiTexCoord2f(GL_TEXTURE4, 0, 0);                        // Depth texture
-  glVertex3f(1000.0f, waterHeight, 0.0f);
+  glVertex3f(this->waterPos.x + this->xWidth, this->waterPos.y, this->waterPos.z);
   glEnd();
 
@@ -218,20 +216,29 @@
 }
 
+/**
+ * @brief tick tack, calculates the flow of the water
+ */
 void MappedWater::tick(float dt)
 {
   // makes the water flow
-  this->move += this->g_WaterFlow;
+  this->move += this->waterFlow * dt;
   this->move2 = this->move * this->kNormalMapScale;
-  this->refrUV = this->g_WaterUV;
-  this->normalUV = this->g_WaterUV * this->kNormalMapScale;
-}
-
-void MappedWater::setHeight(float height)
-{
-  this->waterHeight = height;
-}
-
+}
+
+/**
+ * @brief prepares everything to render the reflection texutre
+ */
 void MappedWater::activateReflection()
 {
+  // To create the reflection texture we just need to set the view port
+  // to our texture map size, then render the current scene our camera
+  // is looking at to the already allocated texture unit.  Since this
+  // is a reflection of the top of the water surface we use clipping
+  // planes to only render the top of the world as a reflection.  If
+  // we are below the water we don't flip the reflection but just use
+  // the current view of the top as we are seeing through the water.
+  // When you look through water at the surface it isn't really reflected,
+  // only when looking down from above the water on the surface.
+
   // save viewport matrix and change the viewport size
   glPushAttrib(GL_VIEWPORT_BIT);
@@ -246,11 +253,10 @@
   glEnable(GL_CLIP_PLANE0);
   Vector pos = State::getCameraNode()->getAbsCoor();
-  //pos.debug();
-  //PRINTF(0)("waterheight: %f\n", waterHeight);
-  if(pos.y > waterHeight)
+
+  if(pos.y > waterPos.y)
   {
     // Translate the world, then flip it upside down
-    glTranslatef(0.0f, waterHeight*2.0f, 0.0f);
-    glScalef(1.0, -1.0, 1.0);
+    glTranslatef(0, waterPos.y*2, 0);
+    glScalef(1, -1, 1);
 
     // Since the world is updside down we need to change the culling to FRONT
@@ -258,5 +264,5 @@
 
     // Set our plane equation and turn clipping on
-    double plane[4] = {0.0, 1.0, 0.0, -waterHeight};
+    double plane[4] = {0, 1, 0, -waterPos.y};
     glClipPlane(GL_CLIP_PLANE0, plane);
   }
@@ -265,10 +271,12 @@
     // If the camera is below the water we don't want to flip the world,
     // but just render it clipped so only the top is drawn.
-    double plane[4] = {0.0, 1.0, 0.0, waterHeight};
+    double plane[4] = {0, 1, 0, waterPos.y};
     glClipPlane(GL_CLIP_PLANE0, plane);
   }
 }
 
-
+/**
+ * @brief ends the reflection and saves the graphic buffer into a texture
+ */
 void MappedWater::deactivateReflection()
 {
@@ -276,14 +284,6 @@
   glCullFace(GL_BACK);
 
-  //mat.select();
-  /////glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
-  ///mat.renderToTexture(0, GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
-  ///
-
-  glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(0));
-
   // Create the texture and store it on the video card
-  glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
-
+  mat.renderToTexture(0, GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
 
   glPopMatrix();
@@ -291,42 +291,9 @@
 }
 
+/**
+ * @brief prepares everything to render the refraction texutre
+ */
 void MappedWater::activateRefraction()
-{/*
-  // save viewport matrix and change the viewport size
-  glPushAttrib(GL_VIEWPORT_BIT);
-  glViewport(0,0, textureSize, textureSize);
-
-  glMatrixMode(GL_MODELVIEW);
-  glPushMatrix();
-
-  // If our camera is above the water we will render the scene flipped upside down.
-  // In order to line up the reflection nicely with the world we have to translate
-  // the world to the position of our reflected surface, multiplied by two.
-  glEnable(GL_CLIP_PLANE0);
-  Vector pos = State::getCameraNode()->getAbsCoor();
-  //pos.debug();
-  //PRINTF(0)("waterheight: %f\n", waterHeight);
-  if(pos.y > waterHeight)
-  {
-    // Translate the world, then flip it upside down
-    glTranslatef(0.0f, waterHeight*2.0f, 0.0f);
-    glScalef(1.0, -1.0, 1.0);
-
-    // Since the world is updside down we need to change the culling to FRONT
-    glCullFace(GL_FRONT);
-
-    // Set our plane equation and turn clipping on
-    double plane[4] = {0.0, 1.0, 0.0, -waterHeight};
-    glClipPlane(GL_CLIP_PLANE0, plane);
-  }
-  else
-  {
-    // If the camera is below the water we don't want to flip the world,
-    // but just render it clipped so only the top is drawn.
-    double plane[4] = {0.0, 1.0, 0.0, waterHeight};
-    glClipPlane(GL_CLIP_PLANE0, plane);
-  }
-*/
-
+{
   // To create the refraction and depth textures we do the same thing
   // we did for the reflection texture, except we don't need to turn
@@ -349,9 +316,8 @@
   glEnable(GL_CLIP_PLANE0);
   Vector pos = State::getCameraNode()->getAbsCoor();
-  if(pos.y > waterHeight)
+  if(pos.y > waterPos.y)
   {
-    double plane[4] = {0.0, -1.0, 0.0, waterHeight};
+    double plane[4] = {0, -1, 0, waterPos.y};
     glClipPlane(GL_CLIP_PLANE0, plane);
-
   }
   // If the camera is below the water, only render the data above the water
@@ -359,9 +325,12 @@
   {
     glCullFace(GL_FRONT);
-    double plane[4] = {0.0, 1.0, 0.0, -waterHeight};
+    double plane[4] = {0, 1, 0, -waterPos.y};
     glClipPlane(GL_CLIP_PLANE0, plane);
   }
 }
 
+/**
+ * @brief ends the refraction and saves the graphic buffer into a texture
+ */
 void MappedWater::deactivateRefraction()
 {
@@ -369,20 +338,8 @@
   glCullFace(GL_BACK);
 
-
-  glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(1));
-
   // Create the texture and store it on the video card
-  glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
+  mat.renderToTexture(1, GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
 
   glPopMatrix();
   glPopAttrib();
-
-  // Bind the current scene to our refraction texture
-//  glBindTexture(GL_TEXTURE_2D, g_Texture[REFRACTION_ID]);
-//  glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
-
-  // Bind the current scene to our depth texture
-//  glBindTexture(GL_TEXTURE_2D, g_Texture[DEPTH_ID]);
-//  glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, textureSize, textureSize, 0);
-
-}
+}
Index: /trunk/src/world_entities/environments/mapped_water.h
===================================================================
--- /trunk/src/world_entities/environments/mapped_water.h	(revision 8718)
+++ /trunk/src/world_entities/environments/mapped_water.h	(revision 8719)
@@ -1,55 +1,76 @@
 /*!
  * @file mapped_water.h
- *
+ *  worldentity for flat, cool looking, mapped water
 */
+/*! example input in .oxw file with the standard values
+<MappedWater>
+  <waterpos>0,0,0</waterpos>
+  <watersize>100,100</watersize>
+  <wateruv>9</wateruv><!-- size of the waves -->
+  <waterflow>0.08</waterflow>
+  <lightpos>0,10,0</lightpos>
+  <waterangle>0</waterangle>
+  <normalmapscale>0.25</normalmapscale><!-- you won't see a big differnce if you change that -->
+</MappedWater>
+*/
+
 
 #ifndef _MAPPED_WATER_H
 #define _MAPPED_WATER_H
 
-/* INCLUDES */
 #include "world_entity.h"
 #include "material.h"
 #include "shader.h"
 
+
 class MappedWater : public WorldEntity
 {
-  public:
-    MappedWater(const TiXmlElement* root = NULL);
-    virtual ~MappedWater();
+public:
+  MappedWater(const TiXmlElement* root = NULL);
+  virtual ~MappedWater();
 
-    void loadParams(const TiXmlElement* root);
+  void loadParams(const TiXmlElement* root);
 
+  void draw() const;
+  void tick(float dt);
 
-    void activateReflection();
-    void deactivateReflection();
+  // function to prepare renderpaths for creation of refleaction and reflaction textures
+  void activateReflection();
+  void deactivateReflection();
+  void activateRefraction();
+  void deactivateRefraction();
 
-    void activateRefraction();
-    void deactivateRefraction();
+  // functions to set parameters for the water, usually they're called through loadparam
+  void setLightPos(float x, float y, float z) { this->lightPos = Vector(x,y,z); };
+  void setWaterPos(float x, float y, float z) { this->waterPos = Vector(x,y,z); };
+  void setWaterSize(float x, float z) { this->xWidth = x; this->zWidth = z; };
+  void setWaterAngle(float angle) { this->waterAngle = angle; };
+  void setWaterUV(float uv) { this->waterUV = uv; };
+  void setWaterFlow(float flow) { this->waterFlow = flow; };
+  void setNormalMapScale(float scale) { this->kNormalMapScale = scale; };
 
-    void draw() const;
-    void tick(float dt);
+private:
+  void initParams();
+  void initTextures();
+  void initShaders();
 
-  private:
-    void setLightPosition(float x, float y, float z) { this->lightPos = Vector(x,y,z); };
-    void setHeight(float height);
+private:
+  Vector              waterPos;               //!< position of the water
+  float               xWidth, zWidth;         //!< size of the water quad
+  Vector              lightPos;               //!< position of the light that is used to render the reflection
+  float               waterAngle;             //!< defines how much the water will be turned around the point waterPos
 
-  private:
-    float               waterHeight;                //!< y-coord of the Water
+  float               move;                   //!< textures coords, speeds, positions for the shaded textures....
+  float               move2;
+  float               waterUV;                //!< size of the waves
+  float               waterFlow;              //!< speed of the water
+  float               normalUV;
+  float               kNormalMapScale;
 
-    float               move;                       //!< textures coords, speeds, positions for the shaded textures....
-    float               move2;                      //!<
-    float               g_WaterUV;                  //!<
-    float               g_WaterFlow;                //!<
-    float               refrUV;                     //!<
-    float               normalUV;                   //!<
-    float               kNormalMapScale;            //!<
-
-    int                 textureSize;                //!< size of the texture
-    Vector              lightPos;
-    Material            mat;
-    Shader*             shader;
-    Shader::Uniform*    cam_uni;                        //!< uniform that is used for the camera position
-
+  int                 textureSize;            //!< height and width of the texture
+  Material            mat;
+  Shader*             shader;
+  Shader::Uniform*    cam_uni;                //!< uniform that is used for the camera position
 };
 
-#endif  /* _MAPPED_WATER_H */
+#endif
Index: /trunk/src/world_entities/space_ships/hover.cc
===================================================================
--- /trunk/src/world_entities/space_ships/hover.cc	(revision 8718)
+++ /trunk/src/world_entities/space_ships/hover.cc	(revision 8719)
@@ -99,4 +99,5 @@
   //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
   this->setClassID(CL_HOVER, "Hover");
+  this->toReflectionList();
 
   this->loadModel("models/ships/hoverglider_wing.obj", 1.0f, 3);
