Index: orxonox/branches/bezierTrack/src/Makefile.am
===================================================================
--- orxonox/branches/bezierTrack/src/Makefile.am	(revision 3027)
+++ orxonox/branches/bezierTrack/src/Makefile.am	(revision 3028)
@@ -31,5 +31,5 @@
 		coordinates.cc
 
-noinst_HEADERS=ability.h \
+noinst_HEADERS= ability.h \
 		data_tank.h \
 		npc.h \
Index: orxonox/branches/bezierTrack/src/camera.cc
===================================================================
--- orxonox/branches/bezierTrack/src/camera.cc	(revision 3027)
+++ orxonox/branches/bezierTrack/src/camera.cc	(revision 3028)
@@ -44,4 +44,8 @@
   actual_place.pos.y = 10.0;
   actual_place.pos.z = -5.0;
+  
+  // Initializing Target
+  target = new CameraTarget (Vector (0,0,0));
+  
 }
 
@@ -79,104 +83,10 @@
   switch(cameraMode)
     {
-      
-    case ELLIPTICAL:
-      {
-	//r = actual_place.r 
-	Orxonox *orx = Orxonox::getInstance();
-	Location lookat;  
-	Placement plFocus;
-	if( bound != NULL)
-	  {
-	    bound->get_lookat (&lookat);
-	    orx->get_world()->calc_camera_pos (&lookat, &plFocus);
-	    Quaternion *fr;
-	    if(t < 20.0)
-	      {
-		Vector *start = new Vector(0.0, 1.0, 0.0);
-		//r = /*actual_place.r*/ *start - plFocus.r;
-		r = *(new Vector(0.0, 5.0, 0.0));
-
-		Vector up(0.0, 0.0, 1.0);
-		
-		Vector op(1.0, 0.0, 0.0);
-		float angle = angle_deg(op, *start);
-		printf("angle is: %f\n", angle);
-
-		//if in one plane
-		from = new Quaternion(angle, up);
-
-		//from = new Quaternion(*start, *up);
-		//&from = &plFocus.w;
-		//fr = &plFocus.w; real quaternion use
-		
-
-
-		Vector vDirection(1.0, 0.0, 0.0);
-		//vDirection = plFocus.w.apply(vDirection);
-		to = new Quaternion(vDirection, *start);
-		res = new Quaternion();
-	      }
-	    //printf("vector r = %f, %f, %f\n",r.x, r.y, r.z );
-	    rAbs = r.len();
-	    if(t < 30.0) /* FIXME!!*/
-	      {
-		ka = rAbs / deltaTime*deltaTime;
-	      }
-	    /* this is the new length of the vector */
-	    //float len = ka * powf((deltaTime - t), 2);
-	    
-	    /* calc the rotation */
-	    /*
-	    Vector axis(0.0, 0.0, 1.0);
-	    if(t < 30.0)
-	      a0 = PI/4 - atanf(fabs(r.x) / fabs(r.y));
-	    printf("a0 = %f\n", a0);
-	    float angle = a0/deltaTime * (deltaTime - t);
-	    printf("angle is: %f\n", angle);
-	    Quaternion q(angle, axis);
-	    */
-	    //r = q.apply(r);
-	    //r = r * (len/r.len());
-	    
-	    //res->quatSlerp(from, to, t/deltaTime, res);
-	    res->quatSlerp(to, from, t/deltaTime, res);
-
-	    Vector ursp(0.0, 0.0, 0.0);
-	    desired_place.pos = /*plFocus.r -*/ ursp - res->apply(r); 
-
-	    printf("desired place is: %f, %f, %f\n", desired_place.pos.x, desired_place.pos.y, desired_place.pos.z);
-	    //plLastBPlace = *bound->get_placement();
-	  } 
-      }
-      break;
-    case SMOTH_FOLLOW:
-      {
-	Placement *plBound = bound->get_placement();
-	Location lcBound;
-	if(bound != null)
-	  {
-	    bound->get_lookat(&lcBound);
-	    Vector vDirection(0.0, 0.0, 1.0);
-	    vDirection = plBound->rot.apply(vDirection);
-	    desired_place.pos = (vDirection * ((lcBound.dist-10.0)/* / l*/)) + Vector(0,0,5.0);
-	  }
-	break;
-      }
-      /* this is a camera mode that tries just to follow the entity. */
-    case STICKY:
-      {
-	if(bound != null)
-	  {
-	    Placement *plBound = bound->get_placement();
-	    Vector vDirection(0.0, 0.0, 1.0);
-	    Vector eclipticOffset(0.0, 0.0, 5.0);
-	    vDirection = plBound->rot.apply(vDirection);
-	    desired_place.pos = plBound->pos - vDirection*10 + eclipticOffset;
-	  }
-	break;
-      }
-      /* the camera is handled like an entity and rolls on the track */
+
     case NORMAL:
-      Location lookat;  
+      this->setPosition(world->track->getPos() - world->track->getDir() *10 +Vector (0,0,5), WORLD);
+      target->setPosition(world->track->getPos(), WORLD);
+
+      Location lookat;
       if( bound != NULL && world != NULL )
 	{
@@ -206,37 +116,20 @@
   // TO DO: implement options for frustum generation
   glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 250.0);
-  //Vector up(0,0,1);
-  //Vector dir(1,0,0);
-  //Quaternion q(dir,up);
-  //float matrix[4][4];
-  //q.conjugate().matrix (matrix);
-  //glMultMatrixf ((float*)matrix);
-  //glTranslatef (10,0,-5);
-  //
-  //dir = Vector(-1,-1,0);
-  //q = Quaternion( dir, up);
-  //glMatrixMode (GL_MODELVIEW);
-  //glLoadIdentity ();
-  //q.matrix (matrix);
-  //glMultMatrixf ((float*)matrix);
-  //glTranslatef (2,2,0);
-  //
-  //glBegin(GL_TRIANGLES);
-  //glColor3f(1,0,0);
-  //glVertex3f(0,0,0.5);
-  //glColor3f(0,1,0);
-  //glVertex3f(-0.5,0,-1);
-  //glColor3f(0,0,1);
-  //glVertex3f(0.5,0,-1);
-  //glEnd();	
 
   // ===== first camera control calculation option
   // rotation
+  Vector eye = this->getPosition(WORLD);
+  Vector targetV = target->getPosition(WORLD);
+
+  gluLookAt (eye.x, eye.y, eye.z, 
+	     targetV.x, targetV.y, targetV.z, 
+	     0,0,1);
+
   float matrix[4][4];
   actual_place.rot.conjugate().matrix (matrix);
   /* orientation and */
-  glMultMatrixf ((float*)matrix);
+  //  glMultMatrixf ((float*)matrix);
   /*  translation */
-  glTranslatef (-actual_place.pos.x, -actual_place.pos.y,- actual_place.pos.z);
+  //  glTranslatef (-actual_place.pos.x, -actual_place.pos.y,- actual_place.pos.z);
   //Placement *plBound = bound->get_placement();
 
@@ -297,2 +190,15 @@
   this->world = world;
 }
