Index: orxonox/trunk/README
===================================================================
--- orxonox/trunk/README	(revision 2191)
+++ orxonox/trunk/README	(revision 2551)
@@ -20,5 +20,6 @@
 1) Alien is a great film
 2) Guiness is the most delicious beer
-3) If you think there is anything missing: you can be shure it's an arcade game
+3) If you think there is anything missing specialy in terms of story: you can be shure it's an arcade game
+4) Wanna chill: ask Boozoo Bajou
 
 to be continoued...
Index: orxonox/trunk/doc/KNOWLEDGE_BASE
===================================================================
--- orxonox/trunk/doc/KNOWLEDGE_BASE	(revision 2551)
+++ orxonox/trunk/doc/KNOWLEDGE_BASE	(revision 2551)
@@ -0,0 +1,27 @@
+
+
+Matrixes Theory
+===============
+Very important to express any rotation for OpenGL.
+
+A very simple and though not too deep introduction, contains also a good Quaternion introduction:
+http://skal.planet-d.net/demo/matrixfaq.html
+
+Specialy Matrix Rotations:
+http://mathworld.wolfram.com/RotaionMatrix.html
+
+OpenGL Transformation/Rotation Matrixes:
+http://nehe.gamdev.net/data/articles/article.asp?article=02
+
+
+Quaternion Mathematics
+======================
+Orientations can be represented as Quaternions. They make it simpler and, in tearm of CPU-Time, cheaper to calculate rotations.
+
+A good and understandable introduction can be found here:
+http://pw1.netcom.com/~hjsmith/Quatdoc/Qindex.html
+
+
+www.gamedev.net/reference/articles/article1095.asp
+
+
Index: orxonox/trunk/src/Makefile.am
===================================================================
--- orxonox/trunk/src/Makefile.am	(revision 2191)
+++ orxonox/trunk/src/Makefile.am	(revision 2551)
@@ -6,5 +6,5 @@
 
 bin_PROGRAMS=orxonox
-orxonox_SOURCES=orxonox.cc world.cc player.cc data_tank.cc world_entity.cc vector.cc camera.cc collision.cc command_node.cc ini_parser.cc keynames.cc track.cc 
+orxonox_SOURCES=orxonox.cc world.cc player.cc data_tank.cc world_entity.cc vector.cc camera.cc collision.cc command_node.cc ini_parser.cc keynames.cc track.cc base_entity.cc 
 
 #  uncomment the following if bencoder requires the math library
Index: orxonox/trunk/src/Makefile.in
===================================================================
--- orxonox/trunk/src/Makefile.in	(revision 2191)
+++ orxonox/trunk/src/Makefile.in	(revision 2551)
@@ -117,5 +117,5 @@
 #"-O3 -pedantic -fPIC -ffast-math -I/usr/X11R6/include"
 bin_PROGRAMS = orxonox
-orxonox_SOURCES = orxonox.cc world.cc player.cc data_tank.cc world_entity.cc vector.cc camera.cc collision.cc command_node.cc ini_parser.cc keynames.cc track.cc 
+orxonox_SOURCES = orxonox.cc world.cc player.cc data_tank.cc world_entity.cc vector.cc camera.cc collision.cc command_node.cc ini_parser.cc keynames.cc track.cc base_entity.cc 
 subdir = src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -129,5 +129,6 @@
 	data_tank.$(OBJEXT) world_entity.$(OBJEXT) vector.$(OBJEXT) \
 	camera.$(OBJEXT) collision.$(OBJEXT) command_node.$(OBJEXT) \
-	ini_parser.$(OBJEXT) keynames.$(OBJEXT) track.$(OBJEXT)
+	ini_parser.$(OBJEXT) keynames.$(OBJEXT) track.$(OBJEXT) \
+	base_entity.$(OBJEXT)
 orxonox_OBJECTS = $(am_orxonox_OBJECTS)
 orxonox_LDADD = $(LDADD)
@@ -138,5 +139,6 @@
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/camera.Po ./$(DEPDIR)/collision.Po \
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/base_entity.Po ./$(DEPDIR)/camera.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/collision.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/command_node.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/data_tank.Po ./$(DEPDIR)/ini_parser.Po \
@@ -151,5 +153,5 @@
 	-o $@
 DIST_SOURCES = $(orxonox_SOURCES)
-DIST_COMMON = $(srcdir)/Makefile.in INSTALL Makefile.am
+DIST_COMMON = $(srcdir)/Makefile.in ChangeLog INSTALL Makefile.am
 SOURCES = $(orxonox_SOURCES)
 
@@ -197,4 +199,5 @@
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camera.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision.Po@am__quote@
Index: orxonox/trunk/src/base_entity.cc
===================================================================
--- orxonox/trunk/src/base_entity.cc	(revision 2551)
+++ orxonox/trunk/src/base_entity.cc	(revision 2551)
@@ -0,0 +1,32 @@
+
+
+/* 
+   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: ...
+*/
+
+
+#include "base_entity.h"
+
+
+using namespace std;
+
+
+
+BaseEntity::BaseEntity () {}
+
+
+
+BaseEntity::~BaseEntity () {}
+
+
Index: orxonox/trunk/src/base_entity.h
===================================================================
--- orxonox/trunk/src/base_entity.h	(revision 2551)
+++ orxonox/trunk/src/base_entity.h	(revision 2551)
@@ -0,0 +1,16 @@
+
+#ifndef BASE_ENTITY_H
+#define BASE_ENTITY_H
+
+#include "stdincl.h"
+
+
+class BaseEntity {
+
+ public:
+  BaseEntity ();
+  ~BaseEntity ();
+
+};
+
+#endif
Index: orxonox/trunk/src/camera.cc
===================================================================
--- orxonox/trunk/src/camera.cc	(revision 2191)
+++ orxonox/trunk/src/camera.cc	(revision 2551)
@@ -29,5 +29,20 @@
 Camera::Camera ()
 {
-	bound = NULL;
+  bound = NULL;
+  /* give it some physical live */
+  m = 10;
+  a = new Vector(0.0, 0.0, 0.0);
+  v = new Vector(0.0, 0.0, 0.0);
+  fs = new Vector(0.0, 0.0, 0.0);
+  cameraMode = NORMAL;
+
+  deltaTime = 3000.0;
+  cameraOffset = 1.0;
+  cameraOffsetZ = 10.0;
+  t = 0.0;
+
+  actual_place.r.x = 0.0;
+  actual_place.r.y = 10.0;
+  actual_place.r.z = -5.0;
 }
 
@@ -48,82 +63,193 @@
 void Camera::time_slice (Uint32 deltaT)
 {
-	update_desired_place ();
-	jump (NULL);
-}
-
-/**
-  \brief this calculates the location where the track wants the camera to be
-   
-	This refreshes the placement the camera should have according to the bound entity's position on the track.
+  if(t <= deltaTime)
+    {t += deltaT;}
+  //printf("time is: t=%f\n", t );
+  update_desired_place ();
+  jump (NULL);
+}
+
+/**
+   \brief this calculates the location where the track wants the camera to be
+   
+   This refreshes the placement the camera should have according to the 
+   bound entity's position on the track.
 */
 void Camera::update_desired_place ()
 {
-		Orxonox *orx = Orxonox::getInstance();
-		Location lookat;
+  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);
 		
