Index: /orxonox/branches/trackManager/src/curve.cc
===================================================================
--- /orxonox/branches/trackManager/src/curve.cc	(revision 3374)
+++ /orxonox/branches/trackManager/src/curve.cc	(revision 3375)
@@ -40,6 +40,47 @@
     }
   currentNode->position = newNode;
-  currentNode->next = 0; // not sure if this really points to NULL!!
+  currentNode->next = 0;
   currentNode->number = (++nodeCount);
+  this->rebuild();
+  return;
+}
+
+void Curve::addNode(const Vector& newNode, unsigned int insertPosition)
+{
+
+  if (this->nodeCount == 0 || insertPosition > this->nodeCount)
+    return addNode(newNode);
+
+  if (insertPosition == 0)
+    insertPosition = 1;
+
+  PathNode* insNode = new PathNode;
+
+  // relinking
+  PathNode* tmpNode = this->firstNode;
+  if (insertPosition > 1)
+    {
+      while (tmpNode->next->number != insertPosition)
+	tmpNode= tmpNode->next;
+      insNode->next = tmpNode->next;
+      tmpNode->next = insNode;
+    }
+  else
+    {
+      insNode->next = this->firstNode;
+      this->firstNode = insNode;
+    }
+  // renumbering
+  insNode->number = insertPosition;
+  tmpNode = insNode->next;
+  while (tmpNode)
+    {
+      tmpNode->number++;
+      tmpNode = tmpNode->next;
+    }
+
+    // finished
+  insNode->position = newNode;
+  ++nodeCount;
   this->rebuild();
   return;
@@ -60,4 +101,22 @@
   return tmpNode->position;
 }
+
+/**
+   \brief Outputs information about the state of this Curve
+*/
+void Curve::debug(void)
+{
+  printf("<<-------------------------------\n");
+  printf("Curve Information:\n");
+  printf("NodeCount: %d\n", this->nodeCount);
+  PathNode* tmpNode = this->firstNode;
+  while (tmpNode)
+    {
+      printf("node #%d: %f, %f, %f\n", tmpNode->number, tmpNode->position.x, tmpNode->position.y, tmpNode->position.z);
+      tmpNode = tmpNode->next;
+    }
+  printf("------------------------------->>\n");
+}
+
 
 ///////////////////////////////////
Index: /orxonox/branches/trackManager/src/curve.h
===================================================================
--- /orxonox/branches/trackManager/src/curve.h	(revision 3374)
+++ /orxonox/branches/trackManager/src/curve.h	(revision 3375)
@@ -43,4 +43,5 @@
   Curve* dirCurve;       //!< The derivation-curve of this Curve.
   void addNode(const Vector& newNode);
+  void addNode(const Vector& newNode, unsigned int insertPosition);
   Vector getNode(unsigned int nodeToFind);
   inline int getNodeCount(void) { return this->nodeCount;}
@@ -51,4 +52,6 @@
   virtual Quaternion calcQuat(float t) = 0;
  
+  // DEBUG
+  void debug(void);
 };
 
Index: /orxonox/branches/trackManager/src/track_manager.cc
===================================================================
--- /orxonox/branches/trackManager/src/track_manager.cc	(revision 3374)
+++ /orxonox/branches/trackManager/src/track_manager.cc	(revision 3375)
@@ -466,5 +466,5 @@
     {
       Vector tmp = this->calcPos();
-      Quaternion quat = Quaternion(this->calcDir(), Vector(0,1,this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).z)); 
+      Quaternion quat = Quaternion(this->calcDir(), Vector(this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).x,1,this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).z)); 
       this->bindSlave->setAbsCoor(&tmp);
       this->bindSlave->setAbsDir(&quat);
Index: /orxonox/branches/trackManager/src/world.cc
===================================================================
--- /orxonox/branches/trackManager/src/world.cc	(revision 3374)
+++ /orxonox/branches/trackManager/src/world.cc	(revision 3375)
@@ -230,9 +230,13 @@
       
       /*
-      tmpCurve->addNode(Vector(10,0,-10));
-      //tmpCurve->addNode(Vector(10,2,5));
-      //tmpCurve->addNode(Vector(10,3,-5));
-      //      tmpCurve->addNode(Vector(10,1,5));
-      tmpCurve->addNode(Vector(10,0,5));
+	tmpCurve->addNode(Vector(10,  -1,  -1));
+	tmpCurve->addNode(Vector(10,  -2,   2));
+	tmpCurve->addNode(Vector(10,   3,   3));
+	tmpCurve->addNode(Vector(10,   4,  -4), 0);
+	tmpCurve->addNode(Vector(10,  -1,  -1));
+	tmpCurve->addNode(Vector(10,  -2,   2));
+	tmpCurve->addNode(Vector(10,   3,   3));
+	tmpCurve->addNode(Vector(10,   4,  -4), 0);
+	tmpCurve->debug();
       */
       switch(this->debugWorldNr)
@@ -509,6 +513,5 @@
   trackManager->drawGraph(.01);
   trackManager->debug(2);
-  
-  /*
+  /*  
   glBegin(GL_LINES);
   float i;
