Index: orxonox/trunk/src/simple_animation.cc
===================================================================
--- orxonox/trunk/src/simple_animation.cc	(revision 3734)
+++ orxonox/trunk/src/simple_animation.cc	(revision 3738)
@@ -1,2 +1,3 @@
+
 
 
@@ -45,4 +46,5 @@
    this->setClassName ("SimpleAnimation");
    this->frames = new tList<KeyFrame>();
+   this->animators = new tList<Animation>();
    this->localTime = 0;
    this->bRunning = false;
@@ -254,61 +256,69 @@
 void SimpleAnimation::tick(float time)
 {
-  if( !this->bRunning)
-    return;
-
   this->localTime += time;
-  /* first get the current frame via time-stamps */ 
-  while( this->localTime > this->currentFrame->time)
-    {
-      printf("SimpleAnimation::tick(...) - changing Frame\n");
-      this->localTime -= this->currentFrame->time;
-
-      //this->currentFrame->object->setRelCoor(*this->currentFrame->position);
-      *this->lastPosition = *this->currentFrame->position;
-
-      this->lastFrame = this->currentFrame;
-      this->currentFrame = this->frames->nextElement(this->currentFrame);
-      this->mode = this->currentFrame->mode;
-      if( this->mode == NEG_EXP)
+  tIterator<Animation>* iterator = this->animators->getIterator();
+  Animation* anim = iterator->nextElement();
+  while( anim != NULL)
+    {
+      if( anim->bRunning)
 	{
-	  *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
-	  deltaT = 1/this->currentFrame->time * logf(1.0 + 600.0/this->tmpVect->len());
+	  
+	  
+	  /* first get the current frame via time-stamps */ 
+	  while( this->localTime > anim->currentFrame->time)
+	    {
+	      printf("SimpleAnimation::tick(...) - changing Frame\n");
+	      
+	      //this->currentFrame->object->setRelCoor(*this->currentFrame->position);
+	      *anim->lastPosition = *anim->currentFrame->position;
+	      
+	      anim->lastFrame = anim->currentFrame;
+	      anim->currentFrame = anim->frames->nextElement(anim->currentFrame);
+	      anim->movMode = anim->currentFrame->mode;
+	      if( anim->movMode == NEG_EXP)
+		{
+		  *anim->tmpVect = *anim->currentFrame->position - *anim->lastFrame->position;
+		  anim->deltaT = 1/anim->currentFrame->time * logf(1.0 + 600.0/anim->tmpVect->len());
+		}
+	    }
+	  
+	  /* now animate it */
+	  switch( anim->movMode)
+	    {
+	    case LINEAR:
+	      
+	      *anim->tmpVect = *anim->currentFrame->position - *anim->lastFrame->position;
+	      *anim->tmpVect = *anim->tmpVect * this->localTime / anim->currentFrame->time;
+	      anim->currentFrame->object->setRelCoor(*anim->lastFrame->position + *anim->tmpVect);
+	      *anim->lastPosition = *anim->tmpVect;
+	      break;
+	    case EXP:
+	      
+	      break;
+	    case NEG_EXP:
+	      *anim->tmpVect = *anim->currentFrame->position - *anim->lastFrame->position;
+	      *anim->tmpVect = *anim->tmpVect * (1 - exp(- this->localTime * anim->deltaT));     
+	      anim->currentFrame->object->setRelCoor(*anim->lastFrame->position + *anim->tmpVect);
+	      *anim->lastPosition = *anim->tmpVect;
+	      break;
+	    case SIN:
+	      *anim->tmpVect = *anim->currentFrame->position - *anim->lastFrame->position;
+	      *anim->tmpVect = *anim->tmpVect * 0.5*(1 - cos(M_PI * this->localTime / anim->currentFrame->time));     
+	      anim->currentFrame->object->setRelCoor(*anim->lastFrame->position + *anim->tmpVect);
+	      *anim->lastPosition = *anim->tmpVect;
+	      break;
+	    case COS:
+	      
+	      break;
+	    case QUADRATIC:
+	      *anim->tmpVect = *anim->currentFrame->position - *anim->lastFrame->position;
+	      *anim->tmpVect = *anim->tmpVect * 1/3 * ldexpf(this->localTime, 3);
+	      break;
+	    default:
+	      break;
+	    }
 	}
-    }
-
-  /* now animate it */
-  switch( this->mode)
-    {
-    case LINEAR:
-
-      *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
-      *this->tmpVect = *this->tmpVect * this->localTime / this->currentFrame->time;
-      this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect);
-      *this->lastPosition = *this->tmpVect;
-      break;
-    case EXP:
-      
-      break;
-    case NEG_EXP:
-      *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
-      *this->tmpVect = *this->tmpVect * (1 - exp(- this->localTime * this->deltaT));     
-      this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect);
-      *this->lastPosition = *this->tmpVect;
-      break;
-    case SIN:
-      *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
-      *this->tmpVect = *this->tmpVect * 0.5*(1 - cos(M_PI * this->localTime / this->currentFrame->time));     
-      this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect);
-      *this->lastPosition = *this->tmpVect;
-      break;
-    case COS:
-      
-      break;
-    case QUADRATIC:
-      *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
-      *this->tmpVect = *this->tmpVect * 1/3 * ldexpf(this->localTime, 3);
-      break;
-    default:
-      break;
-    }
-}
+      anim = iterator->nextElement();
+    }
+  delete anim;
+}