+
+
+
+CameraTarget::CameraTarget ()
+{
+  
+
+}
+
+CameraTarget::CameraTarget (Vector pos)
+{
+  this->setPosition (pos, WORLD);
+}
Index: orxonox/branches/bezierTrack/src/camera.h
===================================================================
--- orxonox/branches/bezierTrack/src/camera.h	(revision 3027)
+++ orxonox/branches/bezierTrack/src/camera.h	(revision 3028)
@@ -11,4 +11,5 @@
 class WorldEntity;
 class World;
+class CameraTarget;
 
 //! Camera
@@ -30,4 +31,5 @@
   Placement desired_place;        //!< where the Camera should be according to calculations
   World* world;
+  CameraTarget* target;
   
   /* physical system - not needed yet */
@@ -69,3 +71,18 @@
 };
 
+//! A Class to handle the Target of a Camera.
+class CameraTarget : public Coordinate
+{
+ private:
+  WorldEntity* lookAt;
+  
+  
+ public:
+  CameraTarget ();
+  CameraTarget (Vector pos); //!< a target only needs a Position and no Rotation
+
+  void setLookAt (WorldEntity* lookat);
+
+};
+
 #endif
Index: orxonox/branches/bezierTrack/src/coordinates.h
===================================================================
--- orxonox/branches/bezierTrack/src/coordinates.h	(revision 3027)
+++ orxonox/branches/bezierTrack/src/coordinates.h	(revision 3028)
@@ -46,4 +46,5 @@
 } Coord;
 