-		if( bound != NULL)
-		{
-			bound->get_lookat (&lookat);
-			orx->get_world()->calc_camera_pos (&lookat, &desired_place);
-		}
-		else
-		{
-			desired_place.r = Vector (0,0,0);
-			desired_place.w = Quaternion (); 
-		}
-}
-
-/**
-  \brief initialize rendering perspective according to this camera
-   
-	This is called immediately before the a rendering cycle starts, it sets all global rendering options as
-	well as the GL_PROJECTION matrix according to the camera.
+		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.r = /*plFocus.r -*/ ursp - res->apply(r); 
+
+	    printf("desired place is: %f, %f, %f\n", desired_place.r.x, desired_place.r.y, desired_place.r.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->w.apply(vDirection);
+	    desired_place.r = (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->w.apply(vDirection);
+	    desired_place.r = plBound->r - vDirection*10 + eclipticOffset;
+	  }
+	break;
+      }
+      /* the camera is handled like an entity and rolls on the track */
+    case NORMAL:
+      Orxonox *orx = Orxonox::getInstance();
+      Location lookat;  
+      if( bound != NULL)
+	{
+	  bound->get_lookat (&lookat);
+	  orx->get_world()->calc_camera_pos (&lookat, &desired_place);
+	} 
+      else
+	{
+	  desired_place.r = Vector (0,0,0);
+	  desired_place.w = Quaternion (); 
+	}
+      break;
+    }
+}
+
+/**
+   \brief initialize rendering perspective according to this camera
+   
+   This is called immediately before the rendering cycle starts, it sets all global
+   rendering options as well as the GL_PROJECTION matrix according to the camera.
 */
 void Camera::apply ()
 {
-	glMatrixMode (GL_PROJECTION);
+  glMatrixMode (GL_PROJECTION);
   glLoadIdentity ();
-		// view
-		// 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();	
-
-  	// rotation
+  // view
+  // 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
   float matrix[4][4];
   actual_place.w.conjugate().matrix (matrix);
+  /* orientation and */
   glMultMatrixf ((float*)matrix);
-  	// translation
+  /*  translation */
   glTranslatef (-actual_place.r.x, -actual_place.r.y,- actual_place.r.z);
-  
+  //Placement *plBound = bound->get_placement();
+
+  // ===== second camera control calculation option
+  /*
+    gluLookAt(actual_place.r.x, actual_place.r.y, actual_place.r.z, 
+              plBound->r.x, plBound->r.y, plBound->r.z,
+              0.0, 0.0, 1.0);
+  */
+
   glMatrixMode (GL_MODELVIEW);
   glLoadIdentity ();
-  
-  printf("Camera@%f/%f/%f\n",actual_place.r.x,actual_place.r.y,actual_place.r.z);
-  Vector unique(1,0,0);
-  Vector test = actual_place.w.apply (unique);
-  printf("Camera&%f/%f/%f\n", test.x, test.y, test.z);
 }
 
@@ -136,13 +262,14 @@
 void Camera::jump (Placement* plc = NULL)
 {
-	if( plc == NULL)
-	{
-		actual_place = desired_place;
-	}
-	else
-	{
-		desired_place = *plc;
-		actual_place = *plc;
-	}
+  if( plc == NULL)
+    {
+      actual_place = desired_place;
+      //printf("Camera|jump: camer@ %f, %f, %f\n\n", actual_place.r.x, actual_place.r.y, actual_place.r.z);
+    }
+  else
+    {
+      desired_place = *plc;
+      actual_place = *plc;
+    }
 }
 
@@ -157,8 +284,11 @@
 void Camera::bind (WorldEntity* entity)
 {
-	if( entity != NULL)
+  if( entity != NULL)
+    {
+      if( entity->isFree ()) printf("Cannot bind camera to free entity");
+      else 
 	{
-		if( entity->isFree ()) printf("Cannot bind camera to free entity");
-		else bound = entity;
-	} 
-}
+	  bound = entity;
+	}
+    } 
+}
Index: orxonox/trunk/src/camera.h
===================================================================
--- orxonox/trunk/src/camera.h	(revision 2191)
+++ orxonox/trunk/src/camera.h	(revision 2551)
@@ -13,14 +13,42 @@
 //! Camera
 /**
- 	This class controls the viewpoint from which the World is rendered. To use the Camera it has
- 	to be bound to a WorldEntity which serves as the reference focus point. The Camera itself calls
- 	the WorldEntity::get_lookat() and World::calc_camera_pos() functions to calculate the position it
- 	currently should be in.
+ 	This class controls the viewpoint from which the World is rendered. To use the 
+	Camera it has to be bound to a WorldEntity which serves as the reference focus 
+	point. The Camera itself calls the WorldEntity::get_lookat() and 
+	World::calc_camera_pos() functions to calculate the position it currently should
+	be in.
 */
