Index: /orxonox/branches/old.dave/src/camera.cc.bak
===================================================================
--- /orxonox/branches/old.dave/src/camera.cc.bak	(revision 3280)
+++ /orxonox/branches/old.dave/src/camera.cc.bak	(revision 3280)
@@ -0,0 +1,299 @@
+
+
+/* 
+   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: Christian Meyer
+   co-programmer: ...
+*/
+
+#include "camera.h"
+#include "world.h"
+#include "world_entity.h"
+
+using namespace std;
+
+/**
+   \brief creates a Camera
+   
+   This standard constructor sets all parameters to zero
+*/
+Camera::Camera (World* world)
+{
+  this->world = world;
+  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;
+}
+
+/**
+   \brief default destructor
+*/
+Camera::~Camera ()
+{
+}
+
+/**
+   \brief time based actualisation of camera parameters
+   \param deltaT: The amount of time that has passed in milliseconds
+   
+   This is called by the World in every time_slice, use it to do fancy time dependant effects (such 
+   as smooth camera movement or swaying).
+*/
+void Camera::time_slice (Uint32 deltaT)
+{
+  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 ()
+{
+  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.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:
+      Location lookat;  
+      if( bound != NULL && world != NULL )
+	{
+	  bound->get_lookat (&lookat);
+	  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);
+  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();	
+
+  // ===== first camera control calculation option
+  // rotation
+  float matrix[4][4];
+  actual_place.w.conjugate().matrix (matrix);
+  /* orientation and */
+  glMultMatrixf ((float*)matrix);
+  /*  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 ();
+}
+
+/**
+  \brief set the camera position
+  \param plc: The Placement to set the camera to 
+	
+	This will set the actual and desired placement of the camera to plc
+*/
+void Camera::jump (Placement* plc = NULL)
+{
+  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;
+    }
+}
+
+/**
+  \brief bind the camera to an entity
+  \param entity: The enitity to bind the camera to
+	
+	This sets the focus of the camera to the given entity. This means that it will use the given WorldEntity's
+	Location and get_lookat() to determine the viewpoint the camera will render from.
+	Note that you cannot bind a camera to a free entity.
+*/
+void Camera::bind (WorldEntity* entity)
+{
+  if( entity != NULL)
+    {
+      if( entity->isFree ()) printf("Cannot bind camera to free entity");
+      else 
+	{
+	  bound = entity;
+	}
+    } 
+}
+
+
+void Camera::setWorld(World* world)
+{
+  this->world = world;
+}
Index: /orxonox/branches/old.dave/src/command_node.cc.bak
===================================================================
--- /orxonox/branches/old.dave/src/command_node.cc.bak	(revision 3280)
+++ /orxonox/branches/old.dave/src/command_node.cc.bak	(revision 3280)
@@ -0,0 +1,265 @@
+/* 
+   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: Christian Meyer
+   co-programmer: Patrick Boenzli
+*/
+
+
+#include "command_node.h"
+#include "keynames.h"
+#include "ini_parser.h"
+#include "world_entity.h"
+#include "game_loader.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+using namespace std;
+
+/**
+   \brief constructs a CommandNode to handle remote input
+   \param ID: unique denumerator to identify the node in the network
+*/
+CommandNode::CommandNode (int ID)
+{
+  bound = new List();
+  aliases = NULL;
+  netID = ID;
+  bLocalInput = false;
+  
+}
+
+/**
+   \brief constructs a CommandNode to handle local input
+   \param filename: The path and name of the file to load the key bindings from
+*/
+CommandNode::CommandNode (char* filename = DEFAULT_KEYBIND_FILE)
+{
+  aliases = NULL;
+  bLocalInput = true;
+  netID = 0;
+  bound = new List();
+  load_bindings (filename);
+}
+
+/**
+   \brief removes the CommandNode from memory
+*/
+CommandNode::~CommandNode ()
+{
+  if( aliases != NULL) free (aliases);
+  if( bound != NULL) delete bound;
+}
+
+
+void CommandNode::reset()
+{
+  this->bound->clear();
+}
+
+/**
+   \brief loads new key bindings from a file
+   \param filename: The path and name of the file to load the bindings from
+*/
+void CommandNode::load_bindings (char* filename)
+{
+  FILE* stream;
+  
+  printf("Loading key bindings from %s\n", filename);
+  
+  if( filename == NULL) filename = DEFAULT_KEYBIND_FILE;
+  
+  // remove old bindings if present
+  if( aliases != NULL)
+    {
+      free (aliases);
+      aliases = NULL;
+    }
+  
+  // create parser
+  IniParser parser (filename);
+  if( parser.get_section ("Bindings") == -1)
+    {
+      printf("Could not find key bindings in %s\n", filename);
+      return;
+    }
+  // allocate empty lookup table
+  aliases = (KeyBindings*) calloc (1, sizeof (KeyBindings));
+  
+  char namebuf[256];
+  char valuebuf[256];
+  memset (namebuf, 0, 256);
+  memset (valuebuf, 0, 256);
+  int* index;
+  
+  while( parser.next_var (namebuf, valuebuf) != -1)
+    {
+      index = name_to_index (namebuf);
+      switch( index[0])
+	{
+	case 0:
+	  printf("Key binding %d(%s) set to %s\n", index[1], SDLK_to_keyname( index[1]), valuebuf);
+	  strcpy (aliases->keys[index[1]], valuebuf);
+	  break;
+	case 1:
+	  printf("Button binding %d(%s) set to %s\n", index[1], SDLB_to_buttonname( index[1]), valuebuf);
+	  strcpy (aliases->buttons[index[1]], valuebuf);
+	  break;
+	default:
+	  break;
+	}
+      memset (namebuf, 0, 256);
+      memset (valuebuf, 0, 256);
+    }
+}
+
+/**
+   \brief binds a WorldEntity to the CommandNode
+   \param entity: Pointer to the entity to bind
+*/
+void CommandNode::bind (WorldEntity* entity)
+{
+  bound->add (entity);
+}
+
+/**
+   \brief removes an entity from the list of the CommandNode
+   \param entity: Pointer to the entity to relese
+*/
+void CommandNode::unbind (WorldEntity* entity)
+{
+  bound->remove (entity);
+}
+
+int* CommandNode::name_to_index (char* name)
+{
+  coord[0] = -1;
+  coord[1] = -1;
+  int c;
+  if( (c = keyname_to_SDLK (name)) != -1)
+    {
+      coord[1] = c;
+      coord[0] = 0;
+    }
+  if( (c = buttonname_to_SDLB (name)) != -1)
+    {
+      coord[1] = c;
+      coord[0] = 1;
+    }
+  return coord;
+}
+
+/**
+   \brief tells the CommandNode to run through all pending events and relay them accordingly
+*/
+void CommandNode::process ()
+{
+  if( bLocalInput) process_local ();
+  else process_network ();
+}
+
+void CommandNode::process_local ()
+{
+  SDL_Event event;
+  Command cmd;
+ 
+  
+  while( SDL_PollEvent (&event))
+    {
+      memset (cmd.cmd, 0, CMD_LENGHT); 
+      switch( event.type)
+	{
+	case SDL_KEYDOWN:
+	  strcpy (cmd.cmd, aliases->keys[event.key.keysym.sym]);
+	  cmd.bUp = false;
+	 
+	  
+	  if( strlen (cmd.cmd) > 0) relay (&cmd);
+	  break;
+	case SDL_KEYUP:
+	  strcpy( cmd.cmd, aliases->keys[event.key.keysym.sym]);
+	  cmd.bUp = true;
+	  
+	 
+	  if( strlen (cmd.cmd) > 0) relay (&cmd);
+	  break;
+	case SDL_MOUSEMOTION:
+	  strcpy( cmd.cmd, "cursor");
+	  cmd.x = event.motion.x;
+	  cmd.y = event.motion.y;
+	  cmd.xrel = event.motion.xrel;
+	  cmd.yrel = event.motion.yrel;
+	  break;
+	case SDL_MOUSEBUTTONUP:
+	  strcpy( cmd.cmd, aliases->buttons[event.button.button]);
+	  cmd.bUp = true;
+	  if( strlen (cmd.cmd) > 0) relay (&cmd);
+	  break;
+	case SDL_MOUSEBUTTONDOWN:
+	  strcpy( cmd.cmd, aliases->buttons[event.button.button]);
+	  cmd.bUp = false;
+	  if( strlen (cmd.cmd) > 0) relay (&cmd);
+	  break;
+	case SDL_JOYAXISMOTION:
+	case SDL_JOYBALLMOTION:
+	case SDL_JOYHATMOTION:
+	case SDL_JOYBUTTONDOWN:
+	case SDL_JOYBUTTONUP:
+	  break;
+	default:
+	  Orxonox *orx = Orxonox::getInstance();
+	  orx->event_handler (&event);
+	  
+	  break;
+	}
+    }
+}
+
+
+void CommandNode::process_network ()
+{
+
+}
+
+
+void CommandNode::relay (Command* cmd)
+{
+  
+  Orxonox *orx = Orxonox::getInstance();
+  if( orx->system_command (cmd)) return;
+  GameLoader* gl = GameLoader::getInstance();
+  if(gl->worldCommand(cmd)) return;
+  
+  if( bLocalInput) send_over_network (cmd);
+  
+  WorldEntity* entity = bound->enumerate();
+  while(  entity != NULL)
+    {
+      entity->command (cmd);
+      entity = bound->nextElement();
+    }
+}
+
+
+/**
+   \brief sets the network identifier of the CommandNode
+   \param ID: the new ID to use
+*/
+void CommandNode::set_netID (int ID)
+{
+  netID = ID;
+}
+
+void CommandNode::send_over_network (Command* cmd)
+{
+}
Index: /orxonox/branches/old.dave/src/message_structures.h.bak
===================================================================
--- /orxonox/branches/old.dave/src/message_structures.h.bak	(revision 3280)
+++ /orxonox/branches/old.dave/src/message_structures.h.bak	(revision 3280)
@@ -0,0 +1,33 @@
+/*!
+	\file message_structures.h
+	\brief contains defintitons of messages that can be passed between classes
+*/
+
+#ifndef _MESSAGESTRUCTURES_H
+#define _MESSAGESTRUCTURES_H
+
+#define CMD_LENGHT 16
+
+//! structure that contains a command message
+typedef struct
+{	float tottime;
+	float rottime;
+	float angle;
+	bool angleturn;
+	
+	
+	char cmd[CMD_LENGHT];	//!< the command delivered
+	bool bUp;	//!< false = command was activated / true = command was deactivated
+	
+	//! if cmd is "cursor" the coordinates of the mouse cursor are stored here
+	//!@{
+	Uint16 x, y;
+	//!@}
+	
+	//! if cmd is "cursor" the relative motion of the mouse cursor is stored here
+	//!@{
+	Sint16 xrel, yrel; 
+	//!@}
+} Command;
+
+#endif
Index: /orxonox/branches/old.dave/src/orxonox.cc.bak
===================================================================
--- /orxonox/branches/old.dave/src/orxonox.cc.bak	(revision 3280)
+++ /orxonox/branches/old.dave/src/orxonox.cc.bak	(revision 3280)
@@ -0,0 +1,419 @@
+/* 
+   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.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer: Christian Meyer
+*/
+
+#include "orxonox.h"
+#include "world.h"
+#include "camera.h"
+#include "data_tank.h"
+#include "command_node.h"
+#include "game_loader.h"
+#include <string.h>
+
+using namespace std;
+
+/**
+   \brief create a new Orxonox
+*/
+Orxonox::Orxonox ()
+{
+  pause = false;
+}
+
+/**
+   \brief remove Orxonox from memory
+*/
+Orxonox::~Orxonox () 
+{
+  Orxonox::singleton_ref = NULL;
+  if( world != NULL) delete world;
+  if( localinput != NULL) delete world;
+  if( localcamera != NULL) delete localcamera;
+  if( resources != NULL) delete resources;
+}
+
+
+/* this is a singleton class to prevent duplicates */
+Orxonox* Orxonox::singleton_ref = 0;
+
+Orxonox* Orxonox::getInstance (void)
+{
+  if (singleton_ref == NULL)
+    singleton_ref = new Orxonox();
+  return singleton_ref;
+}
+
+/**
+   \brief this finds the config file
+   
+   Since the config file varies from user to user and since one may want to specify different config files
+   for certain occasions or platforms this function finds the right config file for every occasion and stores
+   it's path and name into configfilename
+*/
+void Orxonox::get_config_file (int argc, char** argv)
+{
+  /*	char* path;
+    #ifdef __WIN32__
+    path = getenv("");
+    #else
+    path = getenv("HOME");
+    #endif
+    
+    if( path != NULL) strcpy (configfilename, path);
+    else strcpy (configfilename, "./");
+    strcat (configfilename, "/.orxonox.conf");*/
+  
+  strcpy (configfilename, "orxonox.conf");
+}
+
+/**
+   \brief initialize Orxonox with command line
+*/
+int Orxonox::init (int argc, char** argv)
+{
+  // parse command line
+  // config file
+  
+  get_config_file (argc, argv);
+  
+  // initialize SDL
+  printf("> Initializing SDL\n");
+  if( SDL_Init (SDL_INIT_EVERYTHING) == -1)
+    {
+      printf ("Could not SDL_Init(): %s\n", SDL_GetError());
+      return -1;
+    }
+  
+  // initialize everything
+  printf("> Initializing video\n");
+  if( init_video () == -1) return -1;
+  printf("> Initializing sound\n");
+  if( init_sound () == -1) return -1;
+  printf("> Initializing input\n");
+  if( init_input () == -1) return -1;
+  printf("> Initializing networking\n");
+  if( init_networking () == -1) return -1;
+  printf("> Initializing resources\n");
+  if( init_resources () == -1) return -1;
+  //printf("> Initializing world\n");
+  //if( init_world () == -1) return -1; PB: world will be initialized when started
+  
+  return 0;
+}
+
+/**
+   \brief initializes SDL and OpenGL
+*/
+int Orxonox::init_video () 
+{
+  // Set video mode
+  // TO DO: parse arguments for settings
+  SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 5);
+  SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 5);
+  SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 5);
+  SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16);
+  
+  int bpp = 32;
+  int width = 800;
+  int height = 600;
+  Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
+  
+  if( (screen = SDL_SetVideoMode (width, height, bpp, flags)) == NULL)
+  {
+    printf ("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, flags, SDL_GetError());
+    SDL_Quit();
+    return -1;
+  }
+  
+  // Set window labeling
+  SDL_WM_SetCaption( "Orxonox " PACKAGE_VERSION, "Orxonox " PACKAGE_VERSION);
+  
+  // TO DO: Create a cool icon and use it here
+  // SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);  
+
+  // OpenGL stuff
+  // (Is this all we initialize globally???)
+  glClearColor(0.0, 0.0, 0.0, 0.0);
+  glEnable(GL_DEPTH_TEST);
+ 
+  // LIGHTING
+  GLfloat lmodelAmbient[] = {.1, .1, .1, 1.0};
+  GLfloat whiteLight[] = {1.0, 1.0, 1.0,1.0};
+  GLfloat lightPosition[] = {10.0, 10, 19.0, 0.0};
+
+  glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight);
+  glLightfv(GL_LIGHT0, GL_SPECULAR, whiteLight);
+  glEnable(GL_LIGHTING);
+  glEnable(GL_LIGHT0);
+  glEnable(GL_DEPTH_TEST);
+  glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
+  glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight);
+   
+  //  glEnable(GL_COLOR);
+  //  glShadeModel(GL_SMOOTH);
+  
+  // create camera
+  localcamera = new Camera(world);
+  
+  return 0;
+}
+
+/**
+   \brief initializes the sound engine
+*/
+int Orxonox::init_sound () 
+{
+  printf("Not yet implemented\n");
+  return 0;
+}
+
+/**
+   \brief initializes input functions
+*/
+int Orxonox::init_input () 
+{
+  // create localinput
+  localinput = new CommandNode( configfilename);
+  
+  return 0;
+}
+
+/**
+   \brief initializes network system
+*/
+int Orxonox::init_networking () 
+{
+  printf("Not yet implemented\n");
+  return 0;
+}
+
+/**
+   \brief initializes and loads resource files
+*/
+int Orxonox::init_resources () 
+{
+  printf("Not yet implemented\n");
+  return 0;
+}
+
+/**
+   \brief initializes the world
+*/
+int Orxonox::init_world () 
+{
+  //world = new World();
+  
+  // TO DO: replace this with a menu/intro
+  //world->load_debug_level();
+  
+  return 0;
+}
+
+
+/**
+   \brief starts the orxonox game or menu
+
+   here is the central orxonox state manager. There are currently two states
+   - menu
+   - game-play
+   both states manage their states themselfs again.
+*/
+void Orxonox::start()
+{
+  
+  this->gameLoader = GameLoader::getInstance();
+  this->gameLoader->loadDebugCampaign(DEBUG_CAMPAIGN_0);
+  this->gameLoader->init();
+  this->gameLoader->start();
+}
+
+/**
+   \brief exits Orxonox
+*/
+void Orxonox::quitGame() 
+{
+  bQuitOrxonox = true;
+}
+
+/**
+   \brief this runs all of Orxonox
+*/
+void Orxonox::mainLoop()
+{
+  lastframe = SDL_GetTicks();
+  bQuitOrxonox = false;
+  // This is where everything is run
+  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");
+}
+
+/**
+   \brief handles sprecial events from localinput
+   \param event: an event not handled by the CommandNode 
+*/
+void Orxonox::event_handler (SDL_Event* event)
+{
+  // Handle special events such as reshape, quit, focus changes
+}
+
+/**
+   \brief synchronize local data with remote data
+*/
+void Orxonox::synchronize ()
+{
+  // Get remote input
+  // Update synchronizables
+}
+
+/**
+   \brief run all input processing
+*/
+void Orxonox::handle_input ()
+{
+  // localinput
+  localinput->process();
+  // remoteinput
+}
+
+/**
+   \brief advance the timeline
+*/
+void Orxonox::time_slice ()
+{
+  Uint32 curframe = SDL_GetTicks();
+  if( !pause)
+    {
+      Uint32 dt = curframe - lastframe;
+      
+      if(dt > 0)
+	{
+	  float fps = 1000/dt;
+	  printf("fps = %f\n", fps);
+	}
+      
+      world->time_slice (dt);
+      world->update ();
+      localcamera->time_slice (dt);
+    }
+  lastframe = curframe;
+}
+
+/**
+   \brief compute collision detection
+*/
+void Orxonox::collision ()
+{
+  world->collide ();
+}
+
+/**
+   \brief handle keyboard commands that are not meant for WorldEntities
+   \param cmd: the command to handle
+   \return true if the command was handled by the system or false if it may be passed to the WorldEntities
+*/
+bool Orxonox::system_command (Command* cmd)
+{
+  if( !strcmp( cmd->cmd, "quit"))
+    {
+      if( !cmd->bUp) this->gameLoader->stop();
+      return true;
+    }
+  return false;
+}
+
+/**
+   \brief render the current frame
+*/
+void Orxonox::display ()
+{
+  // clear buffer
+  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+  // set camera
+  localcamera->apply ();
+  // draw world
+  world->draw ();
+  // draw HUD
+  // flip buffers
+  SDL_GL_SwapBuffers();
+}
+
+/**
+   \brief retrieve a pointer to the local Camera
+   \return a pointer to localcamera
+*/
+Camera* Orxonox::get_camera ()
+{
+  return localcamera;
+}
+
+/**
+   \brief retrieve a pointer to the local CommandNode
+   \return a pointer to localinput
+*/
+CommandNode* Orxonox::get_localinput ()
+{
+  return localinput;
+}
+
+/**
+   \brief retrieve a pointer to the local World
+   \return a pointer to world
+*/
+World* Orxonox::get_world ()
+{
+  return world;
+}
+
+int main (int argc, char** argv) 
+{  
+  printf(">>> Starting Orxonox <<<\n");
+  Orxonox *orx = Orxonox::getInstance();
+  
+  if( (*orx).init(argc, argv) == -1)
+    {
+      printf("! Orxonox initialization failed\n");
+      return -1;
+    }
+  
+  //(*orx).mainLoop();
+
+  orx->start();
+  
+  //delete orx;
+  
+  return 0;
+}
Index: /orxonox/branches/old.dave/src/player.cc.bak
===================================================================
--- /orxonox/branches/old.dave/src/player.cc.bak	(revision 3280)
+++ /orxonox/branches/old.dave/src/player.cc.bak	(revision 3280)
@@ -0,0 +1,258 @@
+
+
+/* 
+   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
+*/
+
+#include "player.h"
+#include "stdincl.h"
+#include "collision.h"
+#include "command_node.h"
+
+using namespace std;
+
+
+Player::Player(bool isFree) : WorldEntity(isFree)
+{
+
+  obj = new Object ("reaplow.obj");
+  tottime=0.0f;
+  numPressed=0;
+  movfinishright=movfinishleft=movfinishup=movfinishdown=false;
+  angleturn=false;
+ 
+  /*
+  objectList = glGenLists(1);
+  glNewList (objectList, GL_COMPILE);
+
+  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();
+  
+  glEndList ();
+  */
+}
+
+Player::~Player () 
+
+{
+}
+
+void Player::post_spawn ()
+{
+  travel_speed = 15.0;
+  velocity = Vector();
+  bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
+  bFire = false;
+  acceleration = 10.0;
+  set_collision (new CollisionCluster (1.0, Vector(0,0,0)));
+}
+
+void Player::tick (float time)
+{
+	// movement
+	move (time);
+}
+
+void Player::hit (WorldEntity* weapon, Vector loc)
+{
+}
+
+void Player::destroy ()
+{
+}
+
+void Player::collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags)
+{
+}
+
+void Player::command (Command* cmd)
+{
+  //printf("Player|recieved command [%s]\n", cmd->cmd);
+  numPressed=cmd->NumPressed;
+  
+  rottime=cmd->rottime;
+  if(numPressed<1){
+	tottime=cmd->tottime;
+	angleturn=cmd->angleturn;
+  }
+  
+  
+  
+  if( !strcmp( cmd->cmd, "up")) bUp = !cmd->bUp;
+  else if( !strcmp( cmd->cmd, "down")) bDown = !cmd->bUp;
+  else if( !strcmp( cmd->cmd, "left")) bLeft = !cmd->bUp;
+  else if( !strcmp( cmd->cmd, "right")) bRight = !cmd->bUp;
+  else if( !strcmp( cmd->cmd, "fire")) bFire = !cmd->bUp;
+}
+
+void Player::draw ()
+{ 
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  float matrix[4][4];
+  float a[3];
+  a[0]=.8f;
+  a[1]=.8f;
+  a[2]=.8f;
+  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+  glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z);
+  get_placement()->w.matrix (matrix);
+  glMultMatrixf ((float*)matrix);
+ 
+  glMatrixMode (GL_MODELVIEW);
+  glRotatef (angle,0,0,1);
+  glRotatef (-90, 0,1,0);
+  
+  obj->draw();
+  //  glCallList (objectList);
+
+  
+  
+  //printf("Player@%f/%f/%f\n", get_placement()->r.x, get_placement()->r.y, get_placement()->r.z);
+}
+
+void Player::get_lookat (Location* locbuf)
+{
+	*locbuf = *get_location();
+	//locbuf->dist += 5.0;
+}
+
+void Player::left_world ()
+{
+}
+
+void Player::move (float time)
+{
+  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(rottime<1.0f)
+	  rottime=rottime+2.5f*time;
+  else
+	  rottime=1.0f;
+  if(tottime<1.5f)
+	  tottime=tottime+4.0f*time;
+  else
+	  tottime=1.5f;
+  
+  //Langsam zurückdrehen    ->anlgeturn ist für das Zurückdrehen verantwortlich!
+  if((angleturn||bLeft&&bRight)&&angle<=0.0f){
+	  if(!bLeft)
+	  angle=angle+rottime*10.0f;
+	  if(angle>0.0f){
+		  
+		  angleturn=false;
+		  angle=0.0f;}
+	  }
+  
+  if((angleturn||bLeft&&bRight)&&angle>=0.0f){
+	  if(!bRight)
+	  angle=angle-rottime*10.0f;
+	  if(angle<0.0f){
+		  angleturn=false;
+		  angle=0.0f;}
+		}
+  //Bewegung lansam abbremsen    **************
+  if(movfinishleft&&!bLeft){
+	  accel=accel+(orthDirection*acceleration*(tottimecopy-pow(tottime,1.5f)+.5f));
+	  if(tottime>tottimecopy)
+		  movfinishleft=false;
+  }
+  if(movfinishright&&!bRight){
+	accel=accel-(orthDirection*acceleration*(tottimecopy-pow(tottime,1.5f)+.5f));
+	if(tottime>tottimecopy)
+		movfinishright=false;
+  }
+  if(movfinishup&&!bUp){
+	accel=accel+(direction*acceleration*(tottimecopy-pow(tottime,1.5f)+.5f));
+	if(tottime>tottimecopy)
+		movfinishup=false;
+  }
+  
+  if(movfinishdown&&!bDown){
+	accel=accel-(direction*acceleration*(tottimecopy-pow(tottime,1.5f)+.5f));
+	if(tottime>tottimecopy)
+		movfinishdown=false;
+  }  
+  //                            **************
+  
+  if( bUp) { accel = accel+(direction*acceleration*pow(tottime,2.0f));movfinishup=true;tottimecopy=tottime;}
+  if( bDown) { accel = accel-(direction*acceleration*pow(tottime,2.0f));movfinishdown=true;tottimecopy=tottime; }
+  if( bLeft ) { accel = accel + (orthDirection*acceleration*pow(tottime,2.0f));
+	if(angle>-20.0f){
+	  angle=angle-rottime*20.0f;}
+	movfinishleft=true;
+	tottimecopy=tottime;}
+  if( bRight ) { accel = accel - (orthDirection*acceleration*pow(tottime,2.0f));
+	if(angle<20.0f){
+	  angle=angle+rottime*20.0f;}
+	  movfinishright=true;
+	  tottimecopy=tottime;
+  }
+  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/branches/old.dave/src/player.h.bak
===================================================================
--- /orxonox/branches/old.dave/src/player.h.bak	(revision 3280)
+++ /orxonox/branches/old.dave/src/player.h.bak	(revision 3280)
@@ -0,0 +1,55 @@
+/*! 
+    \file player.h
+    \brief Implements a basic controllable WorldEntity
+*/
+
+#ifndef PLAYER_H
+#define PLAYER_H
+
+#include "world_entity.h"
+#include "object.h"
+#include <math.h>
+
+//! Basic controllable WorldEntity
+class Player : public WorldEntity 
+{
+  friend class World;
+  
+ public:
+  Player (bool isFree = false);
+  ~Player ();
+  
+  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 draw ();
+  virtual void get_lookat (Location* locbuf);
+  
+  virtual void left_world ();
+  
+ private:
+  bool bUp, bDown, bLeft, bRight, bAscend, bDescend;
+  bool bFire;
+  Vector velocity;
+  float travel_speed;
+  float acceleration;
+  GLuint objectList;
+  Object* obj;
+  float tottime;
+  float tottimecopy;
+  float rottime;
+  float angle;
+  bool angleturn;
+  bool movfinishright,movfinishleft,movfinishup,movfinishdown;
+
+
+  
+  void move (float time);
+  
+};
+
+#endif
Index: /orxonox/branches/old.dave/src/stderr.txt
===================================================================
--- /orxonox/branches/old.dave/src/stderr.txt	(revision 3280)
+++ /orxonox/branches/old.dave/src/stderr.txt	(revision 3280)
@@ -0,0 +1,1 @@
+Fatal signal: Segmentation Fault (SDL Parachute Deployed)
Index: /orxonox/branches/old.dave/src/stdout.txt
===================================================================
--- /orxonox/branches/old.dave/src/stdout.txt	(revision 3280)
+++ /orxonox/branches/old.dave/src/stdout.txt	(revision 3280)
@@ -0,0 +1,1617 @@
+>>> Starting Orxonox <<<
+> Initializing SDL
+> Initializing video
+> Initializing sound
+Not yet implemented
+> Initializing input
+Loading key bindings from orxonox.conf
+Key binding 273(UP) set to up
+Key binding 274(DOWN) set to down
+Key binding 276(LEFT) set to left
+Key binding 275(RIGHT) set to right
+Key binding 32(SPACE) set to fire
+Key binding 27(ESCAPE) set to quit
+Key binding 112(p) set to pause
+Key binding 113(q) set to quit
+Button binding 1(BUTTON_LEFT) set to fire
+Button binding 3(BUTTON_RIGHT) set to altfire
+Key binding 98(b) set to benscho
+Key binding 120(x) set to up_world
+Key binding 122(z) set to down_world
+> Initializing networking
+Not yet implemented
+> Initializing resources
+Not yet implemented
+World::start() - starting new StoryEntity Nr:0
+finalizing the 3D-Object
+tList<T>::add() 
+List::add() 
+tList<T>::add() 
+World|Entering main loop
+fps = 500.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 33.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 34.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 35.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 33.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 35.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 23.000000
+An entity is out of the game area
+Environment::draw()fps = 26.000000
+An entity is out of the game area
+Environment::draw()fps = 25.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 31.000000
+An entity is out of the game area
+Environment::draw()fps = 21.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 35.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 30.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 32.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 35.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 35.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 35.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 38.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 40.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 37.000000
+An entity is out of the game area
+Environment::draw()fps = 45.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 43.000000
+An entity is out of the game area
+Environment::draw()fps = 41.000000
+An entity is out of the game area
+Environment::draw()tList<T>::clear() - clearing all world objects, releasing mem
+List::clear() - clearing all world objects, releasing mem
+fps = 45.000000
Index: /orxonox/branches/old.dave/src/track.cc.bak
===================================================================
--- /orxonox/branches/old.dave/src/track.cc.bak	(revision 3280)
+++ /orxonox/branches/old.dave/src/track.cc.bak	(revision 3280)
@@ -0,0 +1,164 @@
+
+
+/* 
+   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: Christian Meyer
+   co-programmer: ...
+*/
+
+#include "track.h"
+
+using namespace std;
+
+/**
+	\brief creates a null Track part
+*/
+Track::Track ()
+{
+	ID = 0;
+	offset = NULL;
+	end = NULL;
+	nextID = 0;
+}
+
+/**
+	\brief creates a functional base Track part
+	\param number: the ID if this Track part
+	\param next: the ID of the next Track part
+	\param start: pointer to an anchor point (Vector) representing the offset of this part
+	\param finish: pointer to an anchor point (Vector) representing the end of this part
+*/
+Track::Track (Uint32 number, Uint32 next, Vector* start, Vector* finish)
+{
+	ID = number;
+	offset = start;
+	end = finish;
+	nextID = next;
+}
+
+/**
+	\brief removes the Track part from memory
+*/
+Track::~Track ()
+{
+}
+
+void Track::init()
+{
+  
+}
+
+
+/**
+   \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-18.0) / l)) + Vector(0,0,7.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
+   \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)
+{
+	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 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;
+	
+	return false;
+}
+
+/**
+	\brief this is called when a WorldEntity enters a Track part
+	\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.
+*/
+void Track::post_enter (WorldEntity* entity)
+{
+}
+
+/**
+	\brief this is called when a WorldEntity leaves a Track part
+	\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.
+*/
+void Track::post_leave (WorldEntity* entity)
+{
+}
+
+/**
+	\brief this is called every frame
+	\param deltaT: amount of time passed since the last frame in seconds
+	
+	Do time based or polling scripts here. 
+*/
+void Track::tick (float deltaT)
+{
+}
+
+
+
+
+
Index: /orxonox/branches/old.dave/src/world.cc.bak
===================================================================
--- /orxonox/branches/old.dave/src/world.cc.bak	(revision 3280)
+++ /orxonox/branches/old.dave/src/world.cc.bak	(revision 3280)
@@ -0,0 +1,735 @@
+
+/* 
+   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
+*/
+
+#include "world.h"
+#include "world_entity.h"
+#include "collision.h"
+#include "track.h"
+#include "player.h"
+#include "command_node.h"
+#include "camera.h"
+#include "environment.h"
+
+using namespace std;
+
+
+/** 
+    \brief create a new World
+    
+    This creates a new empty world!
+*/
+World::World (char* name)
+{
+  this->worldName = name;
+  this->debugWorldNr = -1;
+  this->entities = new tList<WorldEntity>();
+}
+
+World::World (int worldID)
+{
+  this->debugWorldNr = worldID;
+  this->worldName = NULL;
+  this->entities = new tList<WorldEntity>();
+}
+
+/** 
+    \brief remove the World from memory
+*/
+World::~World ()
+{
+  Orxonox *orx = Orxonox::getInstance();
+  orx->get_localinput()->unbind (this->localPlayer);
+  delete this->entities;
+  delete this->localCamera;
+}
+
+
+/** 
+    \brief initialize the world before use.
+*/
+Error World::init()
+{
+  this->bPause = false;
+}
+
+Error World::start()
+{
+  this->mainLoop();
+}
+
+Error World::stop()
+{
+  this->bQuitCurrentGame = true;
+  this->localCamera->setWorld(NULL);
+  this->entities->clear();
+  Orxonox::getInstance()->get_localinput()->reset();
+  this->~World();
+}
+
+Error World::pause()
+{
+  this->isPaused = true;
+}
+
+Error World::resume()
+{
+  this->isPaused = false;
+}
+
+void World::load()
+{
+  if(this->debugWorldNr != -1)
+    {
+      switch(this->debugWorldNr)
+	{
+	case DEBUG_WORLD_0:
+	  {
+	    // create some path nodes
+	    this->pathnodes = new Vector[6];
+	    this->pathnodes[0] = Vector(0, 0, 0);
+	    this->pathnodes[1] = Vector(1000, 0, 0);
+	    //	    this->pathnodes[2] = Vector(-100, 140, 0);
+	    //	    this->pathnodes[3] = Vector(0, 180, 0);
+	    //	    this->pathnodes[4] = Vector(100, 140, 0);
+	    //	    this->pathnodes[5] = Vector(100, 40, 0);
+	    
+	    // create the tracks
+	    this->tracklen = 2;
+	    this->track = new Track[2];
+	    for( int i = 0; i < this->tracklen; i++)
+	      {
+		this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);
+	      }
+	    
+	    // create a player
+	    WorldEntity* myPlayer = new Player();
+	    this->spawn(myPlayer);
+	    this->localPlayer = myPlayer;	    
+
+	    // bind input
+	    Orxonox *orx = Orxonox::getInstance();
+	    orx->get_localinput()->bind (myPlayer);
+	    
+	    // bind camera
+	    this->localCamera = new Camera(this);
+	    this->getCamera()->bind (myPlayer);	
+
+	    Placement* plc = new Placement;
+	    plc->r = Vector(100, 10, 10);
+	    plc->w = Quaternion();
+	    WorldEntity* env = new Environment();
+	    this->spawn(env, plc);
+
+	    break;
+	  }
+	case DEBUG_WORLD_1:
+	  {
+	    // create some path nodes
+	    this->pathnodes = new Vector[6];
+	    this->pathnodes[0] = Vector(0, 0, 0);
+	    this->pathnodes[1] = Vector(20, 10, 10);
+	    this->pathnodes[2] = Vector(40, 0, 10);
+	    this->pathnodes[3] = Vector(60, 10, 0);
+	    this->pathnodes[4] = Vector(80, 20, 10);
+	    this->pathnodes[5] = Vector(30, 50, 0);
+	    
+	    // create the tracks
+	    this->tracklen = 6;
+	    this->track = new Track[6];
+	    for( int i = 0; i < this->tracklen; i++)
+	      {
+		this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);
+	      }
+	    
+	    // create a player
+	    //WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
+	    WorldEntity* myPlayer = new Player();
+	    this->spawn(myPlayer);
+	    this->localPlayer = myPlayer;
+	    
+	    // bind input
+	    Orxonox *orx = Orxonox::getInstance();
+	    orx->get_localinput()->bind (myPlayer);
+	    
+	    // bind camera
+	    this->localCamera = new Camera(this);
+	    this->getCamera()->bind (myPlayer);	
+	    break;
+	  }
+	default:
+	  printf("World::load() - no world with ID %i found", this->debugWorldNr );
+	}
+    }
+  else if(this->worldName != NULL)
+    {
+
+    }
+
+  // initialize debug coord system
+  objectList = glGenLists(1);
+  glNewList (objectList, GL_COMPILE);
+  glLoadIdentity();
+  glColor3f(1.0,0,0);
+  glBegin(GL_QUADS);
+  float height [500][100];
+  Vector normal_vectors[500][100];
+  float size = 2;
+   
+	
+	for ( int i = 0; i<400; i+=1)
+      {
+	for (int j = 0; j<100;j+=1)
+	  {
+	    //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
+	    height[i][j]=(sin((float)j/3)*rand()*i/182400)*.2;
+	  }
+      }
+	 //Die Hügel ein wenig glätten
+	 for (int i=1;i<399 ;i+=1 ){
+		 for(int j=1;j<99;j+=1){
+			 height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4;
+
+		 }
+	 }
+	 
+    //Berechnung von normalen Vektoren
+
+	for(int i=1;i<399;i+=1){
+    for(int j=1;j<99 ;j+=1)
+
+    {
+		Vector* v1 = new Vector (size*i,size*(j-25)-50,height[i][j]-20 );
+	    Vector* v2 = new Vector (size*(i+1),size*(j-25)-50,height[i+1][j]-20);
+	    Vector* v3 = new Vector (size*(i),size*(j-24)-50,height[i][j+1]-20);
+	    Vector* v4 = new Vector (size*(i-1),size*(j-25)-50,height[i-1][j]-20);
+		Vector* v5 = new Vector (size*(i),size*(j-26)-50,height[i][j-1]-20);
+		
+		Vector c1 = *v1 - *v2;
+	    Vector c2 = *v1 - *v3;
+	    Vector c3= *v1 - *v4;
+	    Vector c4 = *v1 - *v5;
+	    normal_vectors[i][j]=c1.cross(*v1-*v3)+c2.cross(*v1-*v4)+c3.cross(*v1-*v5)+c4.cross(*v1-*v2);
+		normal_vectors[i][j].normalize();
+	    
+    
+	
+	
+	}
+	}
+	int snowheight=3;
+	for ( int i = 0; i<400; i+=1)
+      {
+	for (int j = 0; j<100;j+=1)
+	  {	  
+	   Vector* v1 = new Vector (size*i,        size*(j-25)-50,      height[i][j]-20 );
+	   Vector* v2 = new Vector (size*(i+1),    size*(j-25)-50,      height[i+1][j]-20);
+	   Vector* v3 = new Vector (size*(i+1),    size*(j-24)-50,  height[i+1][j+1]-20);
+	   Vector* v4 = new Vector (size*(i),        size*(j-24)-50,  height[i][j+1]-20);
+	    float a[3];
+		if(height[i][j]<snowheight){
+		a[0]=0;
+		a[1]=1.0-height[i][j]/10-.3;
+		a[2]=0;
+		glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+		}
+		else{
+		a[0]=1.0;
+		a[1]=1.0;
+		a[2]=1.0;
+		glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+
+		}
+		glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
+	    glVertex3f(v1->x, v1->y, v1->z);
+		if(height[i+1][j]<snowheight){
+		a[0]=0;
+		a[1] =1.0-height[i+1][j]/10-.3;
+		a[2]=0;
+		glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+		else{
+		a[0]=1.0;
+		a[1]=1.0;
+		a[2]=1.0;
+		glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+		
+		}
+		glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
+	    glVertex3f(v2->x, v2->y, v2->z);
+		if(height[i+1][j+1]<snowheight){
+		a[0]=0;
+		a[1] =1.0-height[i+1][j+1]/10-.3;
+		a[2]=0;
+		glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+		else{
+		a[0]=1.0;
+		a[1]=1.0;
+		a[2]=1.0;
+		glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+		
+		
+		}
+		glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z);
+	    glVertex3f(v3->x, v3->y, v3->z);
+		if(height[i][j+1]<snowheight){
+		a[0]=0;
+		a[1] =1.0-height[i+1][j+1]/10-.3;
+		a[2]=0;
+		glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+		else{
+			a[0]=1.0;
+		a[1]=1.0;
+		a[2]=1.0;
+			glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+		}
+		glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z);
+	    glVertex3f(v4->x, v4->y, v4->z);
+
+	  }
+      }
+glEnd();
+/*  
+  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
+  glBegin(GL_LINES);
+  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();
+  glEndList();
+  */
+}
+
+
+/** 
+    \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 *a, *b;
+  WorldEntity *aobj, *bobj;
+   
+  a = entities;
+  
+  while( a != NULL)
+    {
+      aobj = a->nextElement();
+      if( aobj->bCollide && aobj->collisioncluster != NULL)
+	{
+	  b = a->nextElement();
+	  while( b != NULL )
+	    {
+	      bobj = b->nextElement();
+	      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->nextElement();
+	    }
+	}
+      a = a->enumerate();
+    }
+  */
+}
+
+/** 
+    \brief runs through all entities calling their draw() methods
+*/
+void World::draw ()
+{
+  // draw geometry
+  
+  // draw entities
+  WorldEntity* entity;
+  
+  entity = this->entities->enumerate();
+  while( entity != NULL ) 
+    { 
+      if( entity->bDraw ) entity->draw();
+      entity = this->entities->nextElement();
+    }
+  
+  
+  // draw debug coord system
+  glCallList (objectList);
+
+
+}
+
+/** 
+    \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->enumerate(); 
+  entity = this->entities->enumerate();
+  while( entity != NULL ) 
+    { 
+
+      
+      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) )
+		{
+		  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
+	  */
+	}
+      
+      entity = entities->nextElement();
+    }
+  
+}
+
+/** 
+    \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;
+  
+  entity = entities->enumerate(); 
+  while( entity != NULL) 
+    { 
+      entity->tick (seconds);
+      entity = entities->nextElement();
+    }
+
+  for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
+}
+
+/**
+   \brief removes level data from memory
+*/
+void World::unload()
+{
+  if( pathnodes) delete []pathnodes;
+  if( track) delete []pathnodes;
+}
+
+
+
+/**
+   \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)
+{
+  track[loc->part].map_camera (loc, plc);
+}
+
+
+void World::setTrackLen(Uint32 len)
+{
+  this->tracklen = len;
+}
+
+int World::getTrackLen()
+{
+  return this->tracklen;
+}
+
+void World::debug()
+{
+  //List<WorldEntity> *l;
+  WorldEntity* entity;
+  
+  printf("counting all entities\n");
+  printf("World::debug() - enumerate()\n");
+  entity = entities->enumerate();  
+  while( entity != NULL ) 
+    { 
+      if( entity->bDraw ) printf("got an entity\n");
+      entity = entities->nextElement();
+    }
+}
+
+
+void World::mainLoop()
+{
+  this->lastFrame = SDL_GetTicks();
+  this->bQuitOrxonox = false;
+  this->bQuitCurrentGame = false;
+  printf("World|Entering main loop\n");
+  while(!this->bQuitOrxonox && !this->bQuitCurrentGame) /* pause pause pause ?!?!?*/
+    {
+      //debug routine
+      //debug();
+      // Network
+      synchronize();
+      // Process input
+      handle_input();
+      // Process time
+      time_slice();
+      // Process collision
+      collision();
+      // Draw
+      display();
+  
+      //for(int i = 0; i < 1000000; i++){}
+
+    }
+  printf("World|Exiting the main loop\n");
+}
+
+/**
+   \brief synchronize local data with remote data
+*/
+void World::synchronize ()
+{
+  // Get remote input
+  // Update synchronizables
+}
+
+/**
+   \brief run all input processing
+*/
+void World::handle_input ()
+{
+  // localinput
+  Orxonox::getInstance()->get_localinput()->process();
+  // remoteinput
+}
+
+/**
+   \brief advance the timeline
+*/
+void World::time_slice ()
+{
+  Uint32 currentFrame = SDL_GetTicks();
+  if(!this->bPause)
+    {
+      Uint32 dt = currentFrame - this->lastFrame;
+      
+      if(dt > 0)
+	{
+	  float fps = 1000/dt;
+	  printf("fps = %f\n", fps);
+	}
+      else
+	{
+	  printf("fps = 1000 but 0ms!\n");
+	}
+      
+      this->time_slice (dt);
+      this->update ();
+      this->localCamera->time_slice (dt);
+    }
+  this->lastFrame = currentFrame;
+}
+
+/**
+   \brief compute collision detection
+*/
+void World::collision ()
+{
+  this->collide ();
+}
+
+/**
+   \brief handle keyboard commands that are not meant for WorldEntities
+   \param cmd: the command to handle
+   \return true if the command was handled by the system or false if it may be passed to the WorldEntities
+*/
+bool World::system_command (Command* cmd)
+{
+  if( !strcmp( cmd->cmd, "quit"))
+    {
+      if( !cmd->bUp) this->bQuitOrxonox = true;
+      return true;
+    }
+  return false;
+}
+
+/**
+	\brief render the current frame
+*/
+void World::display ()
+{
+  // clear buffer
+  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+  // set camera
+  this->localCamera->apply ();
+  // draw world
+  this->draw();
+  // draw HUD
+  // flip buffers
+  SDL_GL_SwapBuffers();
+}
+
+Camera* World::getCamera()
+{
+  return this->localCamera;
+}
+
+
+void World::spawn(WorldEntity* entity)
+{
+  Location zeroloc;
+  Location* loc = NULL;
+  WorldEntity* owner;
+
+  entities->add (entity);
+  zeroloc.dist = 0;
+  zeroloc.part = 0;
+  zeroloc.pos = Vector();
+  zeroloc.rot = Quaternion();
+  loc = &zeroloc;
+  entity->init (loc, owner);
+  if (entity->bFree)
+    {
+      this->track[loc->part].map_coords( loc, entity->get_placement());
+    }
+  entity->post_spawn ();
+}
+
+
+void World::spawn(WorldEntity* entity, Location* loc)
+{
+  Location zeroLoc;
+  WorldEntity* owner;
+  this->entities->add (entity);
+  if( loc == NULL)
+    {
+      zeroLoc.dist = 0;
+      zeroLoc.part = 0;
+      zeroLoc.pos = Vector();
+      zeroLoc.rot = Quaternion();
+      loc = &zeroLoc;
+    }
+  entity->init (loc, owner);
+  if (entity->bFree)
+    {
+      this->track[loc->part].map_coords( loc, entity->get_placement());
+    }
+  entity->post_spawn ();
+  //return entity;
+}
+
+
+void World::spawn(WorldEntity* entity, Placement* plc)
+{
+  Placement zeroPlc;
+  WorldEntity* owner;
+  if( plc == NULL)
+    {
+      zeroPlc.r = Vector();
+      zeroPlc.w = Quaternion();
+      plc = &zeroPlc;
+    }
+  this->entities->add (entity);
+  entity->init (plc, owner);
+  entity->post_spawn ();
+  //return entity;
+}