+//! A class to handle coordinates of Objects.
 class Coordinate
 {
@@ -56,4 +57,6 @@
   void setPosition (Vector position, COORD_TYPE cType);
   void setRotation (Quaternion rotation, COORD_TYPE cType);
+
+  void move (Vector, COORD_TYPE cType); // just move a Object
 
   Coord getCoord (COORD_TYPE cType) const; 
Index: orxonox/branches/bezierTrack/src/curve.cc
===================================================================
--- orxonox/branches/bezierTrack/src/curve.cc	(revision 3027)
+++ orxonox/branches/bezierTrack/src/curve.cc	(revision 3028)
@@ -130,6 +130,12 @@
   ret.normalize();
 
-  return Vector (0,0,0);//ret;
+  return ret;
 }
+
+Quaternion BezierCurve::calcQuat (float t)
+{
+  return Quaternion (calcDir(t), Vector(0,0,1));
+}
+
 
 /**
@@ -155,2 +161,3 @@
   return ret;
 }
+
Index: orxonox/branches/bezierTrack/src/curve.h
===================================================================
--- orxonox/branches/bezierTrack/src/curve.h	(revision 3027)
+++ orxonox/branches/bezierTrack/src/curve.h	(revision 3028)
@@ -49,6 +49,8 @@
   BezierCurve (void);
   ~BezierCurve (void);
-  virtual Vector calcPos (float t);
-  virtual Vector calcDir (float t);
+  Vector calcPos (float t);
+  Vector calcDir (float t);
+  Quaternion calcQuat (float t);
+  
   
   Vector getPos () const;
Index: orxonox/branches/bezierTrack/src/track.cc
===================================================================
--- orxonox/branches/bezierTrack/src/track.cc	(revision 3027)
+++ orxonox/branches/bezierTrack/src/track.cc	(revision 3028)
@@ -17,5 +17,4 @@
 
 #include "track.h"
-  float t = .0;
 
 using namespace std;
@@ -28,4 +27,6 @@
   this->next = NULL;
   this->previous = NULL;
+  mainTime = .0;
+
 
   curve = BezierCurve();
@@ -62,4 +63,8 @@
 }
 
+Vector Track::getPos (void)
+{
+  return curve.calcPos (mainTime);
+}
 
 Vector Track::getPos (float t)
@@ -67,7 +72,22 @@
   return curve.calcPos (t);
 }
+
+Vector Track::getDir (void)
+{
+  return curve.calcDir (mainTime);
+}
+
 Vector Track::getDir (float t)
 {
   return curve.calcDir (t);
+}
+
+Quaternion Track::getQuat (void)
+{
+  return curve.calcQuat (mainTime);
+}
+Quaternion Track::getQuat (float t)
+{
+  return curve.calcQuat (t);
 }
 
@@ -88,9 +108,11 @@
   //  float r = (lookat->dist)*PI / l;
   // camplc->r = trace.r + (trace.a * ((lookat->dist-10.0) / l)) + Vector(0,0,5.0);
-  camplc->pos = curve.calcPos(t) + (curve.calcDir(t)* ((lookat->dist-10.0)/t)) + Vector(-5,0,5);
-				 
+  
+  //  camplc->pos = curve.calcPos(t) + (curve.calcDir(t)* ((lookat->dist-10.0)/t)) + Vector(-5,0,5);
+  camplc->pos = curve.calcPos(mainTime) + (curve.calcDir(mainTime) * 5) + Vector (0,0,5);
+  
   Vector w(0.0,0.0,0.0);
   //  w=Vector(0,0,0) - ((trace.r + (trace.a * ((lookat->dist) / l)) - camplc->r));
-  w = Vector(0,0,0) - (((curve.calcPos(t)) + ((curve.calcDir(t)) * ((lookat->dist) / t)) - camplc->pos));
+  w = Vector(0,0,0) - (((curve.calcPos(mainTime)) + ((curve.calcDir(mainTime)) * ((lookat->dist) / mainTime)) - camplc->pos));
   //Vector up(0.0,sin(r),cos(r)); // corrupt...
   Vector up(0.0, 0.0, 1.0);
@@ -118,26 +140,14 @@
 bool Track::map_coords (Location* loc, Placement* plc)
 {
-  t+=.0001;
-  //  printf ("%f\n", t);
-  //  if (t > 1) t =0;
-  //  printf ("Pos: %f, %f, %f\n", curve.calcPos(t).x, curve.calcPos(t).y, curve.calcPos(t).z); 
-  //Line trace(*offset, *end - *offset);
-  //	float l = trace.len ();
-	
-	/* change to the next track? */
-	//	if( loc->dist > l)
-	//{
-	//	loc->dist -= l;
-	//	loc->part = nextID;
-		//FIXME: loc->track = this;
-		//return true;
-		//}
-	
+  this->setPosition (curve.calcPos (mainTime), WORLD);
+  this->setRotation (curve.calcQuat (mainTime), WORLD);
+  //  printf ("x: %f; y:%f; z:%f\n", getRotation(WORLD).v.x, getRotation(WORLD).v.y, getRotation(WORLD).v.z); 
+
 	/* this quaternion represents the rotation from start-vector (0,0,1) to the direction of
 	 * the track */
