Index: /branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.cc
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.cc	(revision 7950)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.cc	(revision 7951)
@@ -127,5 +127,5 @@
     for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
     {
-      printf("%s::%s \n", (*it)->getClassName(), (*it)->getName());
+      //printf("%s::%s \n", (*it)->getClassName(), (*it)->getName());
       dynamic_cast<WeatherEffect*>(*it)->tick(dt);
     }
Index: /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc	(revision 7950)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc	(revision 7951)
@@ -18,5 +18,5 @@
 #include "util/loading/load_param.h"
 #include "util/loading/factory.h"
-#include "render2D/image_plane.h"
+#include "effects/billboard.h"
 
 #include "glincl.h"
@@ -32,9 +32,9 @@
   
   
-  lightening = new ImagePlane(NULL);
-  lightening->setTexture("maps/lightning_bolt.png");
-  lightening->setSize(50, 50);
-  lightening->setAbsCoor2D(10,10);
-  lightening->setVisibility(true);
+  billboard = new Billboard(NULL);
+  billboard->setTexture("maps/lightning_bolt.png");
+  //billboard->setSize(50, 50);
+  //billboard->setAbsCoor2D(10,10);
+  //billboard->setVisibility(true);
   
   
@@ -50,5 +50,5 @@
 {
 	this->deactivate();
-  delete lightening;
+  delete billboard;
 }
 
Index: /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h	(revision 7950)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h	(revision 7951)
@@ -15,5 +15,5 @@
 
 
-class ImagePlane;
+class Billboard;
 
 class LighteningEffect : public WeatherEffect
@@ -33,5 +33,5 @@
 
 	private:
-    ImagePlane* lightening;
+    Billboard* billboard;
 
 };
Index: /branches/atmospheric_engine/src/world_entities/Makefile.am
===================================================================
--- /branches/atmospheric_engine/src/world_entities/Makefile.am	(revision 7950)
+++ /branches/atmospheric_engine/src/world_entities/Makefile.am	(revision 7951)
@@ -28,5 +28,6 @@
 		\
 		\
-		effects/explosion.cc
+		effects/explosion.cc \
+		effects/billboard.cc
 
 
@@ -56,4 +57,5 @@
 		\
 		effects/explosion.h \
+		effects/billboard.h \
 		\
 		$(WorldEntities_HEADERS_)
Index: /branches/atmospheric_engine/src/world_entities/effects/billboard.cc
===================================================================
--- /branches/atmospheric_engine/src/world_entities/effects/billboard.cc	(revision 7950)
+++ /branches/atmospheric_engine/src/world_entities/effects/billboard.cc	(revision 7951)
@@ -2,5 +2,5 @@
    orxonox - the future of 3D-vertical-scrollers
 
-   Copyright (C) 2004 orx
+   Copyright (C) 2006 orx
 
    This program is free software; you can redistribute it and/or modify
@@ -9,141 +9,146 @@
    any later version.
 
-   ### File Specific
-   main-programmer: Patrick Boenzli
+### File Specific:
+   main-programmer: David Hasenfratz
 */
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
 
+#include "billboard.h"
 
-#include "lightning_bolt.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 
-#include "util/loading/factory.h"
+#include "graphics_engine.h"
 #include "material.h"
-
-#include "util/loading/resource_manager.h"
-
+#include "glincl.h"
+#include "state.h"
 
 
 using namespace std;
 