+
+enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL};
+
 class Camera {
  private:
- 	WorldEntity* bound;		//!< the WorldEntity the Camera is bound to
- 	Placement actual_place;	//!< the Camera's current position
- 	Placement desired_place; //!< where the Camera should be according to calculations
+  WorldEntity* bound;		//!< the WorldEntity the Camera is bound to
+  Placement actual_place;	        //!< the Camera's current position
+  Placement desired_place;        //!< where the Camera should be according to calculations
+  
+  /* physical system - not needed yet */
+  float m; //!< mass
+  Vector *fs; //!< seil-kraft
+  Vector *a;  //!< acceleration
+  Vector *v;  //!< velocity
+  
+  /* elliptical camera mode variables */
+  Placement plLastBPlace;
+  float cameraOffset;
+  float cameraOffsetZ;
+  float deltaTime;
+  float t;
+  Vector r;
+  float rAbs;
+  float ka;
+  float a0;
+
+  Quaternion *from;
+  Quaternion *to;
+  Quaternion *res;
+  
+
+  CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity
 
 	void update_desired_place ();
Index: orxonox/trunk/src/command_node.cc
===================================================================
--- orxonox/trunk/src/command_node.cc	(revision 2191)
+++ orxonox/trunk/src/command_node.cc	(revision 2551)
Index: orxonox/trunk/src/coordinates.h
===================================================================
--- orxonox/trunk/src/coordinates.h	(revision 2191)
+++ orxonox/trunk/src/coordinates.h	(revision 2551)
@@ -9,4 +9,6 @@
 #include "vector.h"
 
+class Track;
+
 //! Coordinates relative to track
 /**
@@ -16,7 +18,8 @@
 {
   unsigned long part;   //!< ID of the track part the object is on
+  Track* track;         //!< This is the current Track to which the Entity belongs to
   float dist;           //!< The distance that has already been traveled on the track
-  Vector pos;           //!< The position relative to the offset marked by the distance already covered
-  Quaternion rot;         //!< The direction the object is heading (relative to track direction)
+  Vector pos;           //!< The position relative to the offset marked by the distance already covered - this is mostly for user interaction/control
+  Quaternion rot;       //!< The direction the object is heading (relative to track direction)
 } Location;
 
@@ -28,5 +31,5 @@
 {
   Vector r;              //!< Absolute x/y/z coordinates
-  Quaternion w;            //!< Absolute orientation
+  Quaternion w;          //!< Absolute orientation
 } Placement;
 
Index: orxonox/trunk/src/error.h
===================================================================
--- orxonox/trunk/src/error.h	(revision 2551)
+++ orxonox/trunk/src/error.h	(revision 2551)
@@ -0,0 +1,26 @@
+
+
+/* 
+   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: Christian Meyer
+*/
+
+
+/*! 
+    \file error.h
+    \brief A compendium of Error codes used in the program
+*/ 
+
+
+#define ERROR -1
+#define NO_ERROR 0
Index: orxonox/trunk/src/ini_parser.cc
===================================================================
--- orxonox/trunk/src/ini_parser.cc	(revision 2191)
+++ orxonox/trunk/src/ini_parser.cc	(revision 2551)
@@ -63,33 +63,33 @@
 int IniParser::get_section( char* section)
 {
-	bInSection = false;
-	if( stream == NULL) return -1;
-	
-	char linebuffer[PARSELINELENGHT];
-	char secbuffer[PARSELINELENGHT];
-	char* ptr;
-	
-	rewind (stream);
-	while( !feof( stream))
+  bInSection = false;
+  if( stream == NULL) return -1;
+  
+  char linebuffer[PARSELINELENGHT];
+  char secbuffer[PARSELINELENGHT];
+  char* ptr;
+  
+  rewind (stream);
+  while( !feof( stream))
+    {
+      // get next line
+      fgets (linebuffer, PARSELINELENGHT, stream);
+      // remove newline char
+      if( (ptr = strchr( linebuffer, '\n')) != NULL) *ptr = 0;
+      // check for section identifyer
+      if( sscanf (linebuffer, "[%s", secbuffer) == 1)
 	{
-			// get next line
-		fgets (linebuffer, PARSELINELENGHT, stream);
-			// remove newline char
-		if( (ptr = strchr( linebuffer, '\n')) != NULL) *ptr = 0;
-			// check for section identifyer
-		if( sscanf (linebuffer, "[%s", secbuffer) == 1)
+	  if( (ptr = strchr( secbuffer, ']')) != NULL)
+	    {
+	      *ptr = 0;
+	      if( !strcmp( secbuffer, section))
 		{
-			if( (ptr = strchr( secbuffer, ']')) != NULL)
-			{
-				*ptr = 0;
-				if( !strcmp( secbuffer, section))
-				{
-					bInSection = true;
-					return 0;
-				}
-			}
+		  bInSection = true;
+		  return 0;
 		}
+	    }
 	}
-	return -1;
+    }
+  return -1;
 }
 
Index: orxonox/trunk/src/keynames.cc
===================================================================
--- orxonox/trunk/src/keynames.cc	(revision 2191)
+++ orxonox/trunk/src/keynames.cc	(revision 2551)
Index: orxonox/trunk/src/keynames.h
===================================================================
--- orxonox/trunk/src/keynames.h	(revision 2191)
+++ orxonox/trunk/src/keynames.h	(revision 2551)
Index: orxonox/trunk/src/message_structures.h
===================================================================
--- orxonox/trunk/src/message_structures.h	(revision 2191)
+++ orxonox/trunk/src/message_structures.h	(revision 2551)
Index: orxonox/trunk/src/orxonox.cc
===================================================================
--- orxonox/trunk/src/orxonox.cc	(revision 2191)
+++ orxonox/trunk/src/orxonox.cc	(revision 2551)
@@ -230,22 +230,26 @@
 void Orxonox::mainLoop()
 {
-	lastframe = SDL_GetTicks();
-	bQuitOrxonox = false;
+  lastframe = SDL_GetTicks();
+  bQuitOrxonox = false;
   // This is where everything is run
-printf("Orxonox|Entering main loop\n");
+  printf("Orxonox|Entering main loop\n");
   while( !bQuitOrxonox)
-  {
-  	// Network
-  	synchronize();
-    // Process input
-    handle_input();
-    // Process time
-    time_slice();
-    // Process collision
-    collision();
-    // Draw
-    display();
-  }
-printf("Orxonox|Exiting the main loop\n");
+    {
+      printf("<==");
+
+      // Network
+      synchronize();
+      // Process input
+      handle_input();
+      // Process time
+      time_slice();
+      // Process collision
+      collision();
+      // Draw
+      display();
+
+      printf(">\n");
+    }
+  printf("Orxonox|Exiting the main loop\n");
 }
 
@@ -283,12 +287,20 @@
 void Orxonox::time_slice ()
 {
-	Uint32 curframe = SDL_GetTicks();
-	if( !pause)
+  Uint32 curframe = SDL_GetTicks();
+  if( !pause)
+    {
+      Uint32 dt = curframe - lastframe;
+      
+      if(dt > 0)
 	{
-		world->time_slice (curframe - lastframe);
-		world->update ();
-		localcamera->time_slice (curframe - lastframe);
+	  float fps = 1000/dt;
+	  printf("%f", fps);
 	}
-	lastframe = curframe;
+      
+      world->time_slice (dt);
+      world->update ();
+      localcamera->time_slice (dt);
+    }
+  lastframe = curframe;
 }
 
Index: orxonox/trunk/src/player.cc
===================================================================
--- orxonox/trunk/src/player.cc	(revision 2191)
+++ orxonox/trunk/src/player.cc	(revision 2551)
@@ -28,4 +28,5 @@
 
 Player::~Player () 
+
 {
 }
@@ -33,5 +34,5 @@
 void Player::post_spawn ()
 {
-	travel_speed = 10.0;
+	travel_speed = 15.0;
 	velocity = Vector();
 	bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
@@ -71,22 +72,32 @@
 void Player::draw ()
 {
-	glMatrixMode(GL_MODELVIEW);
-	glLoadIdentity();
-	float matrix[4][4];
-
-	glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  float matrix[4][4];
+  
+  glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z);
   get_placement()->w.matrix (matrix);
   glMultMatrixf ((float*)matrix);
-	
-	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();
-	
-	printf("Player@%f/%f/%f\n", get_placement()->r.x, get_placement()->r.y, get_placement()->r.z);
+  
+  glBegin(GL_TRIANGLES);
+  glColor3f(1,1,1);
+  glVertex3f(0,0,0.5);
+  glVertex3f(-0.5,0,-1);
+  glVertex3f(0.5,0,-1);
+
+  glVertex3f(0,0,0.5);
+  glVertex3f(0,0.5,-1);
+  glVertex3f(0,-0.5,-1);
+  glEnd();
+    
+  glBegin(GL_QUADS);
+  glColor3f(0,0,1);
+  glVertex3f(0.5,0.5,-1);
+  glVertex3f(0.5,-0.5,-1);
+  glVertex3f(-0.5,-0.5,-1);
+  glVertex3f(-0.5,0.5,-1);
+  glEnd();
+  
+  //printf("Player@%f/%f/%f\n", get_placement()->r.x, get_placement()->r.y, get_placement()->r.z);
 }
 
@@ -103,27 +114,32 @@
 void Player::move (float time)
 {
-	float xAccel, yAccel, zAccel;
-	xAccel = yAccel = zAccel = 0;
-	if( bUp) xAccel += acceleration;
-	if( bDown) xAccel -= acceleration;
-	if( bLeft) yAccel += acceleration;
-	if( bRight) yAccel -= acceleration;
-	if( bAscend) zAccel += acceleration;
-	if( bDescend) zAccel -= acceleration;
-	
-	Vector accel( xAccel, yAccel, zAccel);
-	
-	Location* l = get_location();
-	
-	// r(t) = r(0) + v(0)*t + 1/2*a*t^2
-	// r = position
-	// v = velocity
-	// a = acceleration
-	
-	l->pos = l->pos + velocity*time + (accel*(0.5*time*time));
-	l->dist += travel_speed * time;
-	
-	velocity = velocity + (accel * time);
-	printf("Player|velocity %f/%f/%f\n", velocity.x, velocity.y, velocity.z);
+  Vector accel(0.0, 0.0, 0.0);
+  /* FIXME: calculating the direction and orthDirection every time_slice is redundant! save it somewhere */
+  Placement *pos = get_placement();
+  /* calculate the direction in which the craft is heading  */
+  Vector direction(0.0, 0.0, 1.0);
+  direction = pos->w.apply(direction);
+  Vector orthDirection(0.0, 0.0, 1.0);
+  orthDirection = orthDirection.cross(direction);
+
+  if( bUp) { accel = accel+(direction*acceleration); }
+  if( bDown) { accel = accel-(direction*acceleration); }
+  if( bLeft ) { accel = accel + (orthDirection*acceleration); }
+  if( bRight ) { accel = accel - (orthDirection*acceleration); }
+  if( bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */}
+  if( bDescend) {/* FIXME */}
+
+  Location* l = get_location();
+  
+  // r(t) = r(0) + v(0)*t + 1/2*a*t^2
+  // r = position
+  // v = velocity
+  // a = acceleration
+
+  /* this the base-speed of the player: determines how fast and how the player follows the track*/
+  l->dist = l->dist + travel_speed * time;
+
+  /* this updates the player position on the track - user interaction */
+  l->pos = l->pos + accel*time;
 }
 
Index: orxonox/trunk/src/player.h
===================================================================
--- orxonox/trunk/src/player.h	(revision 2191)
+++ orxonox/trunk/src/player.h	(revision 2551)
@@ -12,31 +12,31 @@
 class Player : public WorldEntity 
 {
-	friend class World;
-
+  friend class World;
+  
  public:
   Player (bool isFree = false);
   ~Player ();
-
-	virtual void post_spawn ();
+  
+  virtual void post_spawn ();
   virtual void tick (float time);
   virtual void hit (WorldEntity* weapon, Vector loc);
   virtual void destroy ();
   virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
- 	virtual void command (Command* cmd);
+  virtual void command (Command* cmd);
   
   virtual void draw ();
   virtual void get_lookat (Location* locbuf);
-
-	virtual void left_world ();
-
+  
+  virtual void left_world ();
+  
  private:
- 	bool bUp, bDown, bLeft, bRight, bAscend, bDescend;
- 	bool bFire;
- 	Vector velocity;
- 	float travel_speed;
- 	float acceleration;
- 	
- 	void move (float time);
- 	
+  bool bUp, bDown, bLeft, bRight, bAscend, bDescend;
+  bool bFire;
+  Vector velocity;
+  float travel_speed;
+  float acceleration;
+  
+  void move (float time);
+  
 };
 
Index: orxonox/trunk/src/stdincl.h
===================================================================
--- orxonox/trunk/src/stdincl.h	(revision 2191)
+++ orxonox/trunk/src/stdincl.h	(revision 2551)
@@ -10,4 +10,5 @@
 #include <SDL/SDL.h>
 #include <GL/gl.h>
+#include <GL/glu.h>
 
 #include "vector.h"
Index: orxonox/trunk/src/track.cc
===================================================================
--- orxonox/trunk/src/track.cc	(revision 2191)
+++ orxonox/trunk/src/track.cc	(revision 2551)
@@ -54,32 +54,46 @@
 
 /**
-	\brief calculate a camera Placement from a "look at"-Location
-	\param lookat: the Location the camera should be centered on
-	\param camplc: pointer to a buffer where the new camera Placement should be put into
-	
-	Theoretically you can place the camera wherever you want, but for the sake of common sense I suggest that you at least
-	try to keep the thing that should be looked at inside camera boundaries.
+   \brief calculate a camera Placement from a "look at"-Location
+   \param lookat: the Location the camera should be centered on
+   \param camplc: pointer to a buffer where the new camera Placement should be put into
+   
+   Theoretically you can place the camera wherever you want, but for the sake of 
+   common sense I suggest that you at least try to keep the thing that should be looked
+   at inside camera boundaries.
 */
 void Track::map_camera (Location* lookat, Placement* camplc)
 {
-	Line trace(*offset, *end - *offset);
-	float l = trace.len ();
-	
-//	camplc->r = *offset + Vector(0,0,0.5);
-//	camplc->w = Quaternion (trace.a, Vector(0,0,1));
-	float r = (lookat->dist)*PI / l;
-	camplc->r = trace.r + (trace.a * ((lookat->dist-10.0) / l)) + Vector(0,0,5.0);
-	camplc->w = Quaternion(Vector(0,0,0) - ((trace.r + (trace.a * ((lookat->dist) / l)) - camplc->r)), Vector(0,sin(r),cos(r)));
-	
+  Line trace(*offset, *end - *offset);
+  float l = trace.len ();
+  
+  //	camplc->r = *offset + Vector(0,0,0.5);
+  //	camplc->w = Quaternion (trace.a, Vector(0,0,1));
+  float r = (lookat->dist)*PI / l;
+  camplc->r = trace.r + (trace.a * ((lookat->dist-10.0) / l)) + Vector(0,0,5.0);
+  
+  Vector w(0.0,0.0,0.0);
+  w=Vector(0,0,0) - ((trace.r + (trace.a * ((lookat->dist) / l)) - camplc->r));
+  //Vector up(0.0,sin(r),cos(r)); // corrupt...
+  Vector up(0.0, 0.0, 1.0);
+
+  camplc->w = Quaternion(w, up);
+
+  //printf("\n------\nup vector: [%f, %f, %f]\n", up.x, up.y, up.z);
+  //printf("direction: [%f, %f, %f]\n", w.x, w.y, w.z);
+  //printf("quaternion: w[ %f ], v[ %f, %f, %f ]\n", camplc->w.w, camplc->w.v.x, camplc->w.v.y, camplc->w.v.z);
 }
 
 /**
-	\brief calculate a Placement from a given Location
-	\param loc: the Location the entity is in
-	\param plc: a pointer to a buffer where the corresponding Placement should be put into
-	
-	There are no limitations to how you transform a Location into a Placement, but for the sake of placement compatibility between
-	track parts you should make sure that the resulting Placement at dist == 0 is equal to the offset Vector and the Placement at
-	dist == len() is equal to the end Vector. Elseway there will be ugly artifacts when transfering between track parts.
+   \brief calculate a Placement from a given Location
+   \param loc: the Location the entity is in
+   \param plc: a pointer to a buffer where the corresponding Placement should be put
+   into
+   \return: true if track changes - false if track stays
+   
+   There are no limitations to how you transform a Location into a Placement, but for 
+   the sake of placement compatibility between track parts you should make sure that 
+   the resulting Placement at dist == 0 is equal to the offset Vector and the Placement
+   at dist == len() is equal to the end Vector. Elseway there will be ugly artifacts 
+   when transfering between track parts.
 */
 bool Track::map_coords (Location* loc, Placement* plc)
@@ -88,13 +102,17 @@
 	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;
 	}
 	