-	Quaternion dir(curve.calcDir(t), Vector(0,0,1)); 
+	Quaternion dir(curve.calcDir(mainTime), Vector(0,0,1)); 
 
-	plc->pos = curve.calcPos(t) + (curve.calcDir(t) * ((loc->dist) / t)) + /*dir.apply*/(loc->pos);
-	plc->rot = dir * loc->rot;
+	plc->pos = this->getPosition(WORLD);// curve.calcPos(t) + (curve.calcDir(t) * ((loc->dist) / t)) + /*dir.apply*/(loc->pos);
+	plc->rot = this->getRotation(WORLD);dir * loc->rot;
 	
 	return false;
@@ -174,4 +184,5 @@
 void Track::tick (float deltaT)
 {
+  mainTime += deltaT/10;
 }
 
Index: orxonox/branches/bezierTrack/src/track.h
===================================================================
--- orxonox/branches/bezierTrack/src/track.h	(revision 3027)
+++ orxonox/branches/bezierTrack/src/track.h	(revision 3028)
@@ -15,5 +15,5 @@
    To create special levels with special camera movement, rules or whatever, derive from this base class.
 */
-class Track 
+class Track : public Coordinate
 {
  private:
@@ -22,4 +22,6 @@
   Vector* end;
   BezierCurve curve;
+
+  float mainTime;
   // Vector* direction; // unity direction vector: it is costy to always recalculate it
   //Vector* up; // direction where up is ment to be - diffuse in space, eh?
@@ -39,6 +41,12 @@
   void addHotPoint (Vector hotPoint);
   
+  Vector getPos(void);
   Vector getPos(float t);
+  Vector getDir (void);
   Vector getDir (float t);
+  Quaternion getQuat (void);
+  Quaternion getQuat (float t);
+  Coord getCoord (void);
+  Coord getCoord (float t);
 
   
Index: orxonox/branches/bezierTrack/src/vector.cc
===================================================================
--- orxonox/branches/bezierTrack/src/vector.cc	(revision 3027)
+++ orxonox/branches/bezierTrack/src/vector.cc	(revision 3028)
@@ -257,5 +257,5 @@
 {
   Vector z = dir;
-  z.normalize(); 
+  z.normalize(); // not necesarry
   Vector x = up.cross(z);
   x.normalize(); 
Index: orxonox/branches/bezierTrack/src/world.cc
===================================================================
--- orxonox/branches/bezierTrack/src/world.cc	(revision 3027)
+++ orxonox/branches/bezierTrack/src/world.cc	(revision 3028)
@@ -18,5 +18,4 @@
 #include "world_entity.h"
 #include "collision.h"
-#include "track.h"
 #include "player.h"
 #include "command_node.h"
@@ -423,4 +422,5 @@
     }
 
+  track->tick(seconds);
   //  for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
 }
Index: orxonox/branches/bezierTrack/src/world.h
===================================================================
--- orxonox/branches/bezierTrack/src/world.h	(revision 3027)
+++ orxonox/branches/bezierTrack/src/world.h	(revision 3028)
@@ -9,4 +9,5 @@
 #include "stdincl.h"
 #include "story_entity.h"
+#include "track.h"
 
 
