Index: orxonox/trunk/src/lib/graphics/importer/material.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 3917)
+++ orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 3966)
@@ -88,9 +88,5 @@
   
   // setting the transparency
-  if (this->transparency == 1.0)
-    {
-      glDisable(GL_BLEND);
-    }
-  else
+  if (this->transparency < 1.0)
     {
       glEnable(GL_BLEND);
@@ -98,4 +94,10 @@
       glBlendFunc(GL_SRC_ALPHA, GL_ONE);
     }
+  else
+    {
+      glDisable(GL_BLEND);
+      glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+    }
+
 
   // setting illumination Model 
@@ -109,4 +111,11 @@
       glEnable(GL_TEXTURE_2D);
       glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());
+
+      /* This allows alpha blending of 2D textures with the scene */
+      if (this->diffuseTexture->hasAlpha())
+	{
+	  glEnable(GL_BLEND);
+	  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+	}
     }
   else
Index: orxonox/trunk/src/lib/graphics/importer/texture.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/texture.cc	(revision 3917)
+++ orxonox/trunk/src/lib/graphics/importer/texture.cc	(revision 3966)
@@ -25,4 +25,5 @@
 Texture::Texture(const char* imageName)
 {
+  bAlpha = false;
   this->texture = 0;
   if (imageName)
@@ -112,4 +113,5 @@
       if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
 	SDL_SetAlpha(surface, saved_flags | SDL_OPENGL, saved_alpha);
+	this->bAlpha = true;
       }
       
@@ -119,5 +121,6 @@
       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-      /*      glTexImage2D(GL_TEXTURE_2D,
+      // build the Texture
+      glTexImage2D(GL_TEXTURE_2D,
 		   0,
 		   GL_RGBA,
@@ -127,7 +130,7 @@
 		   GL_UNSIGNED_BYTE,
 		   image->pixels);
-      */
+      // build the MipMaps
       gluBuild2DMipmaps(GL_TEXTURE_2D,
-			3,
+			GL_RGBA,
 			w,
 			h,
@@ -135,5 +138,5 @@
 			GL_UNSIGNED_BYTE,
 			image->pixels);
-
+      
       SDL_FreeSurface(image); /* No longer needed */
       
Index: orxonox/trunk/src/lib/graphics/importer/texture.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/texture.h	(revision 3917)
+++ orxonox/trunk/src/lib/graphics/importer/texture.h	(revision 3966)
@@ -23,4 +23,6 @@
   char* searchTextureInPaths(const char* texName) const;
   void swap(unsigned char &a, unsigned char &b);
+
+  bool bAlpha;           //!< if the texture has an alpha channel.
  public:
   Texture(const char* imageName = NULL);
@@ -30,4 +32,5 @@
   inline GLuint getTexture(void) {return this->texture;} 
   GLuint loadTexToGL (SDL_Surface* surface);
+  inline bool hasAlpha(void) {return bAlpha;}
 
   bool loadImage(const char* imageName);