-	Quaternion dir(trace.a, Vector(0,0,1));
-	
+	/* this quaternion represents the rotation from start-vector (0,0,1) to the direction of
+	 * the track */
+	Quaternion dir(trace.a, Vector(0,0,1)); 
+
 	plc->r = trace.r + (trace.a * ((loc->dist) / l)) + /*dir.apply*/(loc->pos);
 	plc->w = dir * loc->rot;
@@ -107,5 +125,6 @@
 	\param entity: pointer to the WorldEntity in question
 	
-	You can do stuff like add or remove effects, do some coordinate finetuning or whatever in here.
+	You can do stuff like add or remove effects, do some coordinate finetuning 
+	or whatever in here.
 */
 void Track::post_enter (WorldEntity* entity)
@@ -117,5 +136,6 @@
 	\param entity: pointer to the WorldEntity in question
 	
-	You can do stuff like add or remove effects, do some coordinate finetuning or whatever in here.
+	You can do stuff like add or remove effects, do some coordinate finetuning 
+	or whatever in here.
 */
 void Track::post_leave (WorldEntity* entity)
Index: orxonox/trunk/src/track.h
===================================================================
--- orxonox/trunk/src/track.h	(revision 2191)
+++ orxonox/trunk/src/track.h	(revision 2551)
@@ -11,14 +11,18 @@
 //!	The Red Line through a level
 /**
-	Handles level boundaries, bound movement mapping, camera placement and scripting.
-	To create special levels with special camera movement, rules or whatever, derive from this base class.
+   Handles level boundaries, bound movement mapping, camera placement and scripting.
+   To create special levels with special camera movement, rules or whatever, derive from this base class.
 */
 class Track 
 {
  private:
- 	Uint32 ID;
- 	Vector* offset;
- 	Vector* end;
- 	Uint32 nextID;
+  Uint32 ID;
+  Vector* offset;
+  Vector* end;
+  // 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?
+  //Vector* traverse; // right-left 
+  Uint32 nextID;
+  
  	
  public:
Index: orxonox/trunk/src/vector.cc
===================================================================
--- orxonox/trunk/src/vector.cc	(revision 2191)
+++ orxonox/trunk/src/vector.cc	(revision 2551)
@@ -12,6 +12,7 @@
 
    ### File Specific:
-   main-programmer: Christian Meyer
-   co-programmer: ...
+   main-programmer: Christian Meyer 
+   co-programmer: Patrick Boenzli : Vector::scale()
+                                    Vector::abs()
    
    Quaternion code borrowed from an Gamasutra article by Nick Bobick and Ken Shoemake
@@ -147,4 +148,34 @@
   z = z / l;
 }