-CREATE_FACTORY(LightningBolt, CL_LIGHTNING_BOLT);
+
+CREATE_FACTORY(Billboard, CL_BILLBOARD);
 
 
 /**
- *  standard constructor
-*/
-LightningBolt::LightningBolt (const TiXmlElement* root)
+ * standart constructor
+ */
+Billboard::Billboard (const TiXmlElement* root)
 {
-  this->setClassID(CL_LIGHTNING_BOLT, "LightningBolt");
+  this->init();
 
-  this->toList(OM_COMMON);
-
-  this->bRender = false;
-  this->time = 0.0;
-  this->flashFrequency = 0.6f;
-  this->flashConstTime = 0.07f;
-
-  this->material = new Material();
-  this->material->setDiffuseMap("maps/lightning_bolt.png");
-  //this->offset = Vector(-1440.00, 100.00, 280.00);
-
-  this->setAbsCoor(offset);
-  this->width = 100.0f;
-  this->height = 300.0f;
-  this->bNewCoordinate = false;
-
-  this->seedX = 200.f;
-  this->seedZ = 500.0f;
-  this->seedTime = 4.0f;
-
-  this->soundSource.setSourceNode(this);
-
-  //load sound
-  if (this->thunderBuffer != NULL)
-    ResourceManager::getInstance()->unload(this->thunderBuffer);
-  this->thunderBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/thunder.wav", WAV);
+  if( root)
+    this->loadParams(root);
 }
 
 
 /**
- *  standard deconstructor
-*/
-LightningBolt::~LightningBolt ()
+ * destroys a Billboard
+ */
+Billboard::~Billboard ()
 {
-}
-
-void LightningBolt::activate()
-{
-}
-
-
-void LightningBolt::deactivate()
-{
-
+  if (this->material)
+    delete this->material;
 }
 
 
 /**
- *  signal tick, time dependent things will be handled here
- * @param time since last tick
-*/
-void LightningBolt::tick (float dt)
+ * initializes the Billboard
+ */
+void Billboard::init()
 {
-  this->time += dt;
+  this->setClassID(CL_BILLBOARD, "Billboard");
+  this->setName("Billboard");
 
-  if( this->time > this->flashFrequency)
-  {
-    this->bRender = true;
-    this->time = 0.0f;
-    this->soundSource.play(this->thunderBuffer);
-  }
-  else if( this->bRender && this->time > this->flashConstTime)
-  {
-    this->bRender = false;
-    this->time = 0.0f;
-    this->bNewCoordinate = true;
-  }
-
-  if( this->bNewCoordinate)
-  {
-    this->flashFrequency = this->seedTime * (float)rand()/(float)RAND_MAX + 0.1;
-    this->setAbsCoor( - 800.0f - this->seedX * (float)rand()/(float)RAND_MAX, 250.00, -200.0f + this->seedZ * (float)rand()/(float)RAND_MAX);
-    this->bNewCoordinate = false;
-  }
+  this->material = new Material();
+  this->setTexture("pictures/error_texture.png");
+  this->setAbsCoor(0, 0, 0);
+  this->setVisibiliy(true);
+  this->setSize(10, 10);
 }
 
 
-void LightningBolt::draw() const
+/**
+ *  load params
+ * @param root TiXmlElement object
+ */
+void Billboard::loadParams(const TiXmlElement* root)
 {
-  if( this->bRender)
-  {
+  LoadParam(root, "texture", this->material, Material, setDiffuseMap)
+      .describe("the texture-file to load onto the Billboard");
 
-    glPushMatrix();
-    glTranslatef (this->getAbsCoor ().x,
-                  this->getAbsCoor ().y,
-                  this->getAbsCoor ().z);
-
-    glRotatef(90, 0.0f,1.0f,0.0f);
-
-//     Vector tmpRot = drawPart->orientation.getSpacialAxis();
-//     glRotatef (drawPart->orientation.getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
-
-//     glPushAttrib(GL_ENABLE_BIT);
-//     glDisable(GL_LIGHTING);
-//     glDisable(GL_BLEND);
-
-    this->material->select();
-
-    glBegin(GL_QUADS);
-    glTexCoord2f(1.0f, 1.0f); glVertex3f(-width/2, -height/2,  0.0f);
-    glTexCoord2f(0.0f, 1.0f); glVertex3f( width/2, -height/2,  0.0f);
-    glTexCoord2f(0.0f, 0.0f); glVertex3f( width/2,  height/2,  0.0f);
-    glTexCoord2f(1.0f, 0.0f); glVertex3f(-width/2,  height/2,  0.0f);
-    glEnd();
-
-//     glPopAttrib();
-
-    glPopMatrix();
-  }
+  LoadParam(root, "size", this, Billboard, setSize)
+      .describe("the size of the Billboard in Pixels");
 }
 
 
