Index: orxonox/trunk/src/Makefile.am
===================================================================
--- orxonox/trunk/src/Makefile.am	(revision 3867)
+++ orxonox/trunk/src/Makefile.am	(revision 3868)
@@ -17,4 +17,6 @@
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/glmenu
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/ai
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/util
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/animation
 
 
@@ -33,7 +35,7 @@
 		 track_manager.cc \
 		 track_node.cc \
-		 animation.cc \
-		 animation3d.cc \
-		 animation_player.cc \
+		 util/animation/animation.cc \
+		 util/animation/animation3d.cc \
+		 util/animation/animation_player.cc \
 		 garbage_collector.cc \
 		 story_entities/story_entity.cc \
@@ -85,8 +87,8 @@
 		 track_manager.h \
 		 track_node.h \
-		 animation.h \
-		 t_animation.h \
-		 animation3d.h \
-		 animation_player.h \
+		 util/animation/animation.h \
+		 util/animation/t_animation.h \
+		 util/animation/animation3d.h \
+		 util/animation/animation_player.h \
 		 garbage_collector.h \
 		 story_entities/story_entity.h \
Index: orxonox/trunk/src/Makefile.in
===================================================================
--- orxonox/trunk/src/Makefile.in	(revision 3867)
+++ orxonox/trunk/src/Makefile.in	(revision 3868)
@@ -237,5 +237,5 @@
 target_vendor = @target_vendor@
 MAINSRCDIR = .
-AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai
+AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation
 AM_LDFLAGS = $(MWINDOWS)
 orxonox_SOURCES = orxonox.cc \
@@ -246,7 +246,7 @@
 		 track_manager.cc \
 		 track_node.cc \
-		 animation.cc \
-		 animation3d.cc \
-		 animation_player.cc \
+		 util/animation/animation.cc \
+		 util/animation/animation3d.cc \
+		 util/animation/animation_player.cc \
 		 garbage_collector.cc \
 		 story_entities/story_entity.cc \
@@ -298,8 +298,8 @@
 		 track_manager.h \
 		 track_node.h \
-		 animation.h \
-		 t_animation.h \
-		 animation3d.h \
-		 animation_player.h \
+		 util/animation/animation.h \
+		 util/animation/t_animation.h \
+		 util/animation/animation3d.h \
+		 util/animation/animation_player.h \
 		 garbage_collector.h \
 		 story_entities/story_entity.h \
@@ -490,4 +490,52 @@
 @am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
