Index: /orxonox/branches/trackManager/src/track_manager.cc
===================================================================
--- /orxonox/branches/trackManager/src/track_manager.cc	(revision 3372)
+++ /orxonox/branches/trackManager/src/track_manager.cc	(revision 3373)
@@ -38,10 +38,10 @@
   this->startingTime = 0; //!< \todo eventually set this to the max time of TrackManager.
   this->duration = 1;
+  this->endTime = 1;
+  this->jumpTime = 0;
   this->curveType = BEZIERCURVE;
   this->nodeCount = 0;
   this->childCount = 0;
   this->name = NULL;
-  this->startPoint = Vector(0,0,0);
-  this->startTangentPoint = Vector(0,0,0);
   this->curve = NULL;
   this->children = NULL;
@@ -157,7 +157,7 @@
       this->currentTrackElem->children[i] = new TrackElement();
       this->currentTrackElem->children[i]->ID = ++trackElemCount;
-      this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->startingTime+this->currentTrackElem->duration;
-      this->currentTrackElem->children[i]->startPoint = this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount());
-      this->currentTrackElem->children[i]->startTangentPoint = (this->currentTrackElem->children[i]->startPoint *2) - this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()-1);
+      this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->endTime;
+      this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]);
+      this->addPoint((this->currentTrackElem->children[i]->curve->getNode(0) *2) - this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()-1),  this->currentTrackElem->children[i]);
     }
 }
@@ -194,19 +194,19 @@
    \brief curveType The Type to set
 */