+/**
+ * sets the size of the Billboard.
+ * @param size the size in pixels
+ */
+void Billboard::setSize(float sizeX, float sizeY)
+{
+  this->sizeX = sizeX;
+  this->sizeY = sizeY;
+}
+
+
+/**
+ * sets the material to load
+ * @param textureFile The texture-file to load
+ */
+void Billboard::setTexture(const std::string& textureFile)
+{
+  this->material->setDiffuseMap(textureFile);
+}
+
+
+/**
+ * ticks the Billboard
+ * @param dt the time to ticks
+ */
+void Billboard::tick(float dt)
+{/*
+  float z = 0.0f;
+  glReadPixels ((int)this->getAbsCoor2D().x,
+                 GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
+                 1,
+                 1,
+                 GL_DEPTH_COMPONENT,
+                 GL_FLOAT,
+                 &z);
+
+  GLdouble objX=.0, objY=.0, objZ=.0;
+  gluUnProject(this->getAbsCoor2D().x,
+               GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
+               .99,  // z
+               GraphicsEngine::modMat,
+               GraphicsEngine::projMat,
+               GraphicsEngine::viewPort,
+               &objX,
+               &objY,
+  &objZ );*/
+}
+
+
+/**
+ * draws the billboard
+ */
+void Billboard::draw() const
+{
+  if( !this->isVisible())
+    return;
+
+  glPushMatrix();
+
+  glTranslatef(this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z);
+  this->material->select();
+
+  glBegin(GL_QUADS);
+  glTexCoord2f(1.0f, 1.0f); glVertex3f(-sizeX/2, -sizeY/2,  0.0f);
+  glTexCoord2f(0.0f, 1.0f); glVertex3f( sizeX/2, -sizeY/2,  0.0f);
+  glTexCoord2f(0.0f, 0.0f); glVertex3f( sizeX/2,  sizeY/2,  0.0f);
+  glTexCoord2f(1.0f, 0.0f); glVertex3f(-sizeX/2,  sizeY/2,  0.0f);
+  glEnd();
+
+  glPopMatrix();
+}
Index: /branches/atmospheric_engine/src/world_entities/effects/billboard.h
===================================================================
--- /branches/atmospheric_engine/src/world_entities/effects/billboard.h	(revision 7950)
+++ /branches/atmospheric_engine/src/world_entities/effects/billboard.h	(revision 7951)
@@ -1,51 +1,34 @@
 /*!
- * @file lightning_bolt.h
- * @brief a LightningBolt Projectile
+ * @file billboard.h
  */
 
-#ifndef _LIGHTNING_BOLT_H
-#define _LIGHTNING_BOLT_H
+#ifndef _BILLBOARD_H
+#define _BILLBOARD_H
 
 #include "world_entity.h"
 
-#include "sound_buffer.h"
-#include "sound_source.h"
+class Material;
+class TiXmlElement;
 
-class Material;
-
-class LightningBolt : public WorldEntity
+class Billboard : public WorldEntity
 {
   public:
-    LightningBolt(const TiXmlElement* root = NULL);
-    virtual ~LightningBolt ();
+    Billboard(const TiXmlElement* root = NULL);
+    virtual ~Billboard();
 
-    virtual void activate();
-    virtual void deactivate();
+    void init();
+    void loadParams(const TiXmlElement* root);
 
-    virtual void tick(float time);
+    void setSize(float sizeX, float sizeY);
+    void setTexture(const std::string& textureFile);
+
+    virtual void tick(float dt);
     virtual void draw() const;
 
   private:
-    float flashFrequency;                   //!< frequency to activate itself
-    float flashRisingTime;                  //!< time to rise
-    float flashConstTime;                   //!< time to be drawn
-    float flashFallTime;                    //!< time to fall
-
-    float time;                             //!< time
-
-    bool  bRender;
-    bool  bNewCoordinate;
-    Material*      material;
-    Vector         offset;
-    float width;
-    float height;
-
-    float seedX;
-    float seedZ;
-    float seedTime;
-
-    SoundSource    soundSource;
-    SoundBuffer*   thunderBuffer;
+    Material*        material;
+    float sizeX;
+    float sizeY;
 };
 
-#endif /* _LIGHTNING_BOLT_H */
+#endif /* _BILLBOARD_H */