+animation.o: util/animation/animation.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT animation.o -MD -MP -MF "$(DEPDIR)/animation.Tpo" -c -o animation.o `test -f 'util/animation/animation.cc' || echo '$(srcdir)/'`util/animation/animation.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/animation.Tpo" "$(DEPDIR)/animation.Po"; else rm -f "$(DEPDIR)/animation.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/animation/animation.cc' object='animation.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/animation.Po' tmpdepfile='$(DEPDIR)/animation.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o animation.o `test -f 'util/animation/animation.cc' || echo '$(srcdir)/'`util/animation/animation.cc
+
+animation.obj: util/animation/animation.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT animation.obj -MD -MP -MF "$(DEPDIR)/animation.Tpo" -c -o animation.obj `if test -f 'util/animation/animation.cc'; then $(CYGPATH_W) 'util/animation/animation.cc'; else $(CYGPATH_W) '$(srcdir)/util/animation/animation.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/animation.Tpo" "$(DEPDIR)/animation.Po"; else rm -f "$(DEPDIR)/animation.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/animation/animation.cc' object='animation.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/animation.Po' tmpdepfile='$(DEPDIR)/animation.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o animation.obj `if test -f 'util/animation/animation.cc'; then $(CYGPATH_W) 'util/animation/animation.cc'; else $(CYGPATH_W) '$(srcdir)/util/animation/animation.cc'; fi`
+
+animation3d.o: util/animation/animation3d.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT animation3d.o -MD -MP -MF "$(DEPDIR)/animation3d.Tpo" -c -o animation3d.o `test -f 'util/animation/animation3d.cc' || echo '$(srcdir)/'`util/animation/animation3d.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/animation3d.Tpo" "$(DEPDIR)/animation3d.Po"; else rm -f "$(DEPDIR)/animation3d.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/animation/animation3d.cc' object='animation3d.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/animation3d.Po' tmpdepfile='$(DEPDIR)/animation3d.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o animation3d.o `test -f 'util/animation/animation3d.cc' || echo '$(srcdir)/'`util/animation/animation3d.cc
+
+animation3d.obj: util/animation/animation3d.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT animation3d.obj -MD -MP -MF "$(DEPDIR)/animation3d.Tpo" -c -o animation3d.obj `if test -f 'util/animation/animation3d.cc'; then $(CYGPATH_W) 'util/animation/animation3d.cc'; else $(CYGPATH_W) '$(srcdir)/util/animation/animation3d.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/animation3d.Tpo" "$(DEPDIR)/animation3d.Po"; else rm -f "$(DEPDIR)/animation3d.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/animation/animation3d.cc' object='animation3d.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/animation3d.Po' tmpdepfile='$(DEPDIR)/animation3d.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o animation3d.obj `if test -f 'util/animation/animation3d.cc'; then $(CYGPATH_W) 'util/animation/animation3d.cc'; else $(CYGPATH_W) '$(srcdir)/util/animation/animation3d.cc'; fi`
+
+animation_player.o: util/animation/animation_player.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT animation_player.o -MD -MP -MF "$(DEPDIR)/animation_player.Tpo" -c -o animation_player.o `test -f 'util/animation/animation_player.cc' || echo '$(srcdir)/'`util/animation/animation_player.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/animation_player.Tpo" "$(DEPDIR)/animation_player.Po"; else rm -f "$(DEPDIR)/animation_player.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/animation/animation_player.cc' object='animation_player.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/animation_player.Po' tmpdepfile='$(DEPDIR)/animation_player.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o animation_player.o `test -f 'util/animation/animation_player.cc' || echo '$(srcdir)/'`util/animation/animation_player.cc
+
+animation_player.obj: util/animation/animation_player.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT animation_player.obj -MD -MP -MF "$(DEPDIR)/animation_player.Tpo" -c -o animation_player.obj `if test -f 'util/animation/animation_player.cc'; then $(CYGPATH_W) 'util/animation/animation_player.cc'; else $(CYGPATH_W) '$(srcdir)/util/animation/animation_player.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/animation_player.Tpo" "$(DEPDIR)/animation_player.Po"; else rm -f "$(DEPDIR)/animation_player.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/animation/animation_player.cc' object='animation_player.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/animation_player.Po' tmpdepfile='$(DEPDIR)/animation_player.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o animation_player.obj `if test -f 'util/animation/animation_player.cc'; then $(CYGPATH_W) 'util/animation/animation_player.cc'; else $(CYGPATH_W) '$(srcdir)/util/animation/animation_player.cc'; fi`
+
 story_entity.o: story_entities/story_entity.cc
 @am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT story_entity.o -MD -MP -MF "$(DEPDIR)/story_entity.Tpo" -c -o story_entity.o `test -f 'story_entities/story_entity.cc' || echo '$(srcdir)/'`story_entities/story_entity.cc; \
@@ -1204,5 +1252,5 @@
 
 distdir: $(DISTFILES)
-	$(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/world_entities
+	$(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/util/animation $(distdir)/world_entities
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
Index: orxonox/trunk/src/animation.cc
===================================================================
--- orxonox/trunk/src/animation.cc	(revision 3867)
+++ 	(revision )
@@ -1,130 +1,0 @@
-/* 
-   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_ANIM
-
-#include "animation.h"
-#include "debug.h"
-#include "animation_player.h"
-
-/**
-   \brief creates a new Animation
-   
-   This also adds the Animation automatically to the AnimationPlayer's list
-*/
-Animation::Animation(void)
-{  
-  // initialize a beginning KeyFrame, that will be deleted afterwards
-  this->bHasKeys = false;
-  this->bHandled = true;
-  this->bDelete = false;
-  this->baseObject = NULL;
-
-  // setting default values
-  this->localTime = 0.0;
-  this->bRunning = true;
-
-  AnimationPlayer::getInstance()->addAnimation(this);
-}
-
-/**
-   \brief destructs the Animation
-   
-   this also takes the animation out of the AnimationPlayer's list (if it is there)
-*/
-Animation::~Animation(void)
-{
-  this->doNotHandle();
-}
-
-/**
-   \brief tells the AnimationPlayer, that we do not wish to  handle this animation
-   automatically.
-   
-   This means that it will not be ticked, and not be deleted with the AnimationPlayer
-*/
-void Animation::doNotHandle(void)
-{
-  if (this->bHandled)
-    AnimationPlayer::getInstance()->removeAnimation(this);
-}
-
-/**
-   \brief Sets the infinitymode
-   \param postInfinity How the Animation should advance after the last Keyframe
-*/
-void Animation::setInfinity(ANIM_INFINITY postInfinity)
-{
-  this->postInfinity = postInfinity;
-}
-
-/**
-   \brief handles the Animation if it gets out of boundraries eg. if animation is finished.
-*/
-void Animation::handleInfinity(void)
-{
-  switch (this->postInfinity)
-    {
-    case ANIM_INF_CONSTANT:
-      this->localTime = 0.0;
-      this->bRunning = false;
-      break;
-    case ANIM_INF_REPLAY:
-      this->replay();
-      break;
-    case ANIM_INF_REWIND:
-      this->stop();
-      break;
-    case ANIM_INF_DELETE: // this will possibly never be made
-      this->bDelete = true;
-      break;
-    }
-}
-
-/**
-   \brief plays the animation back from the current Time forward
-*/
-void Animation::play()
-{
-  this->bRunning = true;
-}
-
-/**
-   \brief Stops the animation. eg. pause(); rewind();
-*/
-void Animation::stop()
-{
-  this->rewind();
-  this->bRunning = true;
-  this->tick(0.0);
-  this->bRunning = false;
-}
-
-/**
-   \brief Pauses the animation. Stays at the current Time
-*/
-void Animation::pause()
-{
-  this->bRunning = false;
-}
-
-/**
-   \brief replays the animation, eg. rewind();play();
-*/
-void Animation::replay()
-{
-  this->rewind();
-  this->bRunning = true;
-}
Index: orxonox/trunk/src/animation.h
===================================================================
--- orxonox/trunk/src/animation.h	(revision 3867)
+++ 	(revision )
@@ -1,123 +1,0 @@
-/*! 
-    \file animation.h
-    A Subclass for all animations in orxonox
-*/
-
-#ifndef _ANIMATION_H
-#define _ANIMATION_H
-
-#include "list.h"
-#include "base_object.h"
-#include "confincl.h"  // must be here to determin the DEBUG-level
-
-// FORWARD DEFINITION
-
-//! An enumerator of Functions to describe the flow of the Animation
-/**
-   \todo check with Patrick it of
-
-   description in speed to the next keyframe:
-   ANIM_CONSTANT: 0, infinity.
-   ANIM_LINEAR: equal
-   ANIM_SINE: fast, slow, fast
-   ANIM_COSINE: slow, fast, slow
-   ANIM_EXP: slow, fast
-   ANIM_NEG_EXP: fast, slow
-   ANIM_RANDOM: eratic
-   
-   deprecated QUADRATIC
-*/
-typedef enum ANIM_FUNCTION {ANIM_CONSTANT,
-			    ANIM_LINEAR,
-			    ANIM_SINE,
-			    ANIM_COSINE,
-			    ANIM_EXP,
-			    ANIM_NEG_EXP,
-			    ANIM_QUADRATIC,
-			    ANIM_RANDOM};
-
-//! An enumerator describing what the animation should do after the last keyframe.
-/**
-   ANIM_INF_CONSTANT stays at the end of the animation
-   ANIM_INF_REPLAY loops back to the beginning and replays the animation
-   ANIM_INF_REWIND loops back to the beginning and then stops the animation
-   ANIM_INF_DELETE deletes the animation. !! THIS IS DANGEROUS !! only do this with non-class variables
-*/
-typedef enum ANIM_INFINITY {ANIM_INF_CONSTANT,
-			    ANIM_INF_REPLAY,
-			    ANIM_INF_REWIND,
-			    ANIM_INF_DELETE};//, ANIM_INF_LINEAR, ANIM_INF_PINGPONG;
-
-//! A Superclass for describing an animation (all animations will be derived from this one)
-/** implement in subclasses:
- * 
- * De-/Constructor
- * Animation Functions
- * virtual tick
- * addKeyFrame
- * List of keyFrames
- * currentKeyFrame/nextKeyFrame
- * virtual rewind, to go to the first Keyframe. (other functions will call this one)
-*/
-class Animation
-{
- public:
-  virtual ~Animation(void);
-  void doNotHandle(void);
-
-  void setInfinity(ANIM_INFINITY postInfinity = ANIM_INF_CONSTANT);
-
-  void play(); // equals resume();
-  void stop();
-  void pause();
-  void replay();
-  //! A virtual function that should change to the first keyframe.
-  virtual void rewind() = 0;
-  /** \brief A virtual function that ticks the animation \param dt the time passed */
-  virtual void tick(float dt) = 0;
-
-  /**
-     \returns the BaseObject, this animation operates on
-  */
-  BaseObject* getBaseObject(void) const {return baseObject;}
-
-  /** \returns if the Animation should be deleted */
-  inline bool ifDelete(void) {return bDelete;}
-
- protected:
-  Animation(void);
-
-  void handleInfinity(void);
-  // variables
-  float localTime;                //!< The Time passed since the beginning of the currentKeyFrame.
-  ANIM_INFINITY postInfinity;     //!< describing what the animation should do after the last keyframe.
-
-  BaseObject* baseObject;         //!< The same as object in the derived classes, but with reference to BaseObject
-  bool bHasKeys;                  //!< If the animation has any keys at all. Needed to add the first keyframe (and delete the dummy).
-  bool bHandled;                  //!< If this Animation is handled by the AnimationPlayer.
-  bool bRunning;                  //!< If the animation is running
-  bool bDelete;                   //!< If true, the animation will be deleted through the AnimationPlayer.
-};
-
-
-/**********************TEST*******************************/
-class aTest
-{
- public:
-  aTest() { last = 0.0;}
-  ~aTest() {}
-  void littleDebug(float f) {  diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;}
- private:
-  float diff;
-  float last;
-};
-
-//aTest::aTest() {}
-//aTest::~aTest() {}
-
-//void aTest::littleDebug(float f)
-
-/**********************TEST*******************************/
-
-
-#endif /* _ANIMATION_H */
Index: orxonox/trunk/src/animation3d.cc
===================================================================
--- orxonox/trunk/src/animation3d.cc	(revision 3867)
+++ 	(revision )
@@ -1,307 +1,0 @@
-/*
-   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: Patrick Boenzli
-   co-programmer: Benjamin Grauer
-
-   2005-04-17: Benjamin Grauer
-          Rewritte all functions, so it will fit into the Animation-class
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ANIM
-
-#include "animation3d.h"
-
-#include "p_node.h"
-
-using namespace std;
-
-/**
-   \brief standard constructor
-*/
-Animation3D::Animation3D(PNode* object)
-{
-  this->object = object;
-
-  // create a new List
-  this->keyFrameList = new tList<KeyFrame3D>();
-  KeyFrame3D* tmpKeyFrame = new KeyFrame3D;
-  tmpKeyFrame->position = Vector();
-  tmpKeyFrame->direction = Quaternion();
-  keyFrameList->add(tmpKeyFrame);
-
-  this->currentKeyFrame = tmpKeyFrame;
-  this->nextKeyFrame = tmpKeyFrame;
-
-  this->animFunc = &Animation3D::linear;
-}
-
-/**
-   \brief standard deconstructor
-   
-   deletes all the Keyframes
-*/
-Animation3D::~Animation3D(void)
-{
-  // delete all the KeyFrames
-  tIterator<KeyFrame3D>* itKF = keyFrameList->getIterator();
-  KeyFrame3D*  enumKF = itKF->nextElement();
-  while (enumKF)
-    {
-      delete enumKF;
-      enumKF = itKF->nextElement();
-    }
-  delete itKF;
-  delete this->keyFrameList;
-}
-
-/**
-   \brief rewinds the Animation to the beginning (first KeyFrame and time == 0)
-*/
-void Animation3D::rewind(void)
-{
-  this->currentKeyFrame = keyFrameList->firstElement();
-  this->nextKeyFrame = keyFrameList->nextElement(keyFrameList->firstElement());
-  this->localTime = 0.0;
-}
-
-/**
-   \brief Appends a new Keyframe
-   \param position The position of the new Keyframe
-   \param direction The direction of the new Keyframe.
-   \param duration The duration from the new KeyFrame to the next one
-   \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)
-{
-  // some small check
-  if (duration <= 0.0)
-    duration = 1.0;
-
-  KeyFrame3D* tmpKeyFrame;
-    
-  if (bHasKeys)
-    {
-      tmpKeyFrame = new KeyFrame3D;
-      if (this->currentKeyFrame == this->nextKeyFrame)
-	this->nextKeyFrame = tmpKeyFrame;
-      this->keyFrameList->add(tmpKeyFrame);
-
-    }
-  else
-    {
-      tmpKeyFrame = this->keyFrameList->firstElement();
-      bHasKeys = true;
-      this->setAnimFunc(animFunc);
-    }
-
-  tmpKeyFrame->position = position;
-  tmpKeyFrame->direction = direction;
-  tmpKeyFrame->duration = duration;
-  tmpKeyFrame->animFunc = animFunc;
-
-}
-
-/**
-   \brief ticks the Animation
-   \param dt how much time to tick
-*/
-void Animation3D::tick(float dt)
-{
-  if (this->bRunning)
-    { 
-      this->localTime += dt;
-      if (localTime >= this->currentKeyFrame->duration)
-	{
-	  // switching to the next Key-Frame
-	  this->localTime -= this->currentKeyFrame->duration;
-	  this->currentKeyFrame = this->nextKeyFrame;
-	  // checking, if we should still Play the animation
-	  if (this->currentKeyFrame == this->keyFrameList->lastElement())
-	    this->handleInfinity();
-	  this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
-	  this->setAnimFunc(this->currentKeyFrame->animFunc);	  
-	  
-	  if( this->currentKeyFrame->animFunc == ANIM_NEG_EXP)
-	    {
-	      this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;
-	      this->deltaT = 1/this->currentKeyFrame->duration * logf(1.0 + 600.0/this->tmpVect.len());
-	    }
-	}
-
-      /* now animate it */
-      (this->*animFunc)(this->localTime);
-      /*
-      switch( this->movMode)
-	{
-	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 - expf(- 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;
-	}
-      */
-    }
-}
-
-
-/**
-   \brief Sets The kind of Animation between this keyframe and the next one
-   \param animFunc The Type of Animation to set
-*/
-void Animation3D::setAnimFunc(ANIM_FUNCTION animFunc)
-{
-  switch (animFunc)
-    {
-    default:
-    case ANIM_CONSTANT:
-      this->animFunc = &Animation3D::constant;
-      break;
-    case ANIM_LINEAR:
-      this->animFunc = &Animation3D::linear;
-      break;
-    case ANIM_SINE:
-      this->animFunc = &Animation3D::sine;
-      break;
-    case ANIM_COSINE:
-      this->animFunc = &Animation3D::cosine;
-      break;
-    case ANIM_EXP:
-      this->animFunc = &Animation3D::exp;
-      break;
-    case ANIM_NEG_EXP:
-      this->animFunc = &Animation3D::negExp;
-      break;
-    case ANIM_QUADRATIC:
-      this->animFunc = &Animation3D::quadratic;
-      break;
-    case ANIM_RANDOM:
-      this->animFunc = &Animation3D::random;
-      break;
-    }
-}
-
-/**
-   \brief stays at the value of the currentKeyFrame
-   \param timePassed The time passed since this Keyframe began
-*/
-void Animation3D::constant(float timePassed) const
-{
-  this->object->setRelCoor(this->currentKeyFrame->position);
-
-  /*
-    this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;
-    this->tmpVect = this->tmpVect * this->localTime / this->currentKeyFrame->duration;
-    this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect);
-    this->lastPosition = this->tmpVect;
-  */
-}
-
-/**
-   \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::linear(float timePassed) const
-{
-  this->object->setRelCoor(this->currentKeyFrame->position +
-			  (this->nextKeyFrame->position - this->currentKeyFrame->position) * 
-			  (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::sine(float timePassed) const
-{
-  this->linear(timePassed);
-}
-
-/**
-   \brief a cosine interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-
-   \todo implement
-*/
-void Animation3D::cosine(float timePassed) const
-{
-  this->linear(timePassed);
-}
-
-/**
-   \brief an exponential interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-*/
-void Animation3D::exp(float timePassed) const
-{
-  this->linear(timePassed);
-}
-
-/**
-   \brief a negative exponential interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-
-   \todo implement
-*/
-void Animation3D::negExp(float timePassed) const
-{
-  this->linear(timePassed);
-}
-
-/**
-   \brief a quadratic interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-
-   \todo implement
-*/
-void Animation3D::quadratic(float timePassed) const
-{
-  this->linear(timePassed);
-}
-
-/**
-   \brief some random animation (fluctuating)
-   \param timePassed The time passed since this Keyframe began
-*/
-void Animation3D::random(float timePassed) const
-{
-  this->object->setRelCoor(this->currentKeyFrame->position * (float)rand()/(float)RAND_MAX);
-  this->object->setRelDir(this->currentKeyFrame->direction * (float)rand()/(float)RAND_MAX);
-}
Index: orxonox/trunk/src/animation3d.h
===================================================================
--- orxonox/trunk/src/animation3d.h	(revision 3867)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*! 
-    \file animation3d.h
-*/
-
-
-#include "animation.h"
-
-#include "vector.h"
-class PNode;
-
-//! KeyFrame3D Struct
-/**
-   This represents one point with direction of the animation
-*/
-typedef struct KeyFrame3D {
-  float duration;                   //!< The duration of this KeyFrame
-  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
-};
-
-//! Animation Struct
-/**
-   This represents an animation for a object
-*/
-class Animation3D : public Animation
-{
- public:
-  Animation3D(PNode* object);
-  virtual ~Animation3D(void);
-    
-  virtual void rewind(void);
-
-  void addKeyFrame(Vector position, Quaternion direction, float time, ANIM_FUNCTION animFunc = 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;
-  //  ANIM_FUNCTION animFunc;
-  void (Animation3D::*animFunc)(float) const;      //!< A Function for the AnimationType
-
-  KeyFrame3D* currentKeyFrame;                     //!< The current KeyFrame
-  KeyFrame3D* nextKeyFrame;                        //!< The KeyFrame we iterate to
-  tList<KeyFrame3D>* keyFrameList;                 //!< The KeyFrameList
-
-  // more class-local description
-  PNode* object;                                   //!< The Object from which to Animate something
-  Vector lastPosition;   //!< ??
-  Vector tmpVect;        //!< what for??
-  float deltaT;          //!< ??
-};
Index: orxonox/trunk/src/animation_player.cc
===================================================================
--- orxonox/trunk/src/animation_player.cc	(revision 3867)
+++ 	(revision )
@@ -1,192 +1,0 @@
-/* 
-   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_ANIM
-
-#include "animation_player.h"
-
-#include "compiler.h"
-
-using namespace std;
-
-
-/**
-   \brief standard constructor
-*/
-AnimationPlayer::AnimationPlayer () 
-{
-   this->setClassName ("AnimationPlayer");
-
-   this->animationList = new tList<Animation>();
-   this->play();
-}
-
-/**
-   \brief the singleton reference to this class
-*/
-AnimationPlayer* AnimationPlayer::singletonRef = NULL;
-
-/**
-   \returns a Pointer to this Class
-*/
-AnimationPlayer* AnimationPlayer::getInstance(void)
-{
-  if (!AnimationPlayer::singletonRef)
-    AnimationPlayer::singletonRef = new AnimationPlayer();
-  return AnimationPlayer::singletonRef;
-}
-
-/**
-   \brief standard deconstructor
-
-   !! DANGER !! when unloading the AnimationPlayer no other Function
-   should reference any Animations, from the animationList because it 
-   automatically deletes them. 
-   This usually happens when unloading a World.
-*/
-AnimationPlayer::~AnimationPlayer () 
-{
-  // deleting the Animation List AND all the elements of the List
-  this->flush();
-  delete this->animationList;
-
-  AnimationPlayer::singletonRef = NULL;
-}
-
-/**
-   \brief adds an Animation to the AnimationList.
-   \param animation the Animation to handle
-
-   when adding a Animation the Animation will too be deleted when
-   the AnimationPlayer gets deleted. Consider not adding it, or 
-   unadding it with animation->notHandled();
-*/
-void AnimationPlayer::addAnimation(Animation* animation)
-{
-  this->animationList->add(animation);
-}
-
-/**
-   \brief removes an Animation from the Animation List, WITHOUT deleting it.
-   \param animation the Anmination to remove from the List
-*/
-void AnimationPlayer::removeAnimation(Animation* animation)
-{
-  this->animationList->remove(animation);
-}
-
-/**
-   \brief empties the list AND deletes all the Animations
-*/ 
-void AnimationPlayer::flush(void)
-{
-  // deleting the Animation List AND all the elements of the List
-  tIterator<Animation>* animIt = this->animationList->getIterator();
-  Animation* anim = animIt->nextElement();
-  while( anim != NULL)
-    {
-      delete anim;
-      this->animationList->remove(anim);
-      anim = animIt->nextElement();
-    }
-  delete animIt;
-
-  delete this->animationList;
-  this->animationList = new tList<Animation>();
-}
-
-/**
-   \brief Ticks all the animations in animationList 
-   \param timePassed the time passed since the last tick.
-*/
-void AnimationPlayer::tick(float timePassed)
-{
-  if (this->bRunning)
-    {
-      // iterate through all the animations and tick them.
-      tIterator<Animation>* animIt = this->animationList->getIterator();
-      Animation* anim = animIt->nextElement();
-      while( anim != NULL)
-	{
-	  anim->tick(timePassed);
-	  if(unlikely(anim->ifDelete()))
-	  {
-	    this->animationList->remove(anim);
-	    delete anim;
-	  }
-	  anim = animIt->nextElement();
-	}
-      delete animIt;
-    }
-}
-/**
-   \brief starts playing the AnimationPlayer
-*/
-void AnimationPlayer::play(void)
-{
-  this->bRunning = true;
-}
-
-/**
-   \brief pauses playing of the AnimationPlayer
-*/
-void AnimationPlayer::pause(void)
-{
-  this->bRunning = false;
-}
-
-
-Animation* AnimationPlayer::getObjectFromBaseObject(const BaseObject* baseObject) const
-{
-  tIterator<Animation>* animIt = this->animationList->getIterator();
-  Animation* anim = animIt->nextElement();
-  while( anim != NULL)
-    {
-      if(anim->getBaseObject() == baseObject)
-	{
-	  delete animIt;
-	  return anim;
-	}
-      anim = animIt->nextElement();
-    }
-  delete animIt;
-
-}
-
-
-
-/**
-   \brief Outputs some nice debug-information
-*/
-void AnimationPlayer::debug(void)
-{
-  PRINT(0)("+------------------------------------+\n");
-  PRINT(0)("+ ANIMATION PLAYER DEBUG INFORMATION +\n");
-  PRINT(0)("+------------------------------------+\n");
-  PRINT(0)("| Reference: %p\n", this);
-  PRINT(0)("| CountOfAnims %d\n", this->animationList->getSize());
-  PRINT(0)("-Animation Information---------------+\n");
-  // Per ANIMATION DEBUG
-  tIterator<Animation>* animIt = this->animationList->getIterator();
-  Animation* anim = animIt->nextElement();
-  while( anim != NULL)
-    {
-      //      anim->debug();
-      anim = animIt->nextElement();
-    }
-  delete animIt;
-
-  PRINT(0)("+--------------------------------AP--+\n");
-}
Index: orxonox/trunk/src/animation_player.h
===================================================================
--- orxonox/trunk/src/animation_player.h	(revision 3867)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*! 
-    \file animation_player.h
-*/
-
-#ifndef _ANIMATION_PLAYER_H
-#define _ANIMATION_PLAYER_H
-
-#include "base_object.h"
-#include "animation.h"
-
-/* FORWARD DEFINITION */
-
-//! A AnimationPlayer, that handles the animation of all the Animations in the scene.
-/**
-   <b>AnimationPlayer usage:</b> \n
-
-   <b>Initialisation</b>: AnimationPlayer::getInstance() does the trick this is 
-   usually done when initializing a world \n
-   <b>Adding Animations</b>: create an Animation the following Way:
-   \li Anim* animation = new Anim(); // also use any other Subclass of Animation to initialize this
-   \li set some parameters: also see the specific classes for more info
-   \n
-   if you do not want a specific Animation to be handled by the AnimationPlayer, you have to 
-   unload it explicitely with animation->doNotHandle();
-   \n
-   eveything else will be done by the AnimationPlayer itself.\n
-*/
-class AnimationPlayer : public BaseObject {
-
- public:
-  static AnimationPlayer* getInstance(void);
-  virtual ~AnimationPlayer(void);
-
-  // animation handling
-  void addAnimation(Animation* animation);
-  void removeAnimation(Animation* animation);
-  void flush(void);
-
-  // time functions
-  void tick(float timePassed);
-  void play(void);
-  void pause(void);
-
-  Animation* getObjectFromBaseObject(const BaseObject* baseObject) const;
-
-  void debug(void);
-
- private:
-  /* singleton */
-  AnimationPlayer(void);
-  static AnimationPlayer* singletonRef;
-
-  /* class specific */
-  tList<Animation>* animationList;         //!< A List of Animations to be handled.
-  bool bRunning;                           //!< If the AnimationPlayer is running.
-};
-
-
-#endif /* _ANIMATION_PLAYER_H */
Index: orxonox/trunk/src/simple_animation.cc
===================================================================
--- orxonox/trunk/src/simple_animation.cc	(revision 3867)
+++ 	(revision )
@@ -1,392 +1,0 @@
-
-/*
-   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: Patrick Boenzli
-   co-programmer: Benjamin Grauer
-
-   2005-04-17: Benjamin Grauer
-          Rewritte all functions, so it will fit into the Animation-class
-*/
-
-
-#include "simple_animation.h"
-
-
-SimpleAnimation* SimpleAnimation::singletonRef = 0;
-/**
-   \brief gets the singleton instance
-   \returns singleton instance
-*/
-SimpleAnimation* SimpleAnimation::getInstance()
-{
-  if( singletonRef == NULL)
-    singletonRef = new SimpleAnimation();
-  return singletonRef;
-}
-
-/**
-   \brief standard constructor
-*/
-SimpleAnimation::SimpleAnimation () 
-{
-   this->setClassName ("SimpleAnimation");
-   this->frames = new tList<KeyFrame3D>();
-   this->animators = new tList<Animation3D>();
-   this->localTime = 0;
-   this->bRunning = false;
-   this->currentFrame = NULL;
-   this->lastFrame = NULL;
-
-   this->tmpVect = new Vector();
-   this->lastPosition = new Vector();
-   this->deltaT = 0.2;
-}
-
-
-/**
-   \brief standard deconstructor
-
-*/
-SimpleAnimation::~SimpleAnimation () 
-{
-  tIterator<KeyFrame3D>* iterator = this->frames->getIterator();
-  KeyFrame3D* frame = iterator->nextElement(); 
-  while( frame != NULL) 
-    { 
-      delete frame;
-      frame = iterator->nextElement();
-    }
-  delete iterator;
-  delete this->frames;
-  singletonRef = NULL;
-}
-
-
-/**
-   \brief this determines the start of an Animator Describtion
-
-   this can then be followed by different commands like addKeyFrame(..) etc. and
-   will be closed with AnimatiorEnd()
-*/
-void SimpleAnimation::animatorBegin()
-{
-  this->bDescriptive = true;
-}
-
-
-/**
-   \brief this determines the end of an Animator Describtion
-
-   this can then be followed by different commands like addKeyFrame(..) etc. and
-   will be closed with AnimatiorEnd()
-*/
-void SimpleAnimation::animatorEnd()
-{
-  this->workingObject = NULL;
-  this->workingAnimator = NULL;
-  this->bDescriptive = false;
-}
-
-
-/*
-  Vector* lastPosition;
-  Vector* tmpVect;
-  tList<KeyFrame3D>* frames;
-  animationMode animMode;
-  movementMode movMode;
-  bool bRunning;
-  float deltaT;
-*/
-
-/**
-   \brief select an object to work on by using this function
-   \param object wo work on
-*/
-void SimpleAnimation::selectObject(PNode* entity)
-{
-  Animation3D* anim = getAnimationFromPNode(entity);
-  if( anim == NULL)
-    {
-      anim = new Animation3D;
-      anim->object = entity;
-      anim->lastPosition = new Vector();
-      anim->tmpVect = new Vector();
-      anim->frames = new tList<KeyFrame3D>();
-      anim->animMode = LOOP;
-      anim->bRunning = false;
-      deltaT = 0.0;
-      this->animators->add(anim);
-    }
-  this->workingAnimator = anim;
-}
-
-
-
-/**
-   \brief adds a keyframe with properties
-   \param the point of the object
-   \param and the direction of it
-   \param at this time
-*/
-void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* direction, float time)
-{
-  if( !this->bDescriptive || this->workingAnimator == NULL)
-    {
-      PRINTF(1)("SimpleAnimation: executing animation code outside a AnimationBegin()/AnimationEnd() - ignoring\n");
-      return;
-    }
-  KeyFrame3D* frame = new KeyFrame3D;
-  frame->position = point;
-  frame->direction = direction;
-  frame->time = time;
-  frame->mode = DEFAULT_ANIMATION_MODE;
-  frame->object = this->workingAnimator->object;
-  this->workingAnimator->frames->add(frame);
-}
-
-
-/**
-   \brief adds a keyframe with properties
-   \param the point of the object
-   \param and the direction of it
-   \param at this time
-   \param function of the velocity of the movement 
-*/
-void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* direction, float time, movementMode mode)
-{
-  if( !this->bDescriptive || this->workingAnimator == NULL)
-    {
-      PRINTF(1)("SimpleAnimation: executing animation code outside a AnimationBegin()/AnimationEnd() - ignoring\n");
-      return;
-    }
-  KeyFrame3D* frame = new KeyFrame3D;
-  frame->position = point;
-  frame->direction = direction;
-  frame->time = time;
-  frame->mode = mode;
-  frame->object = this->workingAnimator->object;
-  this->workingAnimator->frames->add(frame);
-}
-
-/**
-   \brief adds a already defined keyframe
-   \param the keyframe to add
-*/
-void SimpleAnimation::addKeyFrame(KeyFrame3D* frame)
-{
-  if( !this->bDescriptive || this->workingAnimator == NULL)
-    {
-      PRINTF(1)("SimpleAnimation: executing animation code outside a AnimationBegin()/AnimationEnd() - ignoring\n");
-      return;
-    }
-  frame->object = this->workingAnimator->object;
-  this->workingAnimator->frames->add(frame);
-}
-
-
-void SimpleAnimation::setAnimationMode(animationMode mode)
-{
-  if( !this->bDescriptive || this->workingAnimator == NULL)
-    {
-      PRINTF(1)("SimpleAnimation: executing animation code outside a AnimationBegin()/AnimationEnd() - ignoring\n");
-      return;
-    }
-  this->workingAnimator->animMode = mode;
-}
-
-/**
-   \brief clear the list of keyframes, deleting all keyframes included
-*/
-void SimpleAnimation::reset()
-{
-  /*
-  tIterator<KeyFrame3D>* iterator = this->frames->getIterator();
-  KeyFrame3D* frame = iterator->nextElement(); 
-  while( frame != NULL) 
-    { 
-      delete frame;
-      frame = iterator->nextElement();
-    }
-  delete iterator;
-  delete this->frames;
-
-  this->frames = new tList<KeyFrame3D>();
-  this->localTime = 0;
-  this->bRunning = false;
-
-  this->currentFrame = NULL;
-  this->lastFrame = NULL;
-  */
-}
-
-/**
-   \brief starts the animation, therefore listens to tick signals
-*/
-void SimpleAnimation::start()
-{
-  if( this->bRunning)
-    {
-      PRINTF(2)("SimpleAnimatin is already running. You are trying to start it again.\n");
-    return;
-    }
-  
-  if( this->workingAnimator == NULL)
-    {
-      PRINTF(1)("You have no target selected to start: either do this with start(target) or by prev selecting it\n");
-      return;
-    }
-  this->workingAnimator->localTime = 0.0;
-  this->workingAnimator->bRunning = true;
-  this->workingAnimator->currentFrame = this->workingAnimator->frames->firstElement();
-  this->workingAnimator->lastFrame = this->workingAnimator->frames->nextElement(this->workingAnimator->currentFrame);
-
-  /*
-  tIterator<Animation>* iterator = this->animators->getIterator();
-  Animation* anim = iterator->nextElement();
-  while( anim != NULL)
-    {
-      printf("SimpleAnimation::start() - initializing an animaion\n");
-      anim->currentFrame = anim->frames->firstElement();
-      anim->lastFrame = anim->frames->nextElement(anim->currentFrame);
-      anim = iterator->nextElement();
-    }
-  */
-}
-
-
-/**
-   \brief stops the animation, immune to tick signals
-*/
-void SimpleAnimation::stop()
-{
-  this->bRunning = false;
-}
-
-/**
-   \brief stops and then starts the animation from begining
-*/
-void SimpleAnimation::restart()
-{
-  this->localTime = 0;
-  //this->lastFrame = this->frames->firstElement();
-  //this->currentFrame = this->frames->nextElement(this->currentFrame);
-  this->bRunning = true;
-}
-
-/**
-   \brief pauses the animation until resumed
-*/
-void SimpleAnimation::pause()
-{
-  this->bRunning = false;
-}
-
-/**
-   \brief resumes a pause, if not paused, no effect
-*/
-void SimpleAnimation::resume()
-{
-  this->bRunning = true;
-}
-
-
-/**
-   \brief heart beat, next animation step
-*/
-void SimpleAnimation::tick(float time)
-{
-  tIterator<Animation3D>* iterator = this->animators->getIterator();
-  Animation3D* anim = iterator->nextElement();
-  while( anim != NULL)
-    {
-      if( anim->bRunning)
-	{ 
-	  anim->localTime += time;
-	  /* first get the current frame via time-stamps */ 
-	  while( anim->localTime > anim->currentFrame->time)
-	    {
-	      PRINTF(4)("SimpleAnimation::tick(...) - changing Frame\n");
-	      
-	      anim->localTime -= anim->currentFrame->time;
-	      //this->currentFrame->object->setRelCoor(*this->currentFrame->position);
-	      *anim->lastPosition = *anim->currentFrame->position;
-	      
-	      anim->lastFrame = anim->currentFrame;
-	      anim->currentFrame = anim->frames->nextElement(anim->currentFrame);
-	      if( anim->currentFrame == anim->frames->firstElement() && anim->animMode == SINGLE)
-		{
-		  anim->bRunning = false;
-		  return;
-		}
-	      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 * anim->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 - expf(- anim->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 * anim->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(anim->localTime, 3);
-	      break;
-	    default:
-	      break;
-	    }
-	}
-      anim = iterator->nextElement();
-    }
-  delete anim;
-}
-
-
-
-Animation3D* SimpleAnimation::getAnimationFromPNode(PNode* entity)
-{
-  tIterator<Animation3D>* iterator = this->animators->getIterator();
-  Animation3D* anim = iterator->nextElement();
-  while( anim != NULL)
-    {
-      if( anim->object == entity)
-	return anim;
-      anim = iterator->nextElement();
-    }
-  delete iterator;
-  return NULL;
-}
Index: orxonox/trunk/src/simple_animation.h
===================================================================
--- orxonox/trunk/src/simple_animation.h	(revision 3867)
+++ 	(revision )
@@ -1,142 +1,0 @@
-/*! 
-    \file simple_animation.h
-    \brief A class to interpolate the movement of an object following descrete points in room and time
-    \todo implement it
-
-    This class has been done to animate some movement, works best for short 
-    distances.
-*/
-
-#ifndef _SIMPLE_ANIMATION_H
-#define _SIMPLE_ANIMATION_H
-
-#include "base_object.h"
-#include "list.h"
-#include "animation.h"
-
-
-class Vector;
-class Quaternion;
-class PNode;
-
-typedef enum movementMode{LINEAR=0, EXP, NEG_EXP, SIN, COS, QUADRATIC};
-typedef enum animationMode{SINGLE=0, LOOP};
-#define DEFAULT_ANIMATION_MODE LINEAR
-
-
-//! KeyFrame Struct
-/**
-   This represents one point with direction of the animation
-*/
-typedef struct KeyFrame3D {
-  Vector* position;
-  Quaternion* direction;
-  PNode* object;
-  float time;
-  movementMode mode;
-};
-
-//! Animation Struct
-/**
-   This represents an animation for a object
-*/
-class Animation3D : public Animation
-{
- public:
-  Animation3D(void);
-  virtual ~Animation3D(void);
-    
-  virtual void rewind(void);
-
-  void addKeyFrame(Vector* point, Quaternion* direction, float time, ANIM_FUNCTION animFunc = ANIM_LINEAR);
-  void addKeyFrame(KeyFrame3D* frame);
-
-  virtual void tick(float timePassed);
-
-  // animation functions
-  void setAnimFunc(ANIM_FUNCTION animFunc);
-
- private:
-  float constant(float timePassed) const;
-  float linear(float timePassed) const;
-  float sine(float timePassed) const;
-  float cosine(float timePassed) const;
-  float exp(float timePassed) const;
-  float negExp(float timePassed) const;
-  float quadratic(float timePassed) const;
-  float random(float timePassed) const;
-  //  ANIM_FUNCTION animFunc;
-  KeyFrame3D* currentKeyFrame;
-  KeyFrame3D* nextKeyFrame;
-  tList<KeyFrame3D>* keyFrameList;
-  float (Animation3D::*animFunc)(float) const;
-
-  // private
-  PNode* object;
-  Vector* lastPosition;
-  Vector* tmpVect;
-  float deltaT;
-  float localTime;
-
-  tList<KeyFrame3D>* frames;
-  KeyFrame3D* currentFrame;
-  KeyFrame3D* lastFrame;
-
-  bool bRunning;
-
-  animationMode animMode;
-  movementMode movMode;
-};
-
-//! Animation Class
-/**
-   Helps you making some small animation
-*/
-class SimpleAnimation : public BaseObject {
- public:
-  static SimpleAnimation* getInstance();
-  virtual ~SimpleAnimation();
-
-  void animatorBegin();
-  void animatorEnd();
-  void selectObject(PNode* entity);
-  void addKeyFrame(Vector* point, Quaternion* direction, float time);
-  void addKeyFrame(Vector* point, Quaternion* direction, float time, movementMode mode);
-  void addKeyFrame(KeyFrame3D* frame);
-  void setAnimationMode(animationMode mode);
-  void reset();
-
-
-  void start();
-  void stop();
-  void restart();
-  void pause();
-  void resume();
-
-  void tick(float time);
-
- private:
-  SimpleAnimation();
-
-  static SimpleAnimation* singletonRef;
-  bool bDescriptive;               //<! is true, when AnimatorBegin() was executed but no AnimatorEnd() yet: in describtive mode: pass commands
-  bool bRunning;                   //<! is set, when the animation is running
-  tList<KeyFrame3D>* frames;         //<! where keyframes are stored in
-  tList<Animation3D>* animators;      //<! a list of animation's
-  KeyFrame3D* currentFrame;          //<! the frame that is been played now
-  KeyFrame3D* lastFrame;
-  Vector* lastPosition;
-  movementMode mode;               //<! this is an enum of the mode, how the speed is distributed
-  float localTime;
-  PNode* parent;
-  
-  Vector* tmpVect;                 //<! this is the temporary vector save place - 
-  PNode* workingObject;      //<! this is a pointer to the current working object that has been selected via selectObject()
-  Animation3D* workingAnimator;       //<! the animator with which you are currently working
-  float deltaT;                    //<! this is a time constant for the movement
-
-  Animation3D* getAnimationFromPNode(PNode* entity);
-
-};
-
-#endif /* _SIMPLE_ANIMATION_H */
Index: orxonox/trunk/src/t_animation.h
===================================================================
--- orxonox/trunk/src/t_animation.h	(revision 3867)
+++ 	(revision )
@@ -1,346 +1,0 @@
-/*
-   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: ...
-*/
-
-/*! 
-    \file t_animation.h
-*/
-
-#ifndef _T_ANIMATION_H
-#define _T_ANIMATION_H
-
-
-#include "animation.h"
-
-#define DELTA_X 0.05  //!< the percentag of the distance that doesnt have to be done by neg_exp (asymptotical) ~ maschinendelta
-
-//! A Struct for Keyframes that simply hold a float
-typedef struct KeyFrameF
-{
-  float duration;             //!< duration of this keyframe
-  float value;                //!< value of this keyframe
-  ANIM_FUNCTION animFunc;     //!< with whitch function to iterate to the next KeyFrameF
-};
-
-
-//! A Class to handle some animation for single floated values.
-template<class T> class tAnimation : public Animation
-{
- public:
-  tAnimation(T* object = NULL, void (T::*funcToAnim)(float) = NULL);
-  virtual ~tAnimation();
-
-  void setFuncToAnim(T* object, void (T::*funcToAnim)(float));
-
-  void addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc = ANIM_LINEAR);
-
-  virtual void rewind();
-  virtual void tick(float dt);
-
- private:
-  // animation functions
-  void setAnimFunc(ANIM_FUNCTION animFunc);
-  float constant(float timePassed) const;
-  float linear(float timePassed) const;
-  float sine(float timePassed) const;
-  float cosine(float timePassed) const;
-  float exp(float timePassed) const;
-  float negExp(float timePassed) const;
-  float quadratic(float timePassed) const;
-  float random(float timePassed) const;
-
-
-  //  ANIM_FUNCTION animFunc;
-  float (tAnimation<T>::*animFunc)(float) const;  //!< A Function for the AnimationType
-
-  KeyFrameF* currentKeyFrame;                     //!< The current KeyFrame
-  KeyFrameF* nextKeyFrame;                        //!< The KeyFrame we iterate to
-  tList<KeyFrameF>* keyFrameList;                 //!< The KeyFrameList
-
-  T* object;                                      //!< The Object from which to Animate something
-  void (T::*funcToAnim)(float);                   //!< The function to Animate
-
-  float expFactor;                                //!< some factors
-};
-
-
-
-/**
-   \brief standard constructor
-*/
-template<class T>
-tAnimation<T>::tAnimation (T* object, void (T::*funcToAnim)(float)) 
-{
-  // create a new List
-  this->keyFrameList = new tList<KeyFrameF>();
-  KeyFrameF* tmpKeyFrame = new KeyFrameF;
-  tmpKeyFrame->value = 0.0;
-  tmpKeyFrame->duration = 1.0;
-  keyFrameList->add(tmpKeyFrame);
-
-  this->currentKeyFrame = tmpKeyFrame;
-  this->nextKeyFrame = tmpKeyFrame;
-
-  this->animFunc = &tAnimation<T>::linear;
-
-  this->setFuncToAnim(object, funcToAnim);
-}
-
-
-/**
-   \brief standard deconstructor
-   
-   deletes all the Keyframes
-*/
-template<class T>
-tAnimation<T>::~tAnimation () 
-{
-  // delete all the KeyFrames
-  tIterator<KeyFrameF>* itKF = keyFrameList->getIterator();
-  KeyFrameF*  enumKF = itKF->nextElement();
-  while (enumKF)
-    {
-      delete enumKF;
-      enumKF = itKF->nextElement();
-    }
-  delete itKF;
-  delete this->keyFrameList;
-}
-
-/**
-   \brief rewinds the Animation to the beginning (first KeyFrame and time == 0)
-*/
-template<class T>
-void tAnimation<T>::rewind(void)
-{
-  this->currentKeyFrame = keyFrameList->firstElement();
-  this->nextKeyFrame = keyFrameList->nextElement(keyFrameList->firstElement());
-  this->localTime = 0.0;
-}
-
-/**
-   \brief sets the Function we want to animate
-   \param object from what object do we want to animate
-   \param funcToAnim which function
-*/
-template<class T>
-void tAnimation<T>::setFuncToAnim(T* object, void (T::*funcToAnim)(float))
-{
-  this->baseObject = this->object = object;
-  this->funcToAnim = funcToAnim;
-}
-
-/**
-   \brief Appends a new Keyframe
-   \param value the value of the new KeyFrame
-   \param duration The duration from the new KeyFrame to the next one
-   \param animFunc The function to animate between this keyFrame and the next one
-*/
-template<class T>
-void tAnimation<T>::addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc)
-{
-  // some small check
-  if (duration <= 0.0)
-    duration = 1.0;
-
-  KeyFrameF* tmpKeyFrame;
-    
-  if (bHasKeys)
-    {
-      tmpKeyFrame = new KeyFrameF;
-      if (this->currentKeyFrame == this->nextKeyFrame)
-	this->nextKeyFrame = tmpKeyFrame;
-      this->keyFrameList->add(tmpKeyFrame);
-
-    }
-  else
-    {
-      tmpKeyFrame = this->keyFrameList->firstElement();
-      bHasKeys = true;
-      this->setAnimFunc(animFunc);
-    }
-  tmpKeyFrame->value = value;
-  tmpKeyFrame->duration = duration;
-  tmpKeyFrame->animFunc = animFunc;
-}
-
-/**
-   \brief ticks the Animation
-   \param dt how much time to tick
-*/
-template<class T>
-void tAnimation<T>::tick(float dt)
-{
-  if (this->bRunning)
-    {
-      this->localTime += dt;
-      if (localTime >= this->currentKeyFrame->duration)
-	{
-	  // switching to the next Key-Frame
-	  this->localTime -= this->currentKeyFrame->duration;
-
-	  this->currentKeyFrame = this->nextKeyFrame;
-	  // checking, if we should still Play the animation
-	  if (this->currentKeyFrame == this->keyFrameList->lastElement())
-	    this->handleInfinity();
-	  this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
-	  printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
-	  this->setAnimFunc(this->currentKeyFrame->animFunc);	  
-	}
-      
-      (this->object->*(funcToAnim))((this->*animFunc)(this->localTime));
-    }
-}
-
-/**
-   \brief Sets The kind of Animation between this keyframe and the next one
-   \param animFunc The Type of Animation to set
-*/
-template<class T>
-void tAnimation<T>::setAnimFunc(ANIM_FUNCTION animFunc)
-{
-  switch (animFunc)
-    {
-    default:
-    case ANIM_CONSTANT:
-      this->animFunc = &tAnimation<T>::constant;
-      break;
-    case ANIM_LINEAR:
-      this->animFunc = &tAnimation<T>::linear;
-      break;
-    case ANIM_SINE:
-      this->animFunc = &tAnimation<T>::sine;
-      break;
-    case ANIM_COSINE:
-      this->animFunc = &tAnimation<T>::cosine;
-      break;
-    case ANIM_EXP:
-      this->animFunc = &tAnimation<T>::exp;
-      break;
-    case ANIM_NEG_EXP:
-      {
-	this->animFunc = &tAnimation<T>::negExp;
-	float d = fabs(this->currentKeyFrame->value - this->nextKeyFrame->value);
-	expFactor =  - 1.0 / this->currentKeyFrame->duration * logf(DELTA_X);
-	break;
-      }
-    case ANIM_QUADRATIC:
-      this->animFunc = &tAnimation<T>::quadratic;
-      break;
-    case ANIM_RANDOM:
-      this->animFunc = &tAnimation<T>::random;
-      break;
-    }
-}
-
-
-// animation functions
-/**
-   \brief stays at the value of the currentKeyFrame
-   \param timePassed The time passed since this Keyframe began
-*/
-template<class T>
-float tAnimation<T>::constant(float timePassed) const
-{
-  return this->currentKeyFrame->value;
-}
-
-/**
-   \brief linear interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-*/
-template<class T>
-float tAnimation<T>::linear(float timePassed) const 
-{
-  return this->currentKeyFrame->value + (this->nextKeyFrame->value - this->currentKeyFrame->value) 
-    * (timePassed / this->currentKeyFrame->duration);
-  //  PRINTF(0)("value is %f, %p %p\n", val, this->currentKeyFrame, this->nextKeyFrame);
-  //  return val;
-}
-
-/**
-   \brief a Sinusodial Interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-*/
-template<class T>
-float tAnimation<T>::sine(float timePassed) const
-{
-  float d = this->currentKeyFrame->value - this->nextKeyFrame->value;
-  float e = 0.5 * d * (1 - cos(M_PI * timePassed / this->currentKeyFrame->duration));
-  return this->currentKeyFrame->value - e;
-  /*
-  return his->currentKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value)
-    * sin(timePassed / this->currentKeyFrame->duration * M_PI);
-  */
-}
-
-/**
-   \brief a cosine interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-*/
-template<class T>
-float tAnimation<T>::cosine(float timePassed) const
-{
-  float d = this->currentKeyFrame->value - this->nextKeyFrame->value;
-  float e = 0.5 * d * (sin(M_PI * timePassed / this->currentKeyFrame->duration));
-  if( timePassed > 0.5*this->currentKeyFrame->duration) e = (d - e);
-  return this->currentKeyFrame->value - e;
-  /*
-  return this->currentKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value)
-    * cos(timePassed / this->currentKeyFrame->duration * M_PI);
-  */
-}
-
-/**
-   \brief an exponential interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-*/
-template<class T>
-float tAnimation<T>::exp(float timePassed) const
-{
-}
-
-/**
-   \brief a negative exponential interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-*/
-template<class T>
-float tAnimation<T>::negExp(float timePassed) const
-{
-  float d = this->currentKeyFrame->value - this->nextKeyFrame->value;
-  float e = d * (1.0 - expf(- timePassed * expFactor));
-  return  this->currentKeyFrame->value - e;
-}
-
-/**
-   \brief a quadratic interpolation between this keyframe and the next one
-   \param timePassed The time passed since this Keyframe began
-*/
-template<class T>
-float tAnimation<T>::quadratic(float timePassed) const
-{
-  this->linear(timePassed);
-}
-
-/**
-   \brief some random animation (fluctuating)
-   \param timePassed The time passed since this Keyframe began
-*/
-template<class T>
-float tAnimation<T>::random(float timePassed) const
-{
-  return this->currentKeyFrame->value * (float)rand()/(float)RAND_MAX;
-}
-
-#endif /* _T_ANIMATION_H */
Index: orxonox/trunk/src/util/animation/animation.cc
===================================================================
--- orxonox/trunk/src/util/animation/animation.cc	(revision 3868)
+++ orxonox/trunk/src/util/animation/animation.cc	(revision 3868)
@@ -0,0 +1,130 @@
+/* 
+   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_ANIM
+
+#include "animation.h"
+#include "debug.h"
+#include "animation_player.h"
+
+/**
+   \brief creates a new Animation
+   
+   This also adds the Animation automatically to the AnimationPlayer's list
+*/
+Animation::Animation(void)
+{  
+  // initialize a beginning KeyFrame, that will be deleted afterwards
+  this->bHasKeys = false;
+  this->bHandled = true;
+  this->bDelete = false;
+  this->baseObject = NULL;
+
+  // setting default values
+  this->localTime = 0.0;
+  this->bRunning = true;
+
+  AnimationPlayer::getInstance()->addAnimation(this);
+}
+
+/**
+   \brief destructs the Animation
+   
+   this also takes the animation out of the AnimationPlayer's list (if it is there)
+*/
+Animation::~Animation(void)
+{
+  this->doNotHandle();
+}
+
+/**
+   \brief tells the AnimationPlayer, that we do not wish to  handle this animation
+   automatically.
+   
+   This means that it will not be ticked, and not be deleted with the AnimationPlayer
+*/
+void Animation::doNotHandle(void)
+{
+  if (this->bHandled)
+    AnimationPlayer::getInstance()->removeAnimation(this);
+}
+
+/**
+   \brief Sets the infinitymode
+   \param postInfinity How the Animation should advance after the last Keyframe
+*/
+void Animation::setInfinity(ANIM_INFINITY postInfinity)
+{
+  this->postInfinity = postInfinity;
+}
+
+/**
+   \brief handles the Animation if it gets out of boundraries eg. if animation is finished.
+*/
+void Animation::handleInfinity(void)
+{
+  switch (this->postInfinity)
+    {
+    case ANIM_INF_CONSTANT:
+      this->localTime = 0.0;
+      this->bRunning = false;
+      break;
+    case ANIM_INF_REPLAY:
+      this->replay();
+      break;
+    case ANIM_INF_REWIND:
+      this->stop();
+      break;
+    case ANIM_INF_DELETE: // this will possibly never be made
+      this->bDelete = true;
+      break;
+    }
+}
+
+/**
+   \brief plays the animation back from the current Time forward
+*/
+void Animation::play()
+{
+  this->bRunning = true;
+}
+
+/**
+   \brief Stops the animation. eg. pause(); rewind();
+*/
+void Animation::stop()
+{
+  this->rewind();
+  this->bRunning = true;
+  this->tick(0.0);
+  this->bRunning = false;
+}
+
+/**
+   \brief Pauses the animation. Stays at the current Time
+*/
+void Animation::pause()
+{
+  this->bRunning = false;
+}
+
+/**
+   \brief replays the animation, eg. rewind();play();
+*/
+void Animation::replay()
+{
+  this->rewind();
+  this->bRunning = true;
+}
Index: orxonox/trunk/src/util/animation/animation.h
===================================================================
--- orxonox/trunk/src/util/animation/animation.h	(revision 3868)
+++ orxonox/trunk/src/util/animation/animation.h	(revision 3868)
@@ -0,0 +1,123 @@
+/*! 
+    \file animation.h
+    A Subclass for all animations in orxonox
+*/
+
+#ifndef _ANIMATION_H
+#define _ANIMATION_H
+
+#include "list.h"
+#include "base_object.h"
+#include "confincl.h"  // must be here to determin the DEBUG-level
+
+// FORWARD DEFINITION
+
+//! An enumerator of Functions to describe the flow of the Animation
+/**
+   \todo check with Patrick it of
+
+   description in speed to the next keyframe:
+   ANIM_CONSTANT: 0, infinity.
+   ANIM_LINEAR: equal
+   ANIM_SINE: fast, slow, fast
+   ANIM_COSINE: slow, fast, slow
+   ANIM_EXP: slow, fast
+   ANIM_NEG_EXP: fast, slow
+   ANIM_RANDOM: eratic
+   
+   deprecated QUADRATIC
+*/
+typedef enum ANIM_FUNCTION {ANIM_CONSTANT,
+			    ANIM_LINEAR,
+			    ANIM_SINE,
+			    ANIM_COSINE,
+			    ANIM_EXP,
+			    ANIM_NEG_EXP,
+			    ANIM_QUADRATIC,
+			    ANIM_RANDOM};
+
+//! An enumerator describing what the animation should do after the last keyframe.
+/**
+   ANIM_INF_CONSTANT stays at the end of the animation
+   ANIM_INF_REPLAY loops back to the beginning and replays the animation
+   ANIM_INF_REWIND loops back to the beginning and then stops the animation
+   ANIM_INF_DELETE deletes the animation. !! THIS IS DANGEROUS !! only do this with non-class variables
+*/
+typedef enum ANIM_INFINITY {ANIM_INF_CONSTANT,
+			    ANIM_INF_REPLAY,
+			    ANIM_INF_REWIND,
+			    ANIM_INF_DELETE};//, ANIM_INF_LINEAR, ANIM_INF_PINGPONG;
+
+//! A Superclass for describing an animation (all animations will be derived from this one)
+/** implement in subclasses:
+ * 
+ * De-/Constructor
+ * Animation Functions
+ * virtual tick
+ * addKeyFrame
+ * List of keyFrames
+ * currentKeyFrame/nextKeyFrame
+ * virtual rewind, to go to the first Keyframe. (other functions will call this one)
+*/
+class Animation
+{
+ public:
+  virtual ~Animation(void);
+  void doNotHandle(void);
+
+  void setInfinity(ANIM_INFINITY postInfinity = ANIM_INF_CONSTANT);
+
+  void play(); // equals resume();
+  void stop();
+  void pause();
+  void replay();
+  //! A virtual function that should change to the first keyframe.
+  virtual void rewind() = 0;
+  /** \brief A virtual function that ticks the animation \param dt the time passed */
+  virtual void tick(float dt) = 0;
+
+  /**
+     \returns the BaseObject, this animation operates on
+  */
+  BaseObject* getBaseObject(void) const {return baseObject;}
+
+  /** \returns if the Animation should be deleted */
+  inline bool ifDelete(void) {return bDelete;}
+
+ protected:
+  Animation(void);
+
+  void handleInfinity(void);
+  // variables
+  float localTime;                //!< The Time passed since the beginning of the currentKeyFrame.
+  ANIM_INFINITY postInfinity;     //!< describing what the animation should do after the last keyframe.
+
+  BaseObject* baseObject;         //!< The same as object in the derived classes, but with reference to BaseObject
+  bool bHasKeys;                  //!< If the animation has any keys at all. Needed to add the first keyframe (and delete the dummy).
+  bool bHandled;                  //!< If this Animation is handled by the AnimationPlayer.
+  bool bRunning;                  //!< If the animation is running
+  bool bDelete;                   //!< If true, the animation will be deleted through the AnimationPlayer.
+};
+
+
+/**********************TEST*******************************/
+class aTest
+{
+ public:
+  aTest() { last = 0.0;}
+  ~aTest() {}
+  void littleDebug(float f) {  diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;}
+ private:
+  float diff;
+  float last;
+};
+
+//aTest::aTest() {}
+//aTest::~aTest() {}
+
+//void aTest::littleDebug(float f)
+
+/**********************TEST*******************************/
+
+
+#endif /* _ANIMATION_H */
Index: orxonox/trunk/src/util/animation/animation3d.cc
===================================================================
--- orxonox/trunk/src/util/animation/animation3d.cc	(revision 3868)
+++ orxonox/trunk/src/util/animation/animation3d.cc	(revision 3868)
@@ -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: Patrick Boenzli
+   co-programmer: Benjamin Grauer
+
+   2005-04-17: Benjamin Grauer
+          Rewritte all functions, so it will fit into the Animation-class
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ANIM
+
+#include "animation3d.h"
+
+#include "p_node.h"
+
+using namespace std;
+
+/**
+   \brief standard constructor
+*/
+Animation3D::Animation3D(PNode* object)
+{
+  this->object = object;
+
+  // create a new List
+  this->keyFrameList = new tList<KeyFrame3D>();
+  KeyFrame3D* tmpKeyFrame = new KeyFrame3D;
+  tmpKeyFrame->position = Vector();
+  tmpKeyFrame->direction = Quaternion();
+  keyFrameList->add(tmpKeyFrame);
+
+  this->currentKeyFrame = tmpKeyFrame;
+  this->nextKeyFrame = tmpKeyFrame;
+
+  this->animFunc = &Animation3D::linear;
+}
+
+/**
+   \brief standard deconstructor
+   
+   deletes all the Keyframes
+*/
+Animation3D::~Animation3D(void)
+{
+  // delete all the KeyFrames
+  tIterator<KeyFrame3D>* itKF = keyFrameList->getIterator();
+  KeyFrame3D*  enumKF = itKF->nextElement();
+  while (enumKF)
+    {
+      delete enumKF;
+      enumKF = itKF->nextElement();
+    }
+  delete itKF;
+  delete this->keyFrameList;
+}
+
+/**
+   \brief rewinds the Animation to the beginning (first KeyFrame and time == 0)
+*/
+void Animation3D::rewind(void)
+{
+  this->currentKeyFrame = keyFrameList->firstElement();
+  this->nextKeyFrame = keyFrameList->nextElement(keyFrameList->firstElement());
+  this->localTime = 0.0;
+}
+
+/**
+   \brief Appends a new Keyframe
+   \param position The position of the new Keyframe
+   \param direction The direction of the new Keyframe.
+   \param duration The duration from the new KeyFrame to the next one
+   \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)
+{
+  // some small check
+  if (duration <= 0.0)
+    duration = 1.0;
+
+  KeyFrame3D* tmpKeyFrame;
+    
+  if (bHasKeys)
+    {
+      tmpKeyFrame = new KeyFrame3D;
+      if (this->currentKeyFrame == this->nextKeyFrame)
+	this->nextKeyFrame = tmpKeyFrame;
+      this->keyFrameList->add(tmpKeyFrame);
+
+    }
+  else
+    {
+      tmpKeyFrame = this->keyFrameList->firstElement();
+      bHasKeys = true;
+      this->setAnimFunc(animFunc);
+    }
+
+  tmpKeyFrame->position = position;
+  tmpKeyFrame->direction = direction;
+  tmpKeyFrame->duration = duration;
+  tmpKeyFrame->animFunc = animFunc;
+
+}
+
+/**
+   \brief ticks the Animation
+   \param dt how much time to tick
+*/
+void Animation3D::tick(float dt)
+{
+  if (this->bRunning)
+    { 
+      this->localTime += dt;
+      if (localTime >= this->currentKeyFrame->duration)
+	{
+	  // switching to the next Key-Frame
+	  this->localTime -= this->currentKeyFrame->duration;
+	  this->currentKeyFrame = this->nextKeyFrame;
+	  // checking, if we should still Play the animation
+	  if (this->currentKeyFrame == this->keyFrameList->lastElement())
+	    this->handleInfinity();
+	  this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
+	  this->setAnimFunc(this->currentKeyFrame->animFunc);	  
+	  
+	  if( this->currentKeyFrame->animFunc == ANIM_NEG_EXP)
+	    {
+	      this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;
+	      this->deltaT = 1/this->currentKeyFrame->duration * logf(1.0 + 600.0/this->tmpVect.len());
+	    }
+	}
+
+      /* now animate it */
+      (this->*animFunc)(this->localTime);
+      /*
+      switch( this->movMode)
+	{
+	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 - expf(- 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;
+	}
+      */
+    }
+}
+
+
+/**
+   \brief Sets The kind of Animation between this keyframe and the next one
+   \param animFunc The Type of Animation to set
+*/
+void Animation3D::setAnimFunc(ANIM_FUNCTION animFunc)
+{
+  switch (animFunc)
+    {
+    default:
+    case ANIM_CONSTANT:
+      this->animFunc = &Animation3D::constant;
+      break;
+    case ANIM_LINEAR:
+      this->animFunc = &Animation3D::linear;
+      break;
+    case ANIM_SINE:
+      this->animFunc = &Animation3D::sine;
+      break;
+    case ANIM_COSINE:
+      this->animFunc = &Animation3D::cosine;
+      break;
+    case ANIM_EXP:
+      this->animFunc = &Animation3D::exp;
+      break;
+    case ANIM_NEG_EXP:
+      this->animFunc = &Animation3D::negExp;
+      break;
+    case ANIM_QUADRATIC:
+      this->animFunc = &Animation3D::quadratic;
+      break;
+    case ANIM_RANDOM:
+      this->animFunc = &Animation3D::random;
+      break;
+    }
+}
+
+/**
+   \brief stays at the value of the currentKeyFrame
+   \param timePassed The time passed since this Keyframe began
+*/
+void Animation3D::constant(float timePassed) const
+{
+  this->object->setRelCoor(this->currentKeyFrame->position);
+
+  /*
+    this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;
+    this->tmpVect = this->tmpVect * this->localTime / this->currentKeyFrame->duration;
+    this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect);
+    this->lastPosition = this->tmpVect;
+  */
+}
+
+/**
+   \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::linear(float timePassed) const
+{
+  this->object->setRelCoor(this->currentKeyFrame->position +
+			  (this->nextKeyFrame->position - this->currentKeyFrame->position) * 
+			  (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::sine(float timePassed) const
+{
+  this->linear(timePassed);
+}
+
+/**
+   \brief a cosine interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+
+   \todo implement
+*/
+void Animation3D::cosine(float timePassed) const
+{
+  this->linear(timePassed);
+}
+
+/**
+   \brief an exponential interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+*/
+void Animation3D::exp(float timePassed) const
+{
+  this->linear(timePassed);
+}
+
+/**
+   \brief a negative exponential interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+
+   \todo implement
+*/
+void Animation3D::negExp(float timePassed) const
+{
+  this->linear(timePassed);
+}
+
+/**
+   \brief a quadratic interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+
+   \todo implement
+*/
+void Animation3D::quadratic(float timePassed) const
+{
+  this->linear(timePassed);
+}
+
+/**
+   \brief some random animation (fluctuating)
+   \param timePassed The time passed since this Keyframe began
+*/
+void Animation3D::random(float timePassed) const
+{
+  this->object->setRelCoor(this->currentKeyFrame->position * (float)rand()/(float)RAND_MAX);
+  this->object->setRelDir(this->currentKeyFrame->direction * (float)rand()/(float)RAND_MAX);
+}
Index: orxonox/trunk/src/util/animation/animation3d.h
===================================================================
--- orxonox/trunk/src/util/animation/animation3d.h	(revision 3868)
+++ orxonox/trunk/src/util/animation/animation3d.h	(revision 3868)
@@ -0,0 +1,62 @@
+/*! 
+    \file animation3d.h
+*/
+
+
+#include "animation.h"
+
+#include "vector.h"
+class PNode;
+
+//! KeyFrame3D Struct
+/**
+   This represents one point with direction of the animation
+*/
+typedef struct KeyFrame3D {
+  float duration;                   //!< The duration of this KeyFrame
+  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
+};
+
+//! Animation Struct
+/**
+   This represents an animation for a object
+*/
+class Animation3D : public Animation
+{
+ public:
+  Animation3D(PNode* object);
+  virtual ~Animation3D(void);
+    
+  virtual void rewind(void);
+
+  void addKeyFrame(Vector position, Quaternion direction, float time, ANIM_FUNCTION animFunc = 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;
+  //  ANIM_FUNCTION animFunc;
+  void (Animation3D::*animFunc)(float) const;      //!< A Function for the AnimationType
+
+  KeyFrame3D* currentKeyFrame;                     //!< The current KeyFrame
+  KeyFrame3D* nextKeyFrame;                        //!< The KeyFrame we iterate to
+  tList<KeyFrame3D>* keyFrameList;                 //!< The KeyFrameList
+
+  // more class-local description
+  PNode* object;                                   //!< The Object from which to Animate something
+  Vector lastPosition;   //!< ??
+  Vector tmpVect;        //!< what for??
+  float deltaT;          //!< ??
+};
Index: orxonox/trunk/src/util/animation/animation_player.cc
===================================================================
--- orxonox/trunk/src/util/animation/animation_player.cc	(revision 3868)
+++ orxonox/trunk/src/util/animation/animation_player.cc	(revision 3868)
@@ -0,0 +1,192 @@
+/* 
+   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_ANIM
+
+#include "animation_player.h"
+
+#include "compiler.h"
+
+using namespace std;
+
+
+/**
+   \brief standard constructor
+*/
+AnimationPlayer::AnimationPlayer () 
+{
+   this->setClassName ("AnimationPlayer");
+
+   this->animationList = new tList<Animation>();
+   this->play();
+}
+
+/**
+   \brief the singleton reference to this class
+*/
+AnimationPlayer* AnimationPlayer::singletonRef = NULL;
+
+/**
+   \returns a Pointer to this Class
+*/
+AnimationPlayer* AnimationPlayer::getInstance(void)
+{
+  if (!AnimationPlayer::singletonRef)
+    AnimationPlayer::singletonRef = new AnimationPlayer();
+  return AnimationPlayer::singletonRef;
+}
+
+/**
+   \brief standard deconstructor
+
+   !! DANGER !! when unloading the AnimationPlayer no other Function
+   should reference any Animations, from the animationList because it 
+   automatically deletes them. 
+   This usually happens when unloading a World.
+*/
+AnimationPlayer::~AnimationPlayer () 
+{
+  // deleting the Animation List AND all the elements of the List
+  this->flush();
+  delete this->animationList;
+
+  AnimationPlayer::singletonRef = NULL;
+}
+
+/**
+   \brief adds an Animation to the AnimationList.
+   \param animation the Animation to handle
+
+   when adding a Animation the Animation will too be deleted when
+   the AnimationPlayer gets deleted. Consider not adding it, or 
+   unadding it with animation->notHandled();
+*/
+void AnimationPlayer::addAnimation(Animation* animation)
+{
+  this->animationList->add(animation);
+}
+
+/**
+   \brief removes an Animation from the Animation List, WITHOUT deleting it.
+   \param animation the Anmination to remove from the List
+*/
+void AnimationPlayer::removeAnimation(Animation* animation)
+{
+  this->animationList->remove(animation);
+}
+
+/**
+   \brief empties the list AND deletes all the Animations
+*/ 
+void AnimationPlayer::flush(void)
+{
+  // deleting the Animation List AND all the elements of the List
+  tIterator<Animation>* animIt = this->animationList->getIterator();
+  Animation* anim = animIt->nextElement();
+  while( anim != NULL)
+    {
+      delete anim;
+      this->animationList->remove(anim);
+      anim = animIt->nextElement();
+    }
+  delete animIt;
+
+  delete this->animationList;
+  this->animationList = new tList<Animation>();
+}
+
+/**
+   \brief Ticks all the animations in animationList 
+   \param timePassed the time passed since the last tick.
+*/
+void AnimationPlayer::tick(float timePassed)
+{
+  if (this->bRunning)
+    {
+      // iterate through all the animations and tick them.
+      tIterator<Animation>* animIt = this->animationList->getIterator();
+      Animation* anim = animIt->nextElement();
+      while( anim != NULL)
+	{
+	  anim->tick(timePassed);
+	  if(unlikely(anim->ifDelete()))
+	  {
+	    this->animationList->remove(anim);
+	    delete anim;
+	  }
+	  anim = animIt->nextElement();
+	}
+      delete animIt;
+    }
+}
+/**
+   \brief starts playing the AnimationPlayer
+*/
+void AnimationPlayer::play(void)
+{
+  this->bRunning = true;
+}
+
+/**
+   \brief pauses playing of the AnimationPlayer
+*/
+void AnimationPlayer::pause(void)
+{
+  this->bRunning = false;
+}
+
+
+Animation* AnimationPlayer::getObjectFromBaseObject(const BaseObject* baseObject) const
+{
+  tIterator<Animation>* animIt = this->animationList->getIterator();
+  Animation* anim = animIt->nextElement();
+  while( anim != NULL)
+    {
+      if(anim->getBaseObject() == baseObject)
+	{
+	  delete animIt;
+	  return anim;
+	}
+      anim = animIt->nextElement();
+    }
+  delete animIt;
+
+}
+
+
+
+/**
+   \brief Outputs some nice debug-information
+*/
+void AnimationPlayer::debug(void)
+{
+  PRINT(0)("+------------------------------------+\n");
+  PRINT(0)("+ ANIMATION PLAYER DEBUG INFORMATION +\n");
+  PRINT(0)("+------------------------------------+\n");
+  PRINT(0)("| Reference: %p\n", this);
+  PRINT(0)("| CountOfAnims %d\n", this->animationList->getSize());
+  PRINT(0)("-Animation Information---------------+\n");
+  // Per ANIMATION DEBUG
+  tIterator<Animation>* animIt = this->animationList->getIterator();
+  Animation* anim = animIt->nextElement();
+  while( anim != NULL)
+    {
+      //      anim->debug();
+      anim = animIt->nextElement();
+    }
+  delete animIt;
+
+  PRINT(0)("+--------------------------------AP--+\n");
+}
Index: orxonox/trunk/src/util/animation/animation_player.h
===================================================================
--- orxonox/trunk/src/util/animation/animation_player.h	(revision 3868)
+++ orxonox/trunk/src/util/animation/animation_player.h	(revision 3868)
@@ -0,0 +1,59 @@
+/*! 
+    \file animation_player.h
+*/
+
+#ifndef _ANIMATION_PLAYER_H
+#define _ANIMATION_PLAYER_H
+
+#include "base_object.h"
+#include "animation.h"
+
+/* FORWARD DEFINITION */
+
+//! A AnimationPlayer, that handles the animation of all the Animations in the scene.
+/**
+   <b>AnimationPlayer usage:</b> \n
+
+   <b>Initialisation</b>: AnimationPlayer::getInstance() does the trick this is 
+   usually done when initializing a world \n
+   <b>Adding Animations</b>: create an Animation the following Way:
+   \li Anim* animation = new Anim(); // also use any other Subclass of Animation to initialize this
+   \li set some parameters: also see the specific classes for more info
+   \n
+   if you do not want a specific Animation to be handled by the AnimationPlayer, you have to 
+   unload it explicitely with animation->doNotHandle();
+   \n
+   eveything else will be done by the AnimationPlayer itself.\n
+*/
+class AnimationPlayer : public BaseObject {
+
+ public:
+  static AnimationPlayer* getInstance(void);
+  virtual ~AnimationPlayer(void);
+
+  // animation handling
+  void addAnimation(Animation* animation);
+  void removeAnimation(Animation* animation);
+  void flush(void);
+
+  // time functions
+  void tick(float timePassed);
+  void play(void);
+  void pause(void);
+
+  Animation* getObjectFromBaseObject(const BaseObject* baseObject) const;
+
+  void debug(void);
+
+ private:
+  /* singleton */
+  AnimationPlayer(void);
+  static AnimationPlayer* singletonRef;
+
+  /* class specific */
+  tList<Animation>* animationList;         //!< A List of Animations to be handled.
+  bool bRunning;                           //!< If the AnimationPlayer is running.
+};
+
+
+#endif /* _ANIMATION_PLAYER_H */
Index: orxonox/trunk/src/util/animation/t_animation.h
===================================================================
--- orxonox/trunk/src/util/animation/t_animation.h	(revision 3868)
+++ orxonox/trunk/src/util/animation/t_animation.h	(revision 3868)
@@ -0,0 +1,346 @@
+/*
+   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: ...
+*/
+
+/*! 
+    \file t_animation.h
+*/
+
+#ifndef _T_ANIMATION_H
+#define _T_ANIMATION_H
+
+
+#include "animation.h"
+
+#define DELTA_X 0.05  //!< the percentag of the distance that doesnt have to be done by neg_exp (asymptotical) ~ maschinendelta
+
+//! A Struct for Keyframes that simply hold a float
+typedef struct KeyFrameF
+{
+  float duration;             //!< duration of this keyframe
+  float value;                //!< value of this keyframe
+  ANIM_FUNCTION animFunc;     //!< with whitch function to iterate to the next KeyFrameF
+};
+
+
+//! A Class to handle some animation for single floated values.
+template<class T> class tAnimation : public Animation
+{
+ public:
+  tAnimation(T* object = NULL, void (T::*funcToAnim)(float) = NULL);
+  virtual ~tAnimation();
+
+  void setFuncToAnim(T* object, void (T::*funcToAnim)(float));
+
+  void addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc = ANIM_LINEAR);
+
+  virtual void rewind();
+  virtual void tick(float dt);
+
+ private:
+  // animation functions
+  void setAnimFunc(ANIM_FUNCTION animFunc);
+  float constant(float timePassed) const;
+  float linear(float timePassed) const;
+  float sine(float timePassed) const;
+  float cosine(float timePassed) const;
+  float exp(float timePassed) const;
+  float negExp(float timePassed) const;
+  float quadratic(float timePassed) const;
+  float random(float timePassed) const;
+
+
+  //  ANIM_FUNCTION animFunc;
+  float (tAnimation<T>::*animFunc)(float) const;  //!< A Function for the AnimationType
+
+  KeyFrameF* currentKeyFrame;                     //!< The current KeyFrame
+  KeyFrameF* nextKeyFrame;                        //!< The KeyFrame we iterate to
+  tList<KeyFrameF>* keyFrameList;                 //!< The KeyFrameList
+
+  T* object;                                      //!< The Object from which to Animate something
+  void (T::*funcToAnim)(float);                   //!< The function to Animate
+
+  float expFactor;                                //!< some factors
+};
+
+
+
+/**
+   \brief standard constructor
+*/
+template<class T>
+tAnimation<T>::tAnimation (T* object, void (T::*funcToAnim)(float)) 
+{
+  // create a new List
+  this->keyFrameList = new tList<KeyFrameF>();
+  KeyFrameF* tmpKeyFrame = new KeyFrameF;
+  tmpKeyFrame->value = 0.0;
+  tmpKeyFrame->duration = 1.0;
+  keyFrameList->add(tmpKeyFrame);
+
+  this->currentKeyFrame = tmpKeyFrame;
+  this->nextKeyFrame = tmpKeyFrame;
+
+  this->animFunc = &tAnimation<T>::linear;
+
+  this->setFuncToAnim(object, funcToAnim);
+}
+
+
+/**
+   \brief standard deconstructor
+   
+   deletes all the Keyframes
+*/
+template<class T>
+tAnimation<T>::~tAnimation () 
+{
+  // delete all the KeyFrames
+  tIterator<KeyFrameF>* itKF = keyFrameList->getIterator();
+  KeyFrameF*  enumKF = itKF->nextElement();
+  while (enumKF)
+    {
+      delete enumKF;
+      enumKF = itKF->nextElement();
+    }
+  delete itKF;
+  delete this->keyFrameList;
+}
+
+/**
+   \brief rewinds the Animation to the beginning (first KeyFrame and time == 0)
+*/
+template<class T>
+void tAnimation<T>::rewind(void)
+{
+  this->currentKeyFrame = keyFrameList->firstElement();
+  this->nextKeyFrame = keyFrameList->nextElement(keyFrameList->firstElement());
+  this->localTime = 0.0;
+}
+
+/**
+   \brief sets the Function we want to animate
+   \param object from what object do we want to animate
+   \param funcToAnim which function
+*/
+template<class T>
+void tAnimation<T>::setFuncToAnim(T* object, void (T::*funcToAnim)(float))
+{
+  this->baseObject = this->object = object;
+  this->funcToAnim = funcToAnim;
+}
+
+/**
+   \brief Appends a new Keyframe
+   \param value the value of the new KeyFrame
+   \param duration The duration from the new KeyFrame to the next one
+   \param animFunc The function to animate between this keyFrame and the next one
+*/
+template<class T>
+void tAnimation<T>::addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc)
+{
+  // some small check
+  if (duration <= 0.0)
+    duration = 1.0;
+
+  KeyFrameF* tmpKeyFrame;
+    
+  if (bHasKeys)
+    {
+      tmpKeyFrame = new KeyFrameF;
+      if (this->currentKeyFrame == this->nextKeyFrame)
+	this->nextKeyFrame = tmpKeyFrame;
+      this->keyFrameList->add(tmpKeyFrame);
+
+    }
+  else
+    {
+      tmpKeyFrame = this->keyFrameList->firstElement();
+      bHasKeys = true;
+      this->setAnimFunc(animFunc);
+    }
+  tmpKeyFrame->value = value;
+  tmpKeyFrame->duration = duration;
+  tmpKeyFrame->animFunc = animFunc;
+}
+
+/**
+   \brief ticks the Animation
+   \param dt how much time to tick
+*/
+template<class T>
+void tAnimation<T>::tick(float dt)
+{
+  if (this->bRunning)
+    {
+      this->localTime += dt;
+      if (localTime >= this->currentKeyFrame->duration)
+	{
+	  // switching to the next Key-Frame
+	  this->localTime -= this->currentKeyFrame->duration;
+
+	  this->currentKeyFrame = this->nextKeyFrame;
+	  // checking, if we should still Play the animation
+	  if (this->currentKeyFrame == this->keyFrameList->lastElement())
+	    this->handleInfinity();
+	  this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
+	  printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
+	  this->setAnimFunc(this->currentKeyFrame->animFunc);	  
+	}
+      
+      (this->object->*(funcToAnim))((this->*animFunc)(this->localTime));
+    }
+}
+
+/**
+   \brief Sets The kind of Animation between this keyframe and the next one
+   \param animFunc The Type of Animation to set
+*/
+template<class T>
+void tAnimation<T>::setAnimFunc(ANIM_FUNCTION animFunc)
+{
+  switch (animFunc)
+    {
+    default:
+    case ANIM_CONSTANT:
+      this->animFunc = &tAnimation<T>::constant;
+      break;
+    case ANIM_LINEAR:
+      this->animFunc = &tAnimation<T>::linear;
+      break;
+    case ANIM_SINE:
+      this->animFunc = &tAnimation<T>::sine;
+      break;
+    case ANIM_COSINE:
+      this->animFunc = &tAnimation<T>::cosine;
+      break;
+    case ANIM_EXP:
+      this->animFunc = &tAnimation<T>::exp;
+      break;
+    case ANIM_NEG_EXP:
+      {
+	this->animFunc = &tAnimation<T>::negExp;
+	float d = fabs(this->currentKeyFrame->value - this->nextKeyFrame->value);
+	expFactor =  - 1.0 / this->currentKeyFrame->duration * logf(DELTA_X);
+	break;
+      }
+    case ANIM_QUADRATIC:
+      this->animFunc = &tAnimation<T>::quadratic;
+      break;
+    case ANIM_RANDOM:
+      this->animFunc = &tAnimation<T>::random;
+      break;
+    }
+}
+
+
+// animation functions
+/**
+   \brief stays at the value of the currentKeyFrame
+   \param timePassed The time passed since this Keyframe began
+*/
+template<class T>
+float tAnimation<T>::constant(float timePassed) const
+{
+  return this->currentKeyFrame->value;
+}
+
+/**
+   \brief linear interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+*/
+template<class T>
+float tAnimation<T>::linear(float timePassed) const 
+{
+  return this->currentKeyFrame->value + (this->nextKeyFrame->value - this->currentKeyFrame->value) 
+    * (timePassed / this->currentKeyFrame->duration);
+  //  PRINTF(0)("value is %f, %p %p\n", val, this->currentKeyFrame, this->nextKeyFrame);
+  //  return val;
+}
+
+/**
+   \brief a Sinusodial Interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+*/
+template<class T>
+float tAnimation<T>::sine(float timePassed) const
+{
+  float d = this->currentKeyFrame->value - this->nextKeyFrame->value;
+  float e = 0.5 * d * (1 - cos(M_PI * timePassed / this->currentKeyFrame->duration));
+  return this->currentKeyFrame->value - e;
+  /*
+  return his->currentKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value)
+    * sin(timePassed / this->currentKeyFrame->duration * M_PI);
+  */
+}
+
+/**
+   \brief a cosine interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+*/
+template<class T>
+float tAnimation<T>::cosine(float timePassed) const
+{
+  float d = this->currentKeyFrame->value - this->nextKeyFrame->value;
+  float e = 0.5 * d * (sin(M_PI * timePassed / this->currentKeyFrame->duration));
+  if( timePassed > 0.5*this->currentKeyFrame->duration) e = (d - e);
+  return this->currentKeyFrame->value - e;
+  /*
+  return this->currentKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value)
+    * cos(timePassed / this->currentKeyFrame->duration * M_PI);
+  */
+}
+
+/**
+   \brief an exponential interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+*/
+template<class T>
+float tAnimation<T>::exp(float timePassed) const
+{
+}
+
+/**
+   \brief a negative exponential interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+*/
+template<class T>
+float tAnimation<T>::negExp(float timePassed) const
+{
+  float d = this->currentKeyFrame->value - this->nextKeyFrame->value;
+  float e = d * (1.0 - expf(- timePassed * expFactor));
+  return  this->currentKeyFrame->value - e;
+}
+
+/**
+   \brief a quadratic interpolation between this keyframe and the next one
+   \param timePassed The time passed since this Keyframe began
+*/
+template<class T>
+float tAnimation<T>::quadratic(float timePassed) const
+{
+  this->linear(timePassed);
+}
+
+/**
+   \brief some random animation (fluctuating)
+   \param timePassed The time passed since this Keyframe began
+*/
+template<class T>
+float tAnimation<T>::random(float timePassed) const
+{
+  return this->currentKeyFrame->value * (float)rand()/(float)RAND_MAX;
+}
+
+#endif /* _T_ANIMATION_H */