Index: orxonox/trunk/src/lib/graphics/particles/particle_emitter.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/particles/particle_emitter.cc	(revision 3966)
+++ orxonox/trunk/src/lib/graphics/particles/particle_emitter.cc	(revision 3966)
@@ -0,0 +1,149 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: Patrick Boenzli
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PARTICLE
+
+#include "particle_emitter.h"
+
+#include "particle_system.h"
+#include "particle_engine.h"
+
+using namespace std;
+
+
+/**
+   \brief standard constructor
+*/
+ParticleEmitter::ParticleEmitter(const Vector& direction, float angle, float emissionRate, 
+		  float velocity)
+{
+   this->setClassName ("ParticleEmitter");
+   this->direction = direction;
+   this->setSpread(angle);
+   this->setEmissionRate(emissionRate);
+   this->setVelocity(velocity);
+
+   this->saveTime = 0.0;
+
+   ParticleEngine::getInstance()->addEmitter(this);
+}
+
+
+
+/**
+   \brief standard destructor
+
+*/
+ParticleEmitter::~ParticleEmitter () 
+{
+  ParticleEngine::getInstance()->removeEmitter(this);
+  
+}
+
+
+/**
+   \brief this start the emitter
+*/
+void ParticleEmitter::start() {}
+
+
+/**
+   \brief this stops the emitter
+*/
+void ParticleEmitter::stop() {}
+
+
+
+
+/* these are Animation interfaces: so you can change spec values as you want */
+
+/**
+   \brief set the emission rate
+   \param sets the number of particles emitted per second
+
+   if you want to change the value of this variable during emission time (to make it more dynamic)
+   you may want to use the animation class
+*/
+void ParticleEmitter::setEmissionRate(float emissionRate)
+{
+  this->emissionRate = emissionRate;
+}
+
+/**
+   \brief set the angle of the emitter
+   \param angle around the direction in which there are particles to be emitted
+   \param randomAngle A random spread-angle, the +- randomness of this option
+
+   if you want to change the value of this variable during emission time (to make it more dynamic)
+   you may want to use the animation class
+*/
+void ParticleEmitter::setSpread(float angle, float randomAngle)
+{
+  this->angle = angle;
+  this->randomAngle = randomAngle;
+}
+
+/**
+   \brief sets the velocity of all particles emitted
+   \param velocity The starting velocity of the emitted particles
+   \param random A random starting velocity, the +- randomness of this option
+
+   if you want to change the value of this variable during emission time (to make it more dynamic)
+   you may want to use the animation class
+*/
+void ParticleEmitter::setVelocity(float velocity, float randomVelocity)
+{
+  this->velocity = velocity;
+  this->randomVelocity = randomVelocity;
+}
+
+/**
+   \brief this set the time to life of a particle, after which it will die
+   \param the time to live in seconds
+
+   if you want to change the value of this variable during emission time (to make it more dynamic)
+   you may want to use the animation class
+*/
+
+void ParticleEmitter::tick(float dt, ParticleSystem* system)
+{
+  if (likely(dt > 0.0 && this->emissionRate > 0.0))
+  {
+    // saving the time
+    float count = (dt+this->saveTime) * this->emissionRate;
+    this->saveTime = modff(count, &count);
+    this->saveTime /= this->emissionRate;
+    PRINTF(5)("emitting %f particles, saving %f seconds for the next round\n", count, this->saveTime); 
+    
+    for (int i = 0; i < count; i++)
+      // emmits from EMITTER_DOT,
+      {
+	Vector randDir = Vector(random()-RAND_MAX/2, random()-RAND_MAX/2, random()-RAND_MAX/2);
+	randDir.normalize();
+	randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)random()/RAND_MAX -.5), randDir)).apply(this->direction);
+	randDir = randDir.getNormalized()*velocity + (this->getVelocity() * system->inheritSpeed);
+
+	system->addParticle(this->getAbsCoor(), randDir);
+      }
+  }
+}
+
+/**
+   \brief outputs some nice debug information
+*/
+void ParticleEmitter::debug(void)
+{
+
+}
Index: orxonox/trunk/src/lib/graphics/particles/particle_emitter.h
===================================================================
--- orxonox/trunk/src/lib/graphics/particles/particle_emitter.h	(revision 3966)
+++ orxonox/trunk/src/lib/graphics/particles/particle_emitter.h	(revision 3966)
@@ -0,0 +1,51 @@
+/*! 
+    \file particle_e,otter.h
+    \brief Definition of a ParticleEmitter
+*/
+
+#ifndef _PARTICLE_EMITTER_H
+#define _PARTICLE_EMITTER_H
+
+#include "p_node.h"
+
+// FORWARD DEFINITION 
+struct Particle;
+class ParticleSystem;
+
+typedef enum EMITTER_TYPE {EMITTER_DOT,
+			   EMITTER_PLANE,
+			   EMITTER_SPHERE,
+			   EMITTER_CUBE};
+
+//! A default singleton class.
+class ParticleEmitter : public PNode {
+
+ public:
+  ParticleEmitter(const Vector& direction, float angle = .5, float emissionRate = 1.0,
+		  float velocity = 1.0);
+  virtual ~ParticleEmitter(void);
+
+  /* controlling the emitter: interface */
+  void start();
+  void stop();
+  void tick(float dt, ParticleSystem* system);
+
+  /* controlling the behavour: these can be used as Animation interfaces */
+  void setEmissionRate(float emissionRate);
+  void setSpread(float angle, float randomAngle = 0.0);
+  void setVelocity(float velocity, float randomVelocity = 0.0);
+
+  void debug(void);
+
+ private:
+  Vector direction;     //!< emition direction
+  float angle;          //!< max angle from the direction of the emitter
+  float randomAngle;    //!< random emission angle (angle +- angleRandom is the emitted angle.
+  float emissionRate;   //!< amount of particles per seconds emitted by emitter.
+  float velocity;       //!< the initial speed of a Particles.
+  float randomVelocity; //!< the random variation from the initial Speed.
+
+  float saveTime;       //!< The time that was missing by the last Tick (otherwise there would be no emission when framefate is too big).
+};
+
+#endif /* _PARTICLE_EMITTER_H */
Index: orxonox/trunk/src/lib/graphics/particles/particle_engine.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/particles/particle_engine.cc	(revision 3966)
+++ orxonox/trunk/src/lib/graphics/particles/particle_engine.cc	(revision 3966)
@@ -0,0 +1,307 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: ...
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PARTICLE
+
+#include "particle_engine.h"
+
+#include "particle_system.h"
+#include "particle_emitter.h"
+
+#include "list.h"
+
+using namespace std;
+
+/**
+   \brief standard constructor
+*/
+ParticleEngine::ParticleEngine () 
+{
+   this->setClassName ("ParticleEngine");
+
+   this->systemList = new tList<ParticleSystem>;
+   this->emitterList = new tList<ParticleEmitter>;
+   this->connectionList = new tList<ParticleConnection>;
+}
+
+/**
+   \brief the singleton reference to this class
+*/
+ParticleEngine* ParticleEngine::singletonRef = NULL;
+
+/**
+   \returns a Pointer to this Class
+*/
+ParticleEngine* ParticleEngine::getInstance(void)
+{
+  if (!ParticleEngine::singletonRef)
+    ParticleEngine::singletonRef = new ParticleEngine();
+  return ParticleEngine::singletonRef;
+}
+
+/**
+   \brief deletes all the system, emitters, connections and Lists
+*/
+ParticleEngine::~ParticleEngine () 
+{
+  // delete all remaining systems
+  tIterator<ParticleSystem>* sysIt = this->systemList->getIterator();
+  ParticleSystem* tmpSys = sysIt->nextElement();
+  while(tmpSys)
+    {
+      delete tmpSys;
+      tmpSys = sysIt->nextElement();
+    }
+  delete sysIt;
+  delete this->systemList;
+
+  // delete all remaining emitters
+  tIterator<ParticleEmitter>* emitIt = this->emitterList->getIterator();
+  ParticleEmitter* tmpEmit = emitIt->nextElement();
+  while(tmpEmit)
+    {
+      delete tmpEmit;
+      tmpEmit = emitIt->nextElement();
+    }
+  delete emitIt;
+  delete this->emitterList;
+
+  // there should be no more Connections
+  if (this->connectionList->getSize() == 0)
+    delete this->connectionList;
+  else
+    PRINTF(2)("The Connection List is not empty. This should not happen.\n");
+
+  ParticleEngine::singletonRef = NULL;
+}
+
+/**
+   \brief Adds a System to the System list.
+
+   this is done automatically when creating a ParticleSystem
+*/
+void ParticleEngine::addSystem(ParticleSystem* system)
+{
+  this->systemList->add(system);
+}
+
+/**
+   \brief Adds an emitter to the emitterList
+
+   this is done automatically when creating a ParticleEmitter
+*/
+void ParticleEngine::addEmitter(ParticleEmitter* emitter)
+{
+  this->emitterList->add(emitter);
+}
+
+/**
+   \brief Connects a ParticleSystem to a ParticleSystem thus emitting Particles.
+   \param emitter the Emitter to connect to the System
+   \param system the System to connect to the Emitter
+*/
+void ParticleEngine::addConnection(ParticleEmitter* emitter, ParticleSystem* system)
+{
+  // look, if we have already added this connection
+  tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
+  ParticleConnection* tmpConnection = tmpConIt->nextElement();
+  while(tmpConnection)
+    {
+      if (tmpConnection->emitter == emitter && tmpConnection->system == system)
+	{
+	  PRINTF(2)("Connection between Emitter and System already added\n");
+	  delete tmpConIt;
+	  return;
+	}
+      
+      tmpConnection = tmpConIt->nextElement();
+    }
+  delete tmpConIt;
+  
+
+
+  ParticleConnection* tmpCon = new ParticleConnection;
+  tmpCon->emitter = emitter;
+  tmpCon->system = system;
+
+  this->connectionList->add(tmpCon);
+}
+
+/**
+   \brief Removes a system from the systemList and also removes all Connections to the System
+   \param system The ParticleSystem to delete
+*/
+bool ParticleEngine::removeSystem(ParticleSystem* system)
+{
+  // remove any connections, that have this system within
+  tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
+  ParticleConnection* tmpConnection = tmpConIt->nextElement();
+  while(tmpConnection)
+    {
+      if (tmpConnection->system == system)
+	this->breakConnection(tmpConnection);
+      tmpConnection = tmpConIt->nextElement();
+    }
+  delete tmpConIt;
+
+  // remove the System from the systemList.
+  this->systemList->remove(system);
+}
+
+/**
+   \brief removes an emitter from the emitterList and also from all Connections it is attached to.
+   \param emitter the ParticleEmitter to remove.
+*/
+bool ParticleEngine::removeEmitter(ParticleEmitter* emitter)
+{
+  // remove any connections, that have this emitter within
+  tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
+  ParticleConnection* tmpConnection = tmpConIt->nextElement();
+  while(tmpConnection)
+    {
+      if (tmpConnection->emitter == emitter)
+	this->breakConnection(tmpConnection);
+      tmpConnection = tmpConIt->nextElement();
+    }
+  delete tmpConIt;
+
+  // remove the emitter from the emitterList
+  this->emitterList->remove(emitter);
+}
+
+/**
+   \brief removes a Connection between an Emitter and a System
+   \param emitter The emitter of the connection to remove
+   \param system The system of the connection to remove
+   \returns true, if the connection was broken, false if the conntection was not found
+
+   only if both system and emitter are in the connection the Connection will be broken
+*/
+bool ParticleEngine::breakConnection(ParticleEmitter* emitter, ParticleSystem* system)
+{
+  // look, if we have already added this connection
+  tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
+  ParticleConnection* tmpConnection = tmpConIt->nextElement();
+  while(tmpConnection)
+    {
+    if (tmpConnection->emitter == emitter && tmpConnection->system == system)
+      {
+	this->breakConnection(tmpConnection);
+	delete tmpConIt;
+	return true;
+      }
+    tmpConnection = tmpConIt->nextElement();
+    }
+  delete tmpConIt;
+  return false;
+}
+
+/**
+   \brief removes a Connection between an Emitter and a System
+   \param connection the connection to remove
+
+   \see bool ParticleEngine::breakConnection(ParticleEmitter* emitter, ParticleSystem* system)
+*/
+bool ParticleEngine::breakConnection(ParticleConnection* connection)
+{
+  this->connectionList->remove(connection);
+  return true;
+}
+
+
+/**
+   \brief this function ticks all the ParticleSystems, so an animation will flow
+   \param dt passed since last tick
+*/
+void ParticleEngine::tick(float dt)
+{
+  // add new Particles to each System connected to an Emitter.
+  tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
+  ParticleConnection* tmpConnection = tmpConIt->nextElement();
+  while(tmpConnection)
+    {
+      tmpConnection->emitter->tick(dt, tmpConnection->system);
+      tmpConnection = tmpConIt->nextElement();
+    }
+  delete tmpConIt;
+  
+
+  // ticks all the ParticleSystems
+  tIterator<ParticleSystem>* tmpIt = systemList->getIterator();
+  ParticleSystem* tmpSys = tmpIt->nextElement();
+  while(tmpSys)
+    {
+      tmpSys->tick(dt);
+      tmpSys = tmpIt->nextElement();
+    }
+  delete tmpIt;
+}
+
+/**
+   \brief draws all the systems and their Particles.
+*/
+void ParticleEngine::draw(void)
+{
+  tIterator<ParticleSystem>* tmpIt = systemList->getIterator();
+  ParticleSystem* tmpSys = tmpIt->nextElement();
+  while(tmpSys)
+    {
+      tmpSys->draw();
+      tmpSys = tmpIt->nextElement();
+    }
+  delete tmpIt;
+
+}
+
+/**
+   \brief outputs some nice debug information
+*/
+void ParticleEngine::debug(void)
+{
+  PRINT(0)("+-----------------------------------+\n");
+  PRINT(0)("+ PARTICLE-ENGINE DEBUG INFORMATION +\n");
+  PRINT(0)("+-----------------------------------+\n");
+  PRINT(0)(" Reference: %p\n", ParticleEngine::singletonRef);
+  PRINT(0)(" Count: Emitters: %d; Systems: %d, Connections: %d\n",
+	    this->emitterList->getSize(), this->systemList->getSize(), this->connectionList->getSize());
+  if (this->connectionList->getSize() > 0)
+    {
+      PRINT(0)(" Connections:\n");
+      PRINT(0)(" -----------------------------------\n");
+
+      tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
+      ParticleConnection* tmpConnection = tmpConIt->nextElement();
+      while(tmpConnection)
+	{
+	  PRINT(0)(" Emitter '%s' emitts into System '%s'\n", tmpConnection->emitter->getName(), tmpConnection->system->getName());
+	  tmpConnection = tmpConIt->nextElement();
+	}
+      delete tmpConIt;
+    }
+  if (this->systemList->getSize() > 0)
+    {
+      tIterator<ParticleSystem>* tmpIt = systemList->getIterator();
+      ParticleSystem* tmpSys = tmpIt->nextElement();
+      while(tmpSys)
+	{
+	  tmpSys->debug();
+	  tmpSys = tmpIt->nextElement();
+	}
+      delete tmpIt;
+    }
+
+  PRINT(0)("+--------------------------------PE-+\n");
+
+}
Index: orxonox/trunk/src/lib/graphics/particles/particle_engine.h
===================================================================
--- orxonox/trunk/src/lib/graphics/particles/particle_engine.h	(revision 3966)
+++ orxonox/trunk/src/lib/graphics/particles/particle_engine.h	(revision 3966)
@@ -0,0 +1,53 @@
+/*! 
+    \file particle_engine.h
+    \brief Definition of the ParticleEngine
+*/
+
+#ifndef _PARTICLE_ENGINE_H
+#define _PARTICLE_ENGINE_H
+
+#include "base_object.h"
+
+// FORWARD DEFINITION 
+template<class T> class tList;
+class ParticleSystem;
+class ParticleEmitter;
+
+struct ParticleConnection
+{
+  ParticleEmitter* emitter;    //!< The emitter to emit system from.
+  ParticleSystem* system;      //!< The Particles emitted from emitter.
+};
+
+//! A default singleton class.
+class ParticleEngine : public BaseObject {
+
+ public:
+  static ParticleEngine* getInstance(void);
+  virtual ~ParticleEngine(void);
+
+  void tick(float dt);
+  void draw(void);
+
+  void addSystem(ParticleSystem* system);
+  void addEmitter(ParticleEmitter* emitter);
+  void addConnection(ParticleEmitter* emitter, ParticleSystem* system);
+
+  bool removeSystem(ParticleSystem* system);
+  bool removeEmitter(ParticleEmitter* emitter);
+  bool breakConnection(ParticleEmitter* emitter, ParticleSystem* system);
+  bool breakConnection(ParticleConnection* connection);
+
+  void debug();
+
+ private:
+  ParticleEngine(void);
+  static ParticleEngine* singletonRef;
+
+  tList<ParticleSystem>* systemList;
+  tList<ParticleEmitter>* emitterList;
+
+  tList<ParticleConnection>* connectionList;
+};
+
+#endif /* _PARTICLE_ENGINE_H */
Index: orxonox/trunk/src/lib/graphics/particles/particle_system.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/particles/particle_system.cc	(revision 3966)
+++ orxonox/trunk/src/lib/graphics/particles/particle_system.cc	(revision 3966)
@@ -0,0 +1,300 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PARTICLE
+
+#include "particle_system.h"
+
+#include "particle_emitter.h"
+#include "particle_engine.h"
+#include "compiler.h"
+#include "material.h"
+
+using namespace std;
+
+/**
+   \brief standard constructor
+   \param count the Count of particles in the System
+   \param type The Type of the ParticleSystem
+
+   \todo this constructor is not jet implemented - do it
+*/
+ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type)
+{
+   this->setClassName ("ParticleSystem");
+   this->name = NULL;
+   this->maxCount = maxCount;
+   this->count = 0;
+   this->particleType = type;
+   this->particles = NULL;
+   this->setConserve(.8);
+   this->setLifeSpan(.1);
+   this->setInheritSpeed(0);
+   this->glID = NULL;
+   this->setRadius(1.0, 1.0, 0.0);
+   this->setType(PARTICLE_SPRITE, 1);
+   ParticleEngine::getInstance()->addSystem(this);
+}
+
+
+/**
+   \brief standard deconstructor
+*/
+ParticleSystem::~ParticleSystem() 
+{
+  // delete what has to be deleted here
+   ParticleEngine::getInstance()->removeSystem(this);
+}
+
+/**
+   \brief sets the Name of the Particle System
+   \param name the Name of the System
+*/
+void ParticleSystem::setName(const char* name)
+{
+  if (this->name)
+    delete this->name;
+  this->name = new char[strlen(name)+1];
+  strcpy(this->name, name);
+}
+
+/**
+   \returns the Name of the ParticleSystem
+*/
+const char* ParticleSystem::getName(void) const
+{
+  return this->name;
+}
+
+/**
+   \todo this will be different
+*/
+void ParticleSystem::setType(PARTICLE_TYPE particleType, int count)
+{
+  this->particleType = particleType;
+  this->dialectCount = count;
+  if (glID != NULL)
+    delete glID;
+
+  glID = new GLuint[count];
+  for (int i = 0; i< count; i++)
+    glID[i] = 0;
+
+  glID[0] = glGenLists(count);
+  
+  material = new Material("transperencyMap");
+  material->setDiffuseMap("pictures/radialTransparency.png");
+  //  material->setTransparency(.5);
+
+  glNewList(glID[0], GL_COMPILE);
+  glBegin(GL_TRIANGLE_STRIP);
+  glTexCoord2f(1, 1);
+  glVertex3f(0.0, .5, .5);
+  glTexCoord2f(1, 0);
+  glVertex3f(0.0, -.5, .5);
+  glTexCoord2f(0, 1);
+  glVertex3f(0.0, .5, -.5);
+  glTexCoord2f(0, 0);
+  glVertex3f(0.0, -.5, -.5);
+  glEnd();
+  glEndList();
+}
+
+// setting properties
+void ParticleSystem::setMaterial(Material* material)
+{
+  this->material = material;
+}
+
+
+
+/**
+   \brief how much of the speed from the ParticleEmitter should flow onto the ParticleSystem
+   \param value a Value between zero and one
+
+   
+   if you want to change the value of this variable during emission time (to make it more dynamic)
+   you may want to use the animation class
+*/
+void ParticleSystem::setInheritSpeed(float value)
+{
+  if (unlikely(value > 1.0))
+    this->inheritSpeed = 1;
+  else if (unlikely(value < 0.0))
+    this->inheritSpeed = 0;
+  else
+    this->inheritSpeed = value;
+}
+
+/**
+   \brief Sets the lifespan of newly created particles
+*/   
+void ParticleSystem::setLifeSpan(float lifeSpan, float randomLifeSpan)
+{
+  this->lifeSpan = lifeSpan;
+  this->randomLifeSpan = randomLifeSpan;
+}
+
+/**
+   \brief sets the radius of newly created particles
+*/
+void ParticleSystem::setRadius(float startRadius, float endRadius, float randomStartRadius, float randomEndRadius)
+{
+  this->startRadius = startRadius;
+  this->endRadius = endRadius;
+  this->randomStartRadius = randomStartRadius;
+  this->randomEndRadius = randomEndRadius;
+}
+
+/**
+   \brief sets the conserve Factor of newly created particles
+*/
+void ParticleSystem::setConserve(float conserve)
+{
+  if (conserve > 1.0)
+    this->conserve = 1.0;
+  else if (conserve < 0.0)
+    this->conserve = 0.0;
+  else
+    this->conserve = conserve;
+}
+
+/**
+   \brief ticks the system.
+   \param dt the time to tick all the Particles of the System
+
+   this is used to get all the particles some motion
+*/
+void ParticleSystem::tick(float dt)
+{
+  Particle* tickPart = particles;  // the particle to Tick
+  Particle* prevPart = NULL;       // 
+  while (likely(tickPart != NULL))
+    {
+      tickPart->position = tickPart->position + tickPart->velocity;
+      tickPart->radius += tickPart->radiusIt * dt;
+
+      // many more to come
+
+
+      if (this->conserve < 1.0)
+	tickPart->velocity = tickPart->velocity * this->conserve;
+      // find out if we have to delete tickPart
+      if ((tickPart->timeToLive -= dt) <= 0)
+	{
+	  // remove the particle from the list
+	  if (likely(prevPart != NULL))
+	    {
+	      prevPart->next = tickPart->next;
+	      delete tickPart;
+	      tickPart = prevPart->next;
+	    }
+	  else
+	    {
+	      prevPart = NULL;
+	      this->particles = tickPart->next;
+	      delete tickPart;
+	      tickPart = this->particles;
+	    }
+	  --this->count;
+	}
+      else
+	{      
+	  prevPart = tickPart;
+	  tickPart = tickPart->next;
+	}
+    }
+}
+
+/**
+   \brief draws all the Particles of this System
+*/
+void ParticleSystem::draw(void)
+{
+  //  material->select();
+
+
+  glMatrixMode(GL_MODELVIEW);
+  //  glDisable(GL_LIGHTING);
+  material->select();
+
+  Particle* drawPart = particles;
+  if (likely(drawPart != NULL))
+    {
+      glBegin(GL_POINTS);
+      while (likely(drawPart != NULL))
+	{
+	  // draw in DOT mode
+	  glPushMatrix();
+	  glTranslatef(drawPart->position.x, drawPart->position.y, drawPart->position.z);
+	  glScalef(drawPart->radius, drawPart->radius, drawPart->radius);
+	  glCallList(*this->glID);
+	  
+	  //	  	  glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z);
+	  drawPart = drawPart->next;
+	  glPopMatrix();
+	}
+      glEnd();
+    }
+}
+
+/**
+   \brief adds a new Particle to the System
+   \param position the position where the particle gets emitted.
+   \param velocity the Starting velocity of the particle.
+   \param data some more data given by the emitter
+*/
+void ParticleSystem::addParticle(const Vector& position, const Vector& velocity, unsigned int data)
+{
+  if (this->count <= this->maxCount)
+    {
+      // if it is the first Particle
+      if (unlikely(particles == NULL))
+	{
+	  this->particles = new Particle;
+	  this->particles->next = NULL;
+	}
+      // filling the List from the beginning
+      else
+	{
+	  Particle* tmpPart = new Particle;
+	  tmpPart->next = this->particles;
+	  this->particles = tmpPart;
+	}
+      
+      particles->timeToLive = this->lifeSpan + (float)(random()/RAND_MAX)* this->randomLifeSpan;
+      particles->position = position;
+      particles->velocity = velocity;
+
+      //  particle->rotation = ; //! \todo rotation is once again something to be done.
+      particles->mass = this->initialMass + (random()/RAND_MAX -.5)* this->randomInitialMass;
+      particles->radius = this->startRadius + (random()/RAND_MAX-.5)*this->randomStartRadius;
+      
+      particles->radiusIt = (this->endRadius + (random()/RAND_MAX-.5)*this->randomEndRadius - particles->radius) / particles->timeToLive;
+
+      ++this->count;
+    }
+  else
+    PRINTF(4)("maximum count of particles reached not adding any more\n");
+}
+
+/**
+   \brief outputs some nice debug information
+*/
+void ParticleSystem::debug(void)
+{
+  PRINT(0)("  ParticleSystem %s\n", this->name);
+  PRINT(0)("  ParticleCount: %d, maximumCount: %d :: filled %d%%\n", this->count, this->maxCount, 100*this->count/this->maxCount);
+}
Index: orxonox/trunk/src/lib/graphics/particles/particle_system.h
===================================================================
--- orxonox/trunk/src/lib/graphics/particles/particle_system.h	(revision 3966)
+++ orxonox/trunk/src/lib/graphics/particles/particle_system.h	(revision 3966)
@@ -0,0 +1,98 @@
+/*! 
+    \file particle_system.h
+
+*/
+
+#ifndef _PARTICLE_SYSTEM_H
+#define _PARTICLE_SYSTEM_H
+
+#include "base_object.h"
+#include "vector.h"
+
+#define PARTICLE_DOT_MASK           0x00001
+#define PARTICLE_SPRITE_MASK        0x00010
+#define PARTICLE_MODEL_MASK         0x00100
+#define PARTICLE_WORDL_ENTITY_MASK  0x01000
+#define PARTICLE_MULTI_MASK         0x10000
+
+//! An enumerator for the different types of particles.
+typedef enum PARTICLE_TYPE {PARTICLE_DOT = PARTICLE_DOT_MASK,
+			    PARTICLE_SPRITE = PARTICLE_SPRITE_MASK,
+			    PARTICLE_MULTI_SPRITE = PARTICLE_SPRITE_MASK | PARTICLE_MULTI_MASK,
+			    PARTICLE_MODEL = PARTICLE_MODEL_MASK,
+			    PARTICLE_MULTI_MODE = PARTICLE_MODEL_MASK | PARTICLE_MULTI_MASK};
+
+#define PARTICLE_DEFAULT_MAX_COUNT    200               //!< a default count of particles in the system.
+#define PARTICLE_DEFAULT_TYPE         PARTICLE_SPRITE   //!< A default type of the system.
+
+// FORWARD DEFINITION
+class Material;
+class ParticleEmitter;
+
+
+//! A struct for one Particle
+typedef struct Particle
+{
+  float timeToLive;           //!< The time this particle lives from NOW on.
+  Vector position;            //!< The current position of this particle.
+  Vector velocity;            //!< The current velocity of this particle.
+  Quaternion rotation;        //!< The current rotation of this particle.
+  float mass;                 //!< The mass of this particle.
+  float radius;               //!< The current size of this particle.
+  float radiusIt;             //!< The difference of the Size per second.
+
+  Particle* next;             //!< pointer to the next particle in the List. (NULL if no preceding one)
+};
+
+//! A class to handle particle Systems
+class ParticleSystem : public BaseObject {
+  friend class ParticleEmitter;
+
+ public:
+  ParticleSystem(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT, PARTICLE_TYPE type = PARTICLE_DEFAULT_TYPE);
+  virtual ~ParticleSystem();
+  void setName(const char* name);
+  const char* getName(void) const;
+
+  void setType(PARTICLE_TYPE particleType, int count = 0);
+  void setMaterial(Material* material);
+  void setInheritSpeed(float value);
+  void setLifeSpan(float lifeSpan, float randomLifeSpan = 0.0);
+  void setRadius(float startRadius, float endRadius, float randomStartRadius = 0.0, float randomEndRadius = 0.0);
+  void setConserve(float conserve);
+  void setMass(float mass, float randomMass);
+
+  void tick(float dt);
+  void draw(void);
+
+  void debug(void);
+
+ private:
+  char* name;                // the Name of the Particle System
+
+  float conserve;            //!< How much energy gets conserved to the next Tick.
+  float lifeSpan;            //!< Initial lifetime of a Particle.
+  float randomLifeSpan;
+  float startRadius;
+  float endRadius;
+  float randomStartRadius;
+  float randomEndRadius;
+  float initialMass;
+  float randomInitialMass;
+  float inheritSpeed;
+
+  // particles
+  int maxCount;              //!< The maximum count of Particles.
+  int count;                 //!< The current count of Particles.
+  PARTICLE_TYPE particleType;//!< A type for all the Particles
+  Material* material;        //!< A Material for all the Particles.
+  Particle* particles;       //!< A list of particles of this System.
+
+  GLuint* glID;              //!< A List of different gl-List-ID's
+  GLuint dialectCount;       //!< How many different types of particles are there in the Particle System
+
+  void addParticle(const Vector& position, const Vector& velocity, unsigned int data = 0);
+  
+};
+
+#endif /* _PARTICLE_SYSTEM_H */
