Index: /orxonox/trunk/src/lib/particles/particle_system.cc
===================================================================
--- /orxonox/trunk/src/lib/particles/particle_system.cc	(revision 4420)
+++ /orxonox/trunk/src/lib/particles/particle_system.cc	(revision 4421)
@@ -58,4 +58,10 @@
   this->setMass(1.0, 0.0);
   ParticleEngine::getInstance()->addSystem(this);
+
+  radiusAnim.addEntry(0.0,5);
+
+  radiusAnim.addEntry(.80,3);
+
+  radiusAnim.addEntry(.5, 0);
 }
 
@@ -247,5 +253,5 @@
       // rendering new position.
       tickPart->position = tickPart->position + tickPart->velocity * dt;
-      tickPart->radius += tickPart->radiusIt * dt;
+      tickPart->radius = radiusAnim.getValue(tickPart->lifeCycle);
       
       tickPart->extForce = Vector(0,0,0);
Index: /orxonox/trunk/src/lib/particles/particle_system.h
===================================================================
--- /orxonox/trunk/src/lib/particles/particle_system.h	(revision 4420)
+++ /orxonox/trunk/src/lib/particles/particle_system.h	(revision 4421)
@@ -12,4 +12,6 @@
 #include "glincl.h"
 #include "vector.h"
+
+#include "quick_animation.h"
 
 #define PARTICLE_DOT_MASK           0x000001
@@ -136,4 +138,6 @@
   GLuint* glID;              //!< A List of different gl-List-ID's
   GLuint dialectCount;       //!< How many different types of particles are there in the Particle System  
+
+  QuickAnimation radiusAnim;
 };
 
Index: /orxonox/trunk/src/lib/particles/quick_animation.cc
===================================================================
--- /orxonox/trunk/src/lib/particles/quick_animation.cc	(revision 4420)
+++ /orxonox/trunk/src/lib/particles/quick_animation.cc	(revision 4421)
@@ -31,14 +31,9 @@
    \brief standard constructor
 */
-QuickAnimation::QuickAnimation (float rangeStart, float valueStart, float rangeEnd, float valueEnd)
+QuickAnimation::QuickAnimation (void)
 {
    this->setClassName("QuickAnimation");
 
-   this->first = this->current = new QuickKeyFrame;
-   this->current->positionStart = rangeStart;
-   this->current->positionEnd = rangeEnd;
-   this->current->valueStart = valueStart;
-   this->current->valueEnd = valueEnd;
-   this->current->next = NULL;
+   this->first = this->current = NULL;
 }
 
@@ -48,5 +43,5 @@
 
 */
-QuickAnimation::~QuickAnimation () 
+QuickAnimation::~QuickAnimation (void)
 {
   this->current = this->first;
@@ -62,59 +57,84 @@
 }
 
-
-void QuickAnimation::addEntry(float position, float value)
+/**
+   \brief adds a new entry to the list of keyframes
+   \param position the position to add the key to
+   \param value the Value to set for the position
+   \returns false if the key existed already for a given position
+*/
+bool QuickAnimation::addEntry(float position, float value)
 {
   this->current = this->first;
-  if (position < this->current->positionStart)
+  while (this->current != NULL)
     {
-      this->current = new QuickKeyFrame;
+      // if it is between some keyframes
+      if ((!this->current->next && this->current->position < position)
+	  || (this->current->position < position && this->current->next->position > position))
+	break;
+      // if it is the same as an already existing keyframe
+      else if (this->current->position == position)
+	return false;
+      this->current = this->current->next;
+    }
 
-      this->current->positionStart = position;
-      this->current->positionEnd = this->first->positionStart;
+  QuickKeyFrame* newKey = new QuickKeyFrame;
+  if (this->first == NULL)
+    {
+      this->first = newKey;
+      this->current = newKey;
+      newKey->next = NULL;
+    }
+  else
+    {
+      newKey->next = this->current->next;
+      this->current->next = newKey;
+    }
+  newKey->value = value;
+  newKey->position = position;
+  
+  this->current = this->first;
+}
 