+
+
+/**
+   \bref returns the voctor normalized to length 1.0
+*/
+
+Vector* Vector::getNormalized()
+{
+  float l = len();
+  if(l != 1.0)
+    {
+      return this;
+    }
+  else if(l == 0.0)
+    {
+      return 0;
+    }
+  
+  Vector *normalizedVector = new Vector(x / l, y /l, z / l);
+  return normalizedVector;
+}
+
+
+void Vector::scale(const Vector& v)
+{
+  x *= v.x;
+  y *= v.y;
+  z *= v.z;
+}
+
  
 /**
@@ -156,4 +187,13 @@
   return sqrt (x*x+y*y+z*z);
 }
+
+
+
+Vector Vector::abs() 
+{
+  Vector v(fabs(x), fabs(y), fabs(z));
+  return v;
+}
+
 
 /**
@@ -168,4 +208,5 @@
 }
 
+
 /**
    \brief calculate the angle between two vectors in degrees
@@ -202,16 +243,18 @@
 
 /**
-	\brief calculates a look_at rotation
-	\param dir: the direction you want to look
-	\param up: specify what direction up should be
-	
-	Mathematically this determines the rotation a (0,0,1)-Vector has to undergo to point the same way as dir.
-	If you want to use this with cameras, you'll have to reverse the dir Vector (Vector(0,0,0) - your viewing direction)
-	or you'll point the wrong way. You can use this for meshes as well (then you do not have to reverse the vector), but keep in mind that if you do that, the model's front
-	has to point in +z direction, and left and right should be -x or +x respectively or the mesh wont rotate correctly.
+   \brief calculates a look_at rotation
+   \param dir: the direction you want to look
+   \param up: specify what direction up should be
+   
+   Mathematically this determines the rotation a (0,0,1)-Vector has to undergo to point
+   the same way as dir. If you want to use this with cameras, you'll have to reverse the
+   dir Vector (Vector(0,0,0) - your viewing direction) or you'll point the wrong way. You
+   can use this for meshes as well (then you do not have to reverse the vector), but keep 
+   in mind that if you do that, the model's front has to point in +z direction, and left 
+   and right should be -x or +x respectively or the mesh wont rotate correctly.
 */
 Quaternion::Quaternion (const Vector& dir, const Vector& up)
 {
-	Vector z = dir;
+  Vector z = dir;
   z.normalize(); 
   Vector x = up.cross(z);
@@ -246,6 +289,6 @@
 	\param yaw: the yaw in radians
 	
-	I DO HONESTLY NOT EXACTLY KNOW WHICH ANGLE REPRESENTS WHICH ROTATION. And I do not know in what order they are applied,
-	I just copy-pasted the code.
+	I DO HONESTLY NOT EXACTLY KNOW WHICH ANGLE REPRESENTS WHICH ROTATION. And I do not know 
+	in what order they are applied,	I just copy-pasted the code.
 */
 Quaternion::Quaternion (float roll, float pitch, float yaw)
@@ -407,30 +450,76 @@
 void Quaternion::matrix (float m[4][4]) const
 {
-	float wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2; 
-
-	// calculate coefficients
-	x2 = v.x + v.x;
+  float wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2; 
+  
+  // calculate coefficients
+  x2 = v.x + v.x;
   y2 = v.y + v.y; 
-	z2 = v.z + v.z;
-	xx = v.x * x2; xy = v.x * y2; xz = v.x * z2;
-	yy = v.y * y2; yz = v.y * z2; zz = v.z * z2;
-	wx = w * x2; wy = w * y2; wz = w * z2;
-	
-	m[0][0] = 1.0 - (yy + zz); m[1][0] = xy - wz;
-	m[2][0] = xz + wy; m[3][0] = 0.0;
-	
-	m[0][1] = xy + wz; m[1][1] = 1.0 - (xx + zz);
-	m[2][1] = yz - wx; m[3][1] = 0.0;
-	
-	m[0][2] = xz - wy; m[1][2] = yz + wx;
-	m[2][2] = 1.0 - (xx + yy); m[3][2] = 0.0;
-	
-	m[0][3] = 0; m[1][3] = 0;
-	m[2][3] = 0; m[3][3] = 1;
-}
-
-/**
-	\brief convert a rotational 4x4 glMatrix into a Quaternion
-	\param m: a 4x4 matrix in glMatrix order
+  z2 = v.z + v.z;
+  xx = v.x * x2; xy = v.x * y2; xz = v.x * z2;
+  yy = v.y * y2; yz = v.y * z2; zz = v.z * z2;
+  wx = w * x2; wy = w * y2; wz = w * z2;
+  
+  m[0][0] = 1.0 - (yy + zz); m[1][0] = xy - wz;
+  m[2][0] = xz + wy; m[3][0] = 0.0;
+	
+  m[0][1] = xy + wz; m[1][1] = 1.0 - (xx + zz);
+  m[2][1] = yz - wx; m[3][1] = 0.0;
+  
+  m[0][2] = xz - wy; m[1][2] = yz + wx;
+  m[2][2] = 1.0 - (xx + yy); m[3][2] = 0.0;
+  
+  m[0][3] = 0; m[1][3] = 0;
+  m[2][3] = 0; m[3][3] = 1;
+}
+
+
+void Quaternion::quatSlerp(const Quaternion* from, const Quaternion* to, float t, Quaternion* res)
+{
+  float tol[4];
+  double omega, cosom, sinom, scale0, scale1;
+  DELTA = 0.2;
+
+  cosom = from->v.x * to->v.x + from->v.y * to->v.y + from->v.z * to->v.z + from->w * to->w;
+
+  if( cosom < 0.0 ) 
+    { 
+      cosom = -cosom; 
+      tol[0] = -to->v.x;
+      tol[1] = -to->v.y;
+      tol[2] = -to->v.z;
+      tol[3] = -to->w;
+    }
+  else
+    {
+      tol[0] = to->v.x;
+      tol[1] = to->v.y;
+      tol[2] = to->v.z;
+      tol[3] = to->w;
+    }
+  
+  //if( (1.0 - cosom) > DELTA )
+  //{
+      omega = acos(cosom);
+      sinom = sin(omega);
+      scale0 = sin((1.0 - t) * omega) / sinom;
+      scale1 = sin(t * omega) / sinom;
+      //}
+      /*
+  else
+    {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+      */
+  res->v.x = scale0 * from->v.x + scale1 * tol[0];
+  res->v.y = scale0 * from->v.y + scale1 * tol[1];
+  res->v.z = scale0 * from->v.z + scale1 * tol[2];
+  res->w = scale0 * from->w + scale1 * tol[3];
+}
+
+
+/**
+   \brief convert a rotational 4x4 glMatrix into a Quaternion
+   \param m: a 4x4 matrix in glMatrix order
 */
 Quaternion::Quaternion (float m[4][4])
