Index: /branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.cc
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.cc	(revision 8662)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.cc	(revision 8663)
@@ -22,5 +22,4 @@
 
 #include "material.h"
-#include <math.h>
 #include "state.h"
 #include "p_node.h"
@@ -41,5 +40,4 @@
 {
   this->setClassID(CL_CLOUD_EFFECT, "CloudEffect");
-  //  this->toList(OM_ENVIRON);
 
   this->init();
@@ -48,6 +46,6 @@
     this->loadParams(root);
 
-  //if(cloudActivate)
-  this->activate();
+  if(cloudActivate)
+    this->activate();
 }
 
@@ -61,4 +59,7 @@
 {
   PRINTF(0)("Initializing CloudEffect\n");
+  
+  this->offsetZ = 0;
+  this->animationSpeed = 2;
 
   noise3DTexSize = 64;
@@ -79,9 +80,4 @@
                noise3DTexSize, noise3DTexSize, noise3DTexSize,
                0, GL_RGBA, GL_UNSIGNED_BYTE, noise3DTexPtr);
-
-
-  //cloudMaterial.setDiffuseMap("pictures/sky/cloud1.jpg", GL_TEXTURE_2D, 0);
-
-  coor = 0;
   
   shader = new Shader(ResourceManager::getInstance()->getDataDir() + "/shaders/cloud.vert",
@@ -106,12 +102,11 @@
   WeatherEffect::loadParams(root);
 
-  // LoadParam(root, "speed", this, CloudEffect, setCloudAnimation);
-  // LoadParam(root, "texture", this, CloudEffect, setCloudTexture);
-  /*
+  LoadParam(root, "speed", this, CloudEffect, setAnimationSpeed);
+  
   LOAD_PARAM_START_CYCLE(root, element);
   {
-  LoadParam_CYCLE(element, "option", this, CloudEffect, setCloudOption);
-  }
-  LOAD_PARAM_END_CYCLE(element);*/
+    LoadParam_CYCLE(element, "option", this, CloudEffect, setCloudOption);
+  }
+  LOAD_PARAM_END_CYCLE(element);
 }
 
@@ -121,5 +116,5 @@
   PRINTF(0)( "Activating\n");
 
-  //  this->cloudActivate = true;
+  this->cloudActivate = true;
 }
 
@@ -128,11 +123,12 @@
   PRINTF(0)("Deactivating CloudEffect\n");
 
-  //  this->cloudActivate = false;
+  this->cloudActivate = false;
 }
 
 void CloudEffect::draw() const
 {
-  //if (!this->cloudActivate)
-  //  return;
+  if (!this->cloudActivate)
+    return;
+  
   glPushAttrib(GL_ENABLE_BIT);
 
@@ -143,20 +139,8 @@
   glBindTexture(GL_TEXTURE_3D, noise3DTexName);
 
-
-  //this->shader->activateShader();
-
-  //glMatrixMode(GL_MODELVIEW);
-  //glColor4f(1,1,1,1);
   glPushMatrix();
-  //glTranslatef(0,this->waterHeight,0);
-
-  //cloudMaterial.unselect();
-  //cloudMaterial.select();
 
   this->shader->activateShader();
-  //PRINTF(0)("coor: %f\n", coor);
-  offset->set(coor, coor, coor);
-
-  //glutSolidTeapot(1);
+  offset->set(0.0f, 0.0f, offsetZ);
 
 
@@ -173,8 +157,5 @@
   this->shader->deactivateShader();
 
-  //cloudMaterial.unselect();
-
   glPopMatrix();
-
   glPopAttrib();
 
@@ -183,7 +164,7 @@
 void CloudEffect::tick (float dt)
 {
-  //if (!this->cloudActivate)
-  //  return;
-  coor += 10;
+  if (!this->cloudActivate)
+    return;
+  this->offsetZ += 0.05 * dt * this->animationSpeed;
 }
 
Index: /branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h	(revision 8662)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h	(revision 8663)
@@ -52,4 +52,13 @@
     this->deactivate();
   }
+  inline void setCloudOption(const std::string& option)
+  {
+    if (option == "activate")
+      this->cloudActivate = true;
+  }
+  inline void setAnimationSpeed(float speed)
+  {
+    this->animationSpeed = speed;
+  }
 
   virtual void draw() const;
@@ -63,20 +72,14 @@
   void normalize3(double v[3]);
 
-  /*inline void setCloudOption(const std::string& option) {
-      if (option == "activate")
-  this->cloudActivate = true;
-  }*/
+private:
 
-
-private:
-  //void initialize(char* fileName);
-
-  //bool        cloudActivate;
+  bool        cloudActivate;
+  float       animationSpeed;
 
   // Material                 cloudMaterial;
   Shader*                 shader;
   Shader::Uniform*        offset;
-  
-  float coor;
+
+  float offsetZ;
 
   int noise3DTexSize;
