Index: orxonox/trunk/src/util/animation/animation3d.cc
===================================================================
--- orxonox/trunk/src/util/animation/animation3d.cc	(revision 3971)
+++ orxonox/trunk/src/util/animation/animation3d.cc	(revision 3973)
@@ -42,5 +42,6 @@
   this->nextKeyFrame = tmpKeyFrame;
 
-  this->animFunc = &Animation3D::linear;
+  this->animFuncMov = &Animation3D::mLinear;
+  this->animFuncRot = &Animation3D::rLinear;
 }
 
@@ -72,5 +73,6 @@
   this->nextKeyFrame = keyFrameList->nextElement(keyFrameList->firstElement());
   this->localTime = 0.0;
-  this->setAnimFunc(this->currentKeyFrame->animFunc);
+  this->setAnimFuncMov(this->currentKeyFrame->animFuncMov);
+  this->setAnimFuncRot(this->currentKeyFrame->animFuncRot);
 }
 
@@ -82,5 +84,5 @@
    \param animFunc The function to animate between this keyFrame and the next one
 */
-void Animation3D::addKeyFrame(Vector position, Quaternion direction, float duration, ANIM_FUNCTION animFunc)
+void Animation3D::addKeyFrame(Vector position, Quaternion direction, float duration, ANIM_FUNCTION animFuncMov, ANIM_FUNCTION animFuncRot)
 {
   // some small check
@@ -94,5 +96,6 @@
     {
       tmpKeyFrame = this->keyFrameList->firstElement();
-      this->setAnimFunc(animFunc);
+      this->setAnimFuncMov(animFuncMov);
+      this->setAnimFuncRot(animFuncRot);
     }
   else
@@ -108,7 +111,10 @@
   tmpKeyFrame->direction = direction;
   tmpKeyFrame->duration = duration;
-  tmpKeyFrame->animFunc = animFunc;
+  tmpKeyFrame->animFuncMov = animFuncMov;
+  tmpKeyFrame->animFuncRot = animFuncRot;
   this->keyFrameCount++;
 }
+
+
 
 /**
@@ -130,48 +136,54 @@
 	    this->handleInfinity();
 	  this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
-	  this->setAnimFunc(this->currentKeyFrame->animFunc);	  
+	  this->setAnimFuncMov(this->currentKeyFrame->animFuncMov);
+	  this->setAnimFuncRot(this->currentKeyFrame->animFuncRot);
 	}
       /* now animate it */
-      (this->*animFunc)(this->localTime);
-    }
-}
-
-
-/**
-   \brief Sets The kind of Animation between this keyframe and the next one
+      (this->*animFuncMov)(this->localTime);
+      (this->*animFuncRot)(this->localTime);
+    }
+}
+
+
+/*==Movement Section==========================================================*/
+
+/**
+   \brief Sets The kind of movment Animation between this keyframe and the next one
    \param animFunc The Type of Animation to set
 */
-void Animation3D::setAnimFunc(ANIM_FUNCTION animFunc)
-{
-  switch (animFunc)
+void Animation3D::setAnimFuncMov(ANIM_FUNCTION animFuncMov)
+{
+  switch (animFuncMov)
     {
     default:
     case ANIM_CONSTANT:
-      this->animFunc = &Animation3D::constant;
+      this->animFuncMov = &Animation3D::mConstant;
       break;
     case ANIM_LINEAR:
-      this->animFunc = &Animation3D::linear;
+      this->animFuncMov = &Animation3D::mLinear;
       break;
     case ANIM_SINE:
-      this->animFunc = &Animation3D::sine;
+      this->animFuncMov = &Animation3D::mSine;
       break;
     case ANIM_COSINE:
-      this->animFunc = &Animation3D::cosine;
+      this->animFuncMov = &Animation3D::mCosine;
       break;
     case ANIM_EXP:
-      this->animFunc = &Animation3D::exp;
+      this->animFuncMov = &Animation3D::mExp;
       break;
     case ANIM_NEG_EXP:
-      this->animFunc = &Animation3D::negExp;
+      this->animFuncMov = &Animation3D::mNegExp;
       this->expFactor = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D);
       break;
     case ANIM_QUADRATIC:
-      this->animFunc = &Animation3D::quadratic;
+      this->animFuncMov = &Animation3D::mQuadratic;
       break;
     case ANIM_RANDOM:
-      this->animFunc = &Animation3D::random;
-      break;
-    }
-}
+      this->animFuncMov = &Animation3D::mRandom;
+      break;
+    }
+}
+
+
 
 /**
@@ -179,5 +191,5 @@
    \param timePassed The time passed since this Keyframe began
 */