Index: orxonox/trunk/src/vector.h
===================================================================
--- orxonox/trunk/src/vector.h	(revision 2191)
+++ orxonox/trunk/src/vector.h	(revision 2551)
@@ -33,6 +33,9 @@
   float dot (const Vector& v) const;
   Vector cross (const Vector& v) const;
+  void scale(const Vector& v);
   float len() const;
   void normalize();
+  Vector* getNormalized();
+  Vector abs();
 };
 
@@ -66,4 +69,9 @@
 	float norm () const;
 	void matrix (float m[4][4]) const;
+	void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
+
+ private:
+	float DELTA;
+
 };
 
Index: orxonox/trunk/src/world.cc
===================================================================
--- orxonox/trunk/src/world.cc	(revision 2191)
+++ orxonox/trunk/src/world.cc	(revision 2551)
@@ -27,251 +27,267 @@
 
 /** 
-   \brief create a new World
-   
-   This creates a new empty world!
+    \brief create a new World
+    
+    This creates a new empty world!
 */
 World::World ()
 {
-	entities = new List<WorldEntity>();
-}
-
-/** 
-   \brief remove the World from memory
+  entities = new List<WorldEntity>();
+}
+
+/** 
+    \brief remove the World from memory
 */
 World::~World ()
 {
-	unload ();
-	delete entities;
-}
-
-/** 
-   \brief checks for collisions
-   
-   This method runs through all WorldEntities known to the world and checks for collisions between them.
-   In case of collisions the collide() method of the corresponding entities is called.
+  unload ();
+  delete entities;
+}
+
+/** 
+    \brief checks for collisions
+    
+    This method runs through all WorldEntities known to the world and checks for collisions 
+    between them. In case of collisions the collide() method of the corresponding entities 
+    is called.
 */
 void World::collide ()
 {
-	List<WorldEntity> *a, *b;
-	WorldEntity *aobj, *bobj;
-	
-	a = entities->get_next();
-	
-	while( a != NULL)
-	{
-		aobj = a->get_object();
-		if( aobj->bCollide && aobj->collisioncluster != NULL)
+  List<WorldEntity> *a, *b;
+  WorldEntity *aobj, *bobj;
+  
+  a = entities->get_next();
+  
+  while( a != NULL)
+    {
+      aobj = a->get_object();
+      if( aobj->bCollide && aobj->collisioncluster != NULL)
+	{
+	  b = a->get_next();
+	  while( b != NULL )
+	    {
+	      bobj = b->get_object();
+	      if( bobj->bCollide && bobj->collisioncluster != NULL )
 		{
-			b = a->get_next();
-			while( b != NULL)
-			{
-				bobj = b->get_object();
-				if( bobj->bCollide && bobj->collisioncluster != NULL)
-				{
-					unsigned long ahitflg, bhitflg;
-					if( check_collision ( &aobj->place, aobj->collisioncluster, &ahitflg, &bobj->place, bobj->collisioncluster, &bhitflg));
-					{
-						aobj->collide (bobj, ahitflg, bhitflg);
-						bobj->collide (aobj, bhitflg, ahitflg);
-					}
-				}
-				b = b->get_next();
-			}
+		  unsigned long ahitflg, bhitflg;
+		  if( check_collision ( &aobj->place, aobj->collisioncluster, 
+					&ahitflg, &bobj->place, bobj->collisioncluster, 
+					&bhitflg) );
+		  {
+		    aobj->collide (bobj, ahitflg, bhitflg);
+		    bobj->collide (aobj, bhitflg, ahitflg);
+		  }
 		}
-		a = a->get_next();
-	}
-}
-
-/** 
-   \brief runs through all entities calling their draw() methods
+	      b = b->get_next();
+	    }
+	}
+      a = a->get_next();
+    }
+}
+
+/** 
+    \brief runs through all entities calling their draw() methods
 */
 void World::draw ()
 {
-	// draw geometry
-	
-	// draw entities
-	List<WorldEntity> *l;
-	WorldEntity* entity;
-	
-	l = entities->get_next();  
-	while( l != NULL) 
-	{ 
-		entity = l->get_object();
-	 	if(	entity->bDraw) entity->draw();
-	  l = l->get_next();
-	}
-	
-	// draw debug coord system
-	glLoadIdentity();
-	glBegin(GL_LINES);
-	for( float x = -128.0; x < 128.0; x += 25.0)
-	{
-		for( float y = -128.0; y < 128.0; y += 25.0)
+  // draw geometry
+  
+  // draw entities
+  List<WorldEntity> *l;
+  WorldEntity* entity;
+  
+  l = entities->get_next();  
+  while( l != NULL ) 
+    { 
+      entity = l->get_object();
+      if( entity->bDraw ) entity->draw();
+      l = l->get_next();
+    }
+  
+  
+  // draw debug coord system
+  glLoadIdentity();
+  
+
+  glBegin(GL_LINES);
+  
+  for( float x = -128.0; x < 128.0; x += 25.0)
+    {
+      for( float y = -128.0; y < 128.0; y += 25.0)
+	{
+	  glColor3f(1,0,0);
+	  glVertex3f(x,y,-128.0);
+	  glVertex3f(x,y,0.0);
+	  glColor3f(0.5,0,0);
+	  glVertex3f(x,y,0.0);
+	  glVertex3f(x,y,128.0);
+	}
+    }
+  for( float y = -128.0; y < 128.0; y += 25.0)
+    {
+      for( float z = -128.0; z < 128.0; z += 25.0)
+	{
+	  glColor3f(0,1,0);
+	  glVertex3f(-128.0,y,z);
+	  glVertex3f(0.0,y,z);
+	  glColor3f(0,0.5,0);
+	  glVertex3f(0.0,y,z);
+	  glVertex3f(128.0,y,z);
+	}
+    }
+  for( float x = -128.0; x < 128.0; x += 25.0)
+    {
+      for( float z = -128.0; z < 128.0; z += 25.0)
+	{
+	  glColor3f(0,0,1);
+	  glVertex3f(x,-128.0,z);
+	  glVertex3f(x,0.0,z);
+	  glColor3f(0,0,0.5);
+	  glVertex3f(x,0.0,z);
+	  glVertex3f(x,128.0,z);
+	}
+      
+    }
+  
+  //draw track
+  glColor3f(0,1,1);
+  for( int i = 0; i < tracklen; i++)
+    {
+      glVertex3f(pathnodes[i].x,pathnodes[i].y,pathnodes[i].z);
+      glVertex3f(pathnodes[(i+1)%tracklen].x,pathnodes[(i+1)%tracklen].y,pathnodes[(i+1)%tracklen].z);
+    }
+  glEnd();
+}
+
+/** 
+    \brief updates Placements and notifies entities when they left the 
+    world
+    
+    This runs trough all WorldEntities and maps Locations to Placements 
+    if they are bound, checks whether they left the level boundaries 
+    and calls appropriate functions.
+*/
+void World::update ()
+{
+  List<WorldEntity> *l;
+  WorldEntity* entity;
+  Location* loc;
+  Placement* plc;
+  Uint32 t;
+  
+  l = entities->get_next();  
+  while( l != NULL ) 
+    { 
+      entity = l->get_object();
+      
+      if( !entity->isFree() )
+	{
+	  loc = entity->get_location();
+	  plc = entity->get_placement();
+	  t = loc->part;
+	  
+	  /* check if entity has still a legal track-id */
+	  if( t >= tracklen )
+	    {
+	      printf("An entity is out of the game area\n");
+	      entity->left_world ();
+	    }
+	  else
+	    {
+	      while( track[t].map_coords( loc, plc) )
 		{
-			glColor3f(1,0,0);
-			glVertex3f(x,y,-128.0);
-			glVertex3f(x,y,0.0);
-			glColor3f(0.5,0,0);
-			glVertex3f(x,y,0.0);
-			glVertex3f(x,y,128.0);
+		  track[t].post_leave (entity);
+		  if( loc->part >= tracklen )
+		    {
+		      printf("An entity has left the game area\n");
+		      entity->left_world ();
+		      break;
+		    }
+		  track[loc->part].post_enter (entity);
 		}
-	}
-	for( float y = -128.0; y < 128.0; y += 25.0)
-	{
-		for( float z = -128.0; z < 128.0; z += 25.0)
-		{
-			glColor3f(0,1,0);
-			glVertex3f(-128.0,y,z);
-			glVertex3f(0.0,y,z);
-			glColor3f(0,0.5,0);
-			glVertex3f(0.0,y,z);
-			glVertex3f(128.0,y,z);
-		}
-	}
-	for( float x = -128.0; x < 128.0; x += 25.0)
-	{
-		for( float z = -128.0; z < 128.0; z += 25.0)
-		{
-			glColor3f(0,0,1);
-			glVertex3f(x,-128.0,z);
-			glVertex3f(x,0.0,z);
-			glColor3f(0,0,0.5);
-			glVertex3f(x,0.0,z);
-			glVertex3f(x,128.0,z);
-		}
-	}
-	//draw track
-	glColor3f(0,1,1);
-	for( int i = 0; i < tracklen; i++)
-	{
-		glVertex3f(pathnodes[i].x,pathnodes[i].y,pathnodes[i].z);
-		glVertex3f(pathnodes[(i+1)%tracklen].x,pathnodes[(i+1)%tracklen].y,pathnodes[(i+1)%tracklen].z);
-	}
-	glEnd();
-}
-
-/** 
-   \brief updates Placements and notifies entities when they left the world
-   
-   This runs trough all WorldEntities and maps Locations to Placements if they are bound, checks
-   whether they left the level boundaries and calls appropriate functions.
-*/
-void World::update ()
-{
-	List<WorldEntity> *l;
-	WorldEntity* entity;
-	Location* loc;
-	Placement* plc;
-	Uint32 t;
-	
-	l = entities->get_next();  
-	while( l != NULL) 
-	{ 
-		entity = l->get_object();
-		
-		if( !entity->isFree())
-		{
-		 	loc = entity->get_location();
-		 	plc = entity->get_placement();
-		 	t = loc->part;
-		 	
-		 	if( t >= tracklen)
-		 	{
-		 		printf("An entity is out of the game area\n");
-				entity->left_world ();
-		 	}
-		 	else
-		 	{
-		 		while( track[t].map_coords( loc, plc))
-		 		{
-		 			track[t].post_leave (entity);
-		 			if( loc->part >= tracklen)
-		 			{
-		 				printf("An entity has left the game area\n");
-		 				entity->left_world ();
-		 				break;
-		 			}
-		 			track[loc->part].post_enter (entity);
-		 		}
-		 	}
-		}
-		else
-		{
-			// TO DO: implement check whether this particular free entity is out of the game area
-			// TO DO: call function to notify the entity that it left the game area
-		}
-	 	
-	  l = l->get_next();
-	}
-	
-}
-
-/** 
-  \brief relays the passed time since the last frame to entities and Track parts
-	\param deltaT: the time passed since the last frame in milliseconds
+	    }
+	}
+      else
+	{
+	  /* TO DO: implement check whether this particular free entity 
+	     is out of the game area
+	     TO DO: call function to notify the entity that it left 
+	     the game area
+	  */
+	}
+      
+      l = l->get_next();
+    }
+  
+}
+
+/** 
+    \brief relays the passed time since the last frame to entities and Track parts
+    \param deltaT: the time passed since the last frame in milliseconds
 */
 void World::time_slice (Uint32 deltaT)
 {
-	List<WorldEntity> *l;
-	WorldEntity* entity;
-	float seconds = deltaT;
-	
-	seconds /= 1000;
-	
-	l = entities->get_next();  
-	while( l != NULL) 
-	{ 
-		entity = l->get_object();
-	 	entity->tick (seconds);
-	  l = l->get_next();
-	}
-	
-	for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
+  List<WorldEntity> *l;
+  WorldEntity* entity;
+  float seconds = deltaT;
+  
+  seconds /= 1000;
+  
+  l = entities->get_next();  
+  while( l != NULL) 
+    { 
+      entity = l->get_object();
+      entity->tick (seconds);
+      l = l->get_next();
+    }
+  
+  for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
 }
 
 /**
-	\brief removes level data from memory
+   \brief removes level data from memory
 */
 void World::unload()
 {
-	if( pathnodes) delete []pathnodes;
-	if( track) delete []pathnodes;
+  if( pathnodes) delete []pathnodes;
+  if( track) delete []pathnodes;
 }
 
 /**
-	\brief loads a simple level for testing purposes
+   \brief loads a simple level for testing purposes
 */
 void World::load_debug_level()
 {
-	// create some path nodes
-	pathnodes = new Vector[6];
-	pathnodes[0] = Vector(0, 0, 0);
-	pathnodes[1] = Vector(-100, 40, 0);
-	pathnodes[2] = Vector(-100, 140, 0);
-	pathnodes[3] = Vector(0, 180, 0);
-	pathnodes[4] = Vector(100, 140, 0);
-	pathnodes[5] = Vector(100, 40, 0);	
-	
-	// create the tracks
-	tracklen = 6;
-	track = new Track[6];
-	for( int i = 0; i < tracklen; i++)
-	{
-		track[i] = Track( i, (i+1)%tracklen, &pathnodes[i], &pathnodes[(i+1)%tracklen]);
-	}
-	
-	// create a player
-	WorldEntity* myPlayer = (WorldEntity*) spawn<Player>();
-	
-	// bind input
+  // create some path nodes
+  pathnodes = new Vector[6];
+  pathnodes[0] = Vector(0, 0, 0);
+  pathnodes[1] = Vector(-100, 40, 0);
+  pathnodes[2] = Vector(-100, 140, 0);
+  pathnodes[3] = Vector(0, 180, 0);
+  pathnodes[4] = Vector(100, 140, 0);
+  pathnodes[5] = Vector(100, 40, 0);	
+  
+  // create the tracks
+  tracklen = 6;
+  track = new Track[6];
+  for( int i = 0; i < tracklen; i++)
+    {
+      track[i] = Track( i, (i+1)%tracklen, &pathnodes[i], &pathnodes[(i+1)%tracklen]);
+    }
+  
+  // create a player
+  WorldEntity* myPlayer = (WorldEntity*) spawn<Player>();
+  
+  // bind input
   Orxonox *orx = Orxonox::getInstance();
   orx->get_localinput()->bind (myPlayer);
   
-	// bind camera
-	orx->get_camera()->bind (myPlayer);
+  // bind camera
+  orx->get_camera()->bind (myPlayer);
 }
 
 /**
-	\brief calls the correct mapping function to convert a given "look at"-Location to a Camera Placement
+   \brief calls the correct mapping function to convert a given "look at"-Location to a 
+   Camera Placement
 */
 void World::calc_camera_pos (Location* loc, Placement* plc)
Index: orxonox/trunk/src/world.h
===================================================================
--- orxonox/trunk/src/world.h	(revision 2191)
+++ orxonox/trunk/src/world.h	(revision 2551)
@@ -40,5 +40,5 @@
 		// base level data
 	Track* track;
-	Uint32 tracklen;
+	Uint32 tracklen;   // number of Tracks the World consist of
 	Vector* pathnodes;
 
Index: orxonox/trunk/src/world_entity.h
===================================================================
--- orxonox/trunk/src/world_entity.h	(revision 2191)
+++ orxonox/trunk/src/world_entity.h	(revision 2551)
@@ -14,31 +14,31 @@
 class WorldEntity
 {	
-	friend class World;
-
+  friend class World;
+  
  public:
   WorldEntity (bool isFree = false);
   ~WorldEntity ();
-
- 	Location* get_location ();
- 	Placement* get_placement ();
- 	void set_collision (CollisionCluster* newhull);
-
- 	bool isFree ();
- 	
+  
+  Location* get_location ();
+  Placement* get_placement ();
+  void set_collision (CollisionCluster* newhull);
+  
+  bool isFree ();
+  
   //void addAbility(Ability* ability);
   //void removeAbility(Ability* ability);
-
-	virtual void post_spawn ();
+  
+  virtual void post_spawn ();
   virtual void tick (float time);
   virtual void hit (WorldEntity* weapon, Vector loc);
   virtual void destroy ();
   virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
- 	virtual void command (Command* cmd);
+  virtual void command (Command* cmd);
   
   virtual void draw ();
   virtual void get_lookat (Location* locbuf);
-
-	virtual void left_world ();
-
+  
+  virtual void left_world ();
+  
  private:
   const bool bFree;	
@@ -46,11 +46,11 @@
   bool bDraw;
   
- 	WorldEntity* owner;
- 	CollisionCluster* collisioncluster;
- 	Placement place;
- 	Location loc;
-
-	void init( Location* spawnloc, WorldEntity* spawnowner);
-	void init( Placement* spawnplc, WorldEntity* spawnowner);
+  WorldEntity* owner;
+  CollisionCluster* collisioncluster;
+  Placement place;
+  Location loc;
+  
+  void init( Location* spawnloc, WorldEntity* spawnowner);
+  void init( Placement* spawnplc, WorldEntity* spawnowner);
 };
 