-void TrackManager::setCurveType(CurveType curveType)
-{
-  if (!this->currentTrackElem->isFresh)
+void TrackManager::setCurveType(CurveType curveType, TrackElement* trackElem)
+{
+  if (!trackElem->isFresh)
     {
       PRINTF(2)("It is not possible to change the type of a Curve after you have have appended some points to it\n");
       return;
     }
-  this->currentTrackElem->curveType = curveType;
+  trackElem->curveType = curveType;
   switch (curveType)
     {
     case BEZIERCURVE:
-      this->currentTrackElem->curve = new BezierCurve();
+      trackElem->curve = new BezierCurve();
       break;
     case UPOINTCURVE:
-      this->currentTrackElem->curve = new UPointCurve();
+      trackElem->curve = new UPointCurve();
       break;
     }
@@ -221,4 +221,5 @@
 {
   this->currentTrackElem->duration = time;
+  this->currentTrackElem->endTime = this->currentTrackElem->startingTime + time;
 }
 
@@ -241,11 +242,6 @@
   if (trackElem->isFresh)
     {
-      this->setCurveType(BEZIERCURVE);
+      this->setCurveType(BEZIERCURVE, trackElem);
       trackElem->isFresh = false;
-      if(trackElem != this->firstTrackElem)
-	{
-	  this->addPoint(trackElem->startPoint);
-	  this->addPoint(trackElem->startTangentPoint);
-	}
     }
   trackElem->curve->addNode(newPoint);
@@ -380,4 +376,5 @@
   int tmpCurrentWorkingID = this->currentTrackElem->ID;
   this->workOn(trackIDs[0]);
+  float tmpLatestTime = this->currentTrackElem->endTime;
 
   TrackElement* firstJoint = this->currentTrackElem;
@@ -388,5 +385,13 @@
   if(!firstJoint->isHotPoint)
     this->setSavePoint();
-
+  // Timing:
+  for (int i = 0; i < count; i++)
+    {
+      TrackElement* tmpJoinElem = this->findTrackElementByID(trackIDs[i]);
+      if (tmpJoinElem->childCount == 0
+	  && tmpJoinElem->endTime > tmpLatestTime)
+	    tmpLatestTime = tmpJoinElem->endTime;
+    }
+  // Joining:
   for (int i = 1; i < count; i++)
     {
@@ -398,4 +403,5 @@
 	  this->addPoint(tmpTangentPoint, tmpJoinElem);
 	  this->addPoint(tmpEndPoint, tmpJoinElem);
+	  tmpJoinElem->jumpTime = tmpLatestTime - tmpJoinElem->endTime;
 	  
 	  //Copying Joint-Info
@@ -404,8 +410,12 @@
 	  tmpJoinElem->isSavePoint = firstJoint->isSavePoint;
 	  tmpJoinElem->isFork = firstJoint->isFork;
-	  
+
 	  tmpJoinElem->isJoined = true;
 	}
     }
+  if(currentTrackElem->children)
+    for(int i = 0; i > currentTrackElem->childCount; i++)
+      currentTrackElem->children[i]->startingTime = tmpLatestTime;
+
   // returning to the TrackElement we were working on.
   this->workOn(tmpCurrentWorkingID);
@@ -430,5 +440,5 @@
 Vector TrackManager::calcDir() const
 {
-  return this->currentTrackElem->curve->calcDir((this->localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration);
+  return this->currentTrackElem->curve->calcDir((this->localTime - this->currentTrackElem->startingTime)/this->currentTrackElem->duration);
 }
 
@@ -442,10 +452,15 @@
 {
   dt /= 1000;
-  printf("LocalTime is: %f, timestep is: %f\n", this->localTime, dt);
+  printf("CurrentTrackID: %d, LocalTime is: %f, timestep is: %f\n", this->currentTrackElem->ID, this->localTime, dt);
   if (this->localTime <= this->firstTrackElem->duration)
     this->jumpTo(this->localTime);
   this->localTime += dt;
-  if (this->localTime > this->currentTrackElem->startingTime + this->currentTrackElem->duration && this->currentTrackElem->childCount > 0)
-    this->currentTrackElem = this->currentTrackElem->children[0];
+  if (this->localTime > this->currentTrackElem->endTime
+      && this->currentTrackElem->children)
+    {
+      if (this->currentTrackElem->jumpTime > 0) 
+	this->jumpTo(this->localTime + this->currentTrackElem->jumpTime);
+      this->currentTrackElem = this->currentTrackElem->children[0];
+    }
   if (this->bindSlave)
     {
@@ -535,5 +550,5 @@
 	  if(tmpElem->isFresh)
 	    printf("   has not jet eddited in any way\n");
-	  printf("\n   TimeTable: starting at = %f; ends at = %f; duration = %f\n", tmpElem->startingTime, tmpElem->startingTime+tmpElem->duration, tmpElem->duration);
+	  printf("\n   TimeTable: startingTime=%f; endTime=%f; duration=%f; jumpTime=%f\n", tmpElem->startingTime, tmpElem->endTime, tmpElem->duration, tmpElem->jumpTime);
 	  printf("   consists of %d Points\n", tmpElem->nodeCount);
 	  if (tmpElem->childCount == 0)
Index: /orxonox/branches/trackManager/src/track_manager.h
===================================================================
--- /orxonox/branches/trackManager/src/track_manager.h	(revision 3372)
+++ /orxonox/branches/trackManager/src/track_manager.h	(revision 3373)
@@ -46,9 +46,9 @@
   float startingTime;        //!< The time at which this Track begins.
   float duration;            //!< The time used to cross this TrackElement (curve).
+  float endTime;             //!< The time at which this Track ends.
+  float jumpTime;            //!< The Time this Track has to jump to its preceding Track (only >0 if Track isJoined==true)
   CurveType curveType;       //!< The CurveType this will have.
   int nodeCount;             //!< The count of points this TrackElement has.
   char* name;                //!< A name for the Trac.
-  Vector startPoint;         //!< A Vector that Points to the first point of the containing Curve. (for c1-steadiness)
-  Vector startTangentPoint;  //!< A Vector that points into the direction of the previous Curve. (for c1-steadiness)
   Curve* curve;              //!< The Curve of this TrackElement
   int childCount;            //!< The number of Children This TrackElement has.
@@ -117,5 +117,6 @@
   // Methods to change the Path (initialisation)
   void workOn(unsigned int trackID);
-  void setCurveType(CurveType curveType);
+  inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);}
+  void setCurveType(CurveType curveType, TrackElement* trackElem);
   void setDuration(float time);
   bool addPoint(Vector newPoint);
Index: /orxonox/branches/trackManager/src/world.cc
===================================================================
--- /orxonox/branches/trackManager/src/world.cc	(revision 3372)
+++ /orxonox/branches/trackManager/src/world.cc	(revision 3373)
@@ -226,8 +226,8 @@
       trackManager->addPoint(Vector(210,0,10));
       trackManager->setDuration(1);
-
-
       trackManager->join(4, fork21, fork22, fork13, fork14);
-
+      trackManager->workOn(10);
+      trackManager->addPoint(Vector(250,-10,5));
+      
       /*
       tmpCurve->addNode(Vector(10,0,-10));