-void Animation3D::constant(float timePassed) const
+void Animation3D::mConstant(float timePassed) const
 {
   this->object->setRelCoor(this->currentKeyFrame->position);
@@ -197,5 +209,5 @@
    \todo implement also do this for direction
 */
-void Animation3D::linear(float timePassed) const
+void Animation3D::mLinear(float timePassed) const
 {
   this->object->setRelCoor(this->currentKeyFrame->position +
@@ -215,5 +227,5 @@
    \todo implement
 */
-void Animation3D::sine(float timePassed) const
+void Animation3D::mSine(float timePassed) const
 {
   if( timePassed  < this->currentKeyFrame->duration/2.0)
@@ -232,5 +244,5 @@
    \todo implement
 */
-void Animation3D::cosine(float timePassed) const
+void Animation3D::mCosine(float timePassed) const
 {
   this->object->setRelCoor( this->nextKeyFrame->position -
@@ -250,8 +262,8 @@
    \param timePassed The time passed since this Keyframe began
 */
-void Animation3D::exp(float timePassed) const
+void Animation3D::mExp(float timePassed) const
 {
   PRINTF(0)("no exp animation3d defined\n");
-  this->linear(timePassed);
+  this->mLinear(timePassed);
 }
 
@@ -260,5 +272,5 @@
    \param timePassed The time passed since this Keyframe began
 */
-void Animation3D::negExp(float timePassed) const
+void Animation3D::mNegExp(float timePassed) const
 {
   this->object->setRelCoor( this->currentKeyFrame->position +
@@ -274,8 +286,8 @@
    \todo implement
 */
-void Animation3D::quadratic(float timePassed) const
+void Animation3D::mQuadratic(float timePassed) const
 {
   PRINTF(0)("no quadratic animation3d defined\n");
-  this->linear(timePassed);
+  this->mLinear(timePassed);
 }
 
@@ -284,5 +296,5 @@
    \param timePassed The time passed since this Keyframe began
 */
-void Animation3D::random(float timePassed) const
+void Animation3D::mRandom(float timePassed) const
 {
   this->object->setRelCoor(this->currentKeyFrame->position + 
@@ -291,2 +303,128 @@
 			  (this->nextKeyFrame->direction - this->currentKeyFrame->direction)* (float)rand()/(float)RAND_MAX);
 }
+
+
+/*==Rotation Section==========================================================*/
+
+
+/**
+   \brief Sets The kind of rotation Animation between this keyframe and the next one
+   \param animFunc The Type of Animation to set
+*/
+void Animation3D::setAnimFuncRot(ANIM_FUNCTION animFuncRot)
+{
+  switch (animFuncRot)
+    {
+   default:
+    case ANIM_CONSTANT:
+      this->animFuncRot = &Animation3D::rConstant;
+      break;
+    case ANIM_LINEAR:
+      this->animFuncRot = &Animation3D::rLinear;
+      break;
+    case ANIM_SINE:
+      this->animFuncRot = &Animation3D::rSine;
+      break;
+    case ANIM_COSINE:
+      this->animFuncRot = &Animation3D::rCosine;
+      break;
+    case ANIM_EXP:
+      this->animFuncRot = &Animation3D::rExp;
+      break;
+    case ANIM_NEG_EXP:
+      this->animFuncRot = &Animation3D::rNegExp;
+      break;
+    case ANIM_QUADRATIC:
+      this->animFuncRot = &Animation3D::rQuadratic;
+      break;
+    case ANIM_RANDOM:
+      this->animFuncRot = &Animation3D::rRandom;
+      break;
+    }
+}
+
+
+/**
+   \brief stays at the value of the currentKeyFrame
+   \param timePassed The time passed since this Keyframe began
+*/
+void Animation3D::rConstant(float timePassed) const
+{
+}
+
+/**
+   \brief linear interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+
+   \todo implement also do this for direction
+*/
+void Animation3D::rLinear(float timePassed) const
+{
+  this->object->setRelDir(quatSlerp( this->nextKeyFrame->direction, 
+				     this->currentKeyFrame->direction, 
+				     timePassed/this->currentKeyFrame->duration) );
+}
+
+/**
+   \brief a Sinusodial Interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+
+   \todo implement
+*/
+void Animation3D::rSine(float timePassed) const
+{
+}
+
+
+/**
+   \brief a cosine interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+
+   \todo implement
+*/
+void Animation3D::rCosine(float timePassed) const
+{
+}
+
+
+/*
+ return ((this->nextKeyFrame->value + this->currentKeyFrame->value) +
+    (this->currentKeyFrame->value - this->nextKeyFrame->value) *
+    cos( M_PI * timePassed / this->currentKeyFrame->duration))/2;
+*/
+
+/**
+   \brief an exponential interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+*/
+void Animation3D::rExp(float timePassed) const
+{
+
+}
+
+/**
+   \brief a negative exponential interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+*/
+void Animation3D::rNegExp(float timePassed) const
+{
+}
+
+
+/**
+   \brief a quadratic interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+
+   \todo implement
+*/
+void Animation3D::rQuadratic(float timePassed) const
+{
+}
+
+/**
+   \brief some random animation (fluctuating)
+   \param timePassed The time passed since this Keyframe began
+*/
+void Animation3D::rRandom(float timePassed) const
+{
+}
Index: orxonox/trunk/src/util/animation/animation3d.h
===================================================================
--- orxonox/trunk/src/util/animation/animation3d.h	(revision 3971)
+++ orxonox/trunk/src/util/animation/animation3d.h	(revision 3973)
@@ -19,5 +19,6 @@
   Vector position;                  //!< The position of this KeyFrame
   Quaternion direction;             //!< The direction of this KeyFrame
-  ANIM_FUNCTION animFunc;           //!< with whitch function to iterate to the next KeyFrame3D
+  ANIM_FUNCTION animFuncMov;        //!< with whitch function to iterate movement to the next KeyFrame3D
+  ANIM_FUNCTION animFuncRot;        //!< with whitch function to iterate rotation to the next KeyFrame3D
 };
 
@@ -34,22 +35,32 @@
   virtual void rewind(void);
 
-  void addKeyFrame(Vector position, Quaternion direction, float time, ANIM_FUNCTION animFunc = ANIM_LINEAR);
+  void addKeyFrame(Vector position, Quaternion direction, float time, ANIM_FUNCTION animFuncMov = ANIM_LINEAR, ANIM_FUNCTION animFuncRot = ANIM_LINEAR);
   //  void addKeyFrame(KeyFrame3D* frame);
 
   virtual void tick(float dt);
-
+ 
  private:
   // animation functions
-  void setAnimFunc(ANIM_FUNCTION animFunc);
-  void constant(float timePassed) const;
-  void linear(float timePassed) const;
-  void sine(float timePassed) const;
-  void cosine(float timePassed) const;
-  void exp(float timePassed) const;
-  void negExp(float timePassed) const;
-  void quadratic(float timePassed) const;
-  void random(float timePassed) const;
+  void setAnimFuncMov(ANIM_FUNCTION animFunc);
+  void setAnimFuncRot(ANIM_FUNCTION animFunc);
+  void mConstant(float timePassed) const;
+  void mLinear(float timePassed) const;
+  void mSine(float timePassed) const;
+  void mCosine(float timePassed) const;
+  void mExp(float timePassed) const;
+  void mNegExp(float timePassed) const;
+  void mQuadratic(float timePassed) const;
+  void mRandom(float timePassed) const;
+  void rConstant(float timePassed) const;
+  void rLinear(float timePassed) const;
+  void rSine(float timePassed) const;
+  void rCosine(float timePassed) const;
+  void rExp(float timePassed) const;
+  void rNegExp(float timePassed) const;
+  void rQuadratic(float timePassed) const;
+  void rRandom(float timePassed) const;
   //  ANIM_FUNCTION animFunc;
-  void (Animation3D::*animFunc)(float) const;      //!< A Function for the AnimationType
+  void (Animation3D::*animFuncMov)(float) const;      //!< A Function for the AnimationType
+  void (Animation3D::*animFuncRot)(float) const;      //!< A Function for the AnimationType
 
   KeyFrame3D* currentKeyFrame;                     //!< The current KeyFrame