-      this->current->valueStart = value;
-      this->current->valueEnd = this->first->valueStart;
-      
-      this->current->next = this->first;
-      this->first = this->current;
-    }
-  
-  while(this->current != NULL)
+/**
+   \brief returns the value of the animation at a certain position
+   \param position the position to get the value from :)
+*/
+float QuickAnimation::getValue(float position)
+{
+  if (unlikely(this->first == NULL))
+    return 0.0;
+  else if (unlikely (this->first->next == NULL))
+    return this->first->value;
+  else
     {
-      if (this->current->positionStart < position)
+      if (unlikely(position < this->current->position))
 	{
-	  QuickKeyFrame* tmpKey = new QuickKeyFrame;
-	  tmpKey->positionStart = position;
-	  tmpKey->positionEnd = this->current->positionEnd;
-	  tmpKey->valueStart = value;
-	  tmpKey->valueEnd = this->current->valueEnd;
-	  tmpKey->next = this->current->next;
-	  
-	  this->current->positionEnd = tmpKey->positionStart;
-	  this->current->valueEnd = tmpKey->valueStart;
+	  if (position <= this->first->position)
+	    return this->first->value;
+	  this->current = this->first;
 	}
+      while (likely(this->current->next != NULL && position > this->current->next->position))
+	this->current = this->current->next;
+      if (this->current->next == NULL)
+	return this->current->value;
+	       
+      return this->current->value + (this->current->next->value - this->current->value)
+	* ((position-this->current->position) / (this->current->next->position -this->current->position));
     }
 }
 
 
-float QuickAnimation::getValue(float position)
+void QuickAnimation::debug(void)
 {
-  while (likely (this->current->positionStart > position || this->current->positionEnd < position))
+  this->current = this->first;
+
+  PRINT(0)("QuickAnim:: (position, value)");
+  while(this->current)
     {
-      if (likely(this->current->next != NULL))
-	this->current = this->current->next;
-      else
-	{
-	  if (unlikely(this->first->positionStart > position))
-	    {
-	      PRINTF(2)("Position out of range. chose %f, min is: %f, max is\n", position, this->first->positionStart, this->current->positionEnd);
-	      return 0;
-	    }
-	  this->current = this->first;
-	}
+      PRINT(0)("->(%f, %f)", this->current->position, this->current->value);
+      this->current = this->current->next;
     }
-  return this->current->valueStart + (this->current->positionEnd - position) *
-    (this->current->valueEnd - this->current->valueStart) /
-    (this->current->positionEnd - this->current->positionStart);
+
+  PRINT(0)("\n");
+  this->current = this->first;
 }
-
Index: /orxonox/trunk/src/lib/particles/quick_animation.h
===================================================================
--- /orxonox/trunk/src/lib/particles/quick_animation.h	(revision 4420)
+++ /orxonox/trunk/src/lib/particles/quick_animation.h	(revision 4421)
@@ -28,23 +28,21 @@
   struct QuickKeyFrame
   {
-    float valueStart;       //!< The starting value of this KeyFrame
-    float valueEnd;         //!< The end value of this KeyFrame
-    float positionStart;    //!< The starting position of this KeyFrame
-    float positionEnd;      //!< The end position of thies KeyFrame
+    float value;       //!< The starting value of this KeyFrame
+    float position;    //!< The end position of thies KeyFrame
 
     QuickKeyFrame* next;    //!< The next Animation
   };
 
-  QuickAnimation(float rangeStart = 0.0, float valueStart = 0.0, float rangeEnd = 1.0, float valueEnd = 0.0);
+  QuickAnimation();
   virtual ~QuickAnimation();
 
-  void addEntry(float position, float value);
+  bool addEntry(float position, float value);
 
   float getValue(float position);
 
+  void debug(void);
  private:
   QuickKeyFrame* first;
   QuickKeyFrame* current;
-
 };
 
