Index: /branches/cleanup/src/lib/collision_detection/cd_engine.cc
===================================================================
--- /branches/cleanup/src/lib/collision_detection/cd_engine.cc	(revision 10590)
+++ /branches/cleanup/src/lib/collision_detection/cd_engine.cc	(revision 10591)
@@ -22,5 +22,5 @@
 #include "model.h"
 #include "world_entity.h"
-#include "terrain.h"
+#include "environments/terrain.h"
 // #include "player.h"
 
@@ -30,5 +30,5 @@
 
 #include "bsp/bsp_manager.h"
-#include "bsp_entity.h"
+#include "environments/bsp_entity.h"
 
 
Index: /branches/cleanup/src/lib/graphics/importer/bsp/bsp_manager.cc
===================================================================
--- /branches/cleanup/src/lib/graphics/importer/bsp/bsp_manager.cc	(revision 10590)
+++ /branches/cleanup/src/lib/graphics/importer/bsp/bsp_manager.cc	(revision 10591)
@@ -30,5 +30,5 @@
 #include "debug.h"
 #include "material.h"
-#include "camera.h"
+#include "tools/camera.h"
 #include "vertex_array_model.h"
 #include "world_entities/player.h"
Index: /branches/cleanup/src/lib/graphics/render2D/element_2d.cc
===================================================================
--- /branches/cleanup/src/lib/graphics/render2D/element_2d.cc	(revision 10590)
+++ /branches/cleanup/src/lib/graphics/render2D/element_2d.cc	(revision 10591)
@@ -24,5 +24,5 @@
 #include "state.h"
 #include "p_node.h"
-#include "camera.h"
+#include "tools/camera.h"
 ///////////////////////////
 
Index: /branches/cleanup/src/lib/script_engine/script_manager.cc
===================================================================
--- /branches/cleanup/src/lib/script_engine/script_manager.cc	(revision 10590)
+++ /branches/cleanup/src/lib/script_engine/script_manager.cc	(revision 10591)
@@ -25,5 +25,5 @@
 
 #include "script.h"
-#include "script_trigger.h"
+#include "tools/script_trigger.h"
 #include "luaincl.h"
 #include "loading/load_param_xml.h"
Index: /branches/cleanup/src/story_entities/game_world.cc
===================================================================
--- /branches/cleanup/src/story_entities/game_world.cc	(revision 10590)
+++ /branches/cleanup/src/story_entities/game_world.cc	(revision 10591)
@@ -27,9 +27,8 @@
 
 #include "player.h"
-#include "camera.h"
-#include "environment.h"
-#include "terrain.h"
-#include "test_entity.h"
-#include "terrain.h"
+#include "tools/camera.h"
+#include "tools/cameraman.h"
+#include "environments/environment.h"
+#include "environments/terrain.h"
 #include "playable.h"
 #include "environments/mapped_water.h"
Index: /branches/cleanup/src/story_entities/game_world_data.cc
===================================================================
--- /branches/cleanup/src/story_entities/game_world_data.cc	(revision 10590)
+++ /branches/cleanup/src/story_entities/game_world_data.cc	(revision 10591)
@@ -29,8 +29,8 @@
 #include "world_entity.h"
 #include "player.h"
-#include "camera.h"
-#include "cameraman.h"
-#include "terrain.h"
-#include "skybox.h"
+#include "tools/camera.h"
+#include "tools/cameraman.h"
+#include "environments/terrain.h"
+#include "environments/skybox.h"
 #include "md2/md2Model.h"
 #include "world_entities/projectiles/projectile.h"
Index: /branches/cleanup/src/story_entities/menu/game_menu.cc
===================================================================
--- /branches/cleanup/src/story_entities/menu/game_menu.cc	(revision 10590)
+++ /branches/cleanup/src/story_entities/menu/game_menu.cc	(revision 10591)
@@ -27,5 +27,5 @@
 
 #include "graphics_engine.h"
-#include "camera.h"
+#include "tools/camera.h"
 #include "sound_engine.h"
 
Index: /branches/cleanup/src/story_entities/multi_player_world_data.cc
===================================================================
--- /branches/cleanup/src/story_entities/multi_player_world_data.cc	(revision 10590)
+++ /branches/cleanup/src/story_entities/multi_player_world_data.cc	(revision 10591)
@@ -27,10 +27,7 @@
 #include "world_entity.h"
 #include "player.h"
-#include "camera.h"
-#include "environment.h"
-#include "terrain.h"
-#include "test_entity.h"
-#include "terrain.h"
-#include "md2/md2Model.h"
+#include "tools/camera.h"
+#include "environments/environment.h"
+#include "environments/terrain.h"
 #include "world_entities/projectiles/projectile.h"
 #include "npcs/npc_test1.h"
Index: /branches/cleanup/src/util/multiplayer_team_deathmatch.cc
===================================================================
--- /branches/cleanup/src/util/multiplayer_team_deathmatch.cc	(revision 10590)
+++ /branches/cleanup/src/util/multiplayer_team_deathmatch.cc	(revision 10591)
@@ -31,5 +31,5 @@
 
 #include "shared_network_data.h"
-#include "terrain.h"
+#include "environments/terrain.h"
 #include "space_ships/space_ship.h"
 
@@ -44,5 +44,5 @@
 #include "shell_command.h"
 
-#include "spawning_point.h"
+#include "tools/spawning_point.h"
 
 #include "creatures/fps_player.h"
Index: /branches/cleanup/src/util/state.cc
===================================================================
--- /branches/cleanup/src/util/state.cc	(revision 10590)
+++ /branches/cleanup/src/util/state.cc	(revision 10591)
@@ -19,6 +19,6 @@
 
 
-#include "camera.h"
-#include "cameraman.h"
+#include "tools/camera.h"
+#include "tools/cameraman.h"
 
 #ifndef NULL
Index: /branches/cleanup/src/world_entities/Makefile.am
===================================================================
--- /branches/cleanup/src/world_entities/Makefile.am	(revision 10590)
+++ /branches/cleanup/src/world_entities/Makefile.am	(revision 10591)
@@ -7,5 +7,5 @@
 ## THESE ARE THE BASE CLASSES OF ALL WORLD_ENTITIES
 libORXwe_a_SOURCES = world_entity.cc \
-		     cameraman.cc \
+		     tools/cameraman.cc \
 		     playable.cc\
  		     player.cc \
@@ -18,8 +18,8 @@
  		     projectiles/projectile.cc \
  		     extendable.cc\
- 		     power_ups/power_up.cc \
- 		     power_ups/param_power_up.cc \
- 		     power_ups/weapon_power_up.cc\
- 		     spawning_point.cc\
+ 		     items/power_ups/power_up.cc \
+ 		     items/power_ups/param_power_up.cc \
+ 		     items/power_ups/weapon_power_up.cc\
+ 		     tools/spawning_point.cc\
  		     effects/explosion.cc\
  		     effects/billboard.cc\
@@ -31,5 +31,5 @@
 
 noinst_HEADERS = world_entity.h\
- 		 cameraman.h\
+ 		 tools/cameraman.h\
 		 extendable.h\
  		 playable.h \
@@ -42,8 +42,8 @@
  		 weapons/ammo_container.h\
  		 projectiles/projectile.h \
- 		 power_ups/power_up.h\
-		 power_ups/param_power_up.h\
- 		 power_ups/weapon_power_up.h \
- 		 spawning_point.h\
+ 		 items/power_ups/power_up.h\
+		 items/power_ups/param_power_up.h\
+ 		 items/power_ups/weapon_power_up.h \
+ 		 tools/spawning_point.h\
  		 effects/explosion.h\
  		 effects/billboard.h\
Index: /branches/cleanup/src/world_entities/WorldEntities.am
===================================================================
--- /branches/cleanup/src/world_entities/WorldEntities.am	(revision 10590)
+++ /branches/cleanup/src/world_entities/WorldEntities.am	(revision 10591)
@@ -14,25 +14,4 @@
                 world_entities/npcs/mover.cc \
                 \
-                world_entities/environment.cc \
-                world_entities/skysphere.cc \
-                world_entities/skybox.cc \
-                world_entities/skydome.cc \
-                world_entities/terrain.cc \
-                world_entities/satellite.cc \
-                world_entities/movie_entity.cc \
-                world_entities/recorder.cc \
-                world_entities/character_attributes.cc \
-                world_entities/test_entity.cc \
-                world_entities/test_entity2.cc \
-                world_entities/blackscreen.cc \
-                world_entities/scrolling_screen.cc \
-                world_entities/planet.cc \
-                world_entities/bsp_entity.cc \
-                world_entities/mount_point.cc \
-                world_entities/sound_entity.cc \
-                world_entities/camera.cc \
-                \
-                world_entities/questGUI/quest_gui.cc \
-                world_entities/questGUI/quest.cc \
                 \
                 world_entities/weapons/weapon_slot.cc \
@@ -73,6 +52,6 @@
                 world_entities/projectiles/spike_ball.cc \
                 \
-                world_entities/power_ups/turret_power_up.cc \
-                world_entities/power_ups/laser_power_up.cc \
+                world_entities/items/power_ups/turret_power_up.cc \
+                world_entities/items/power_ups/laser_power_up.cc \
                 \
                 world_entities/space_ships/space_ship.cc \
@@ -91,30 +70,13 @@
                 world_entities/environments/model_entity.cc \
                 world_entities/environments/building.cc \
-		world_entities/environments/rotor.cc \
+                world_entities/environments/rotor.cc \
                 world_entities/environments/mapped_water.cc \
-                \
-                world_entities/elements/image_entity.cc \
-                world_entities/elements/text_element.cc \
-                world_entities/elements/glgui_radar.cc \
-                \
-                world_entities/effects/lightning_bolt.cc \
-                world_entities/effects/blink.cc \
-                \
-                world_entities/script_trigger.cc \
-                \
-                \
-                world_entities/particles/particle_emitter.cc \
-		world_entities/particles/dot_emitter.cc \
-		world_entities/particles/box_emitter.cc \
-		world_entities/particles/plane_emitter.cc \
-        world_entities/particles/emitter_node.cc \
-		\
-		world_entities/particles/particle_system.cc \
-		world_entities/particles/sprite_particles.cc \
-		world_entities/particles/spark_particles.cc \
-		world_entities/particles/model_particles.cc \
-		world_entities/particles/dot_particles.cc \
-		\
-		world_entities/particles/quick_animation.cc \
+		world_entities/environments/environment.cc \
+		world_entities/environments/skysphere.cc \
+		world_entities/environments/skybox.cc \
+		world_entities/environments/skydome.cc \
+		world_entities/environments/terrain.cc \
+                world_entities/environments/planet.cc \
+                world_entities/environments/bsp_entity.cc \
 		\
 		\
@@ -128,5 +90,40 @@
 		world_entities/weather_effects/snow_effect.cc \
 		world_entities/weather_effects/lightning_effect.cc \
-		world_entities/weather_effects/lense_flare.cc
+		world_entities/weather_effects/lense_flare.cc \
+		world_entities/elements/image_entity.cc \
+		\
+                world_entities/elements/text_element.cc \
+                world_entities/elements/glgui_radar.cc \
+                \
+                world_entities/effects/lightning_bolt.cc \
+                world_entities/effects/blink.cc \
+                \
+                world_entities/tools/movie_entity.cc \
+                world_entities/tools/recorder.cc \
+                world_entities/tools/blackscreen.cc \
+                world_entities/tools/scrolling_screen.cc \
+                world_entities/tools/mount_point.cc \
+                world_entities/tools/sound_entity.cc \
+                world_entities/tools/camera.cc \
+                world_entities/tools/script_trigger.cc \
+                \
+                \
+                world_entities/particles/particle_emitter.cc \
+		world_entities/particles/dot_emitter.cc \
+		world_entities/particles/box_emitter.cc \
+		world_entities/particles/plane_emitter.cc \
+                world_entities/particles/emitter_node.cc \
+		world_entities/particles/particle_system.cc \
+		world_entities/particles/sprite_particles.cc \
+		world_entities/particles/spark_particles.cc \
+		world_entities/particles/model_particles.cc \
+		world_entities/particles/dot_particles.cc \
+		world_entities/particles/quick_animation.cc \
+		\
+                \
+                \
+                world_entities/questGUI/quest_gui.cc \
+                world_entities/questGUI/quest.cc
+
 
 
@@ -146,22 +143,19 @@
                 npcs/mover.h \
                 \
-                environment.h \
-                skysphere.h \
-                skybox.h \
-                skydome.h \
-                terrain.h \
-                satellite.h \
-                movie_entity.h \
-                recorder.h \
+                environments/environment.h \
+                environments/skysphere.h \
+                environments/skybox.h \
+                environments/skydome.h \
+                environments/terrain.h \
+                tools/movie_entity.h \
+                tools/recorder.h \
                 character_attributes.h \
-                test_entity.h \
-                test_entity2.h \
-                blackscreen.h \
-                scrolling_screen.h \
-                planet.h \
-                bsp_entity.h \
-                mount_point.h \
-                sound_entity.h \
-                camera.h \
+                tools/blackscreen.h \
+                tools/scrolling_screen.h \
+                environments/planet.h \
+                environments/bsp_entity.h \
+                tools/mount_point.h \
+                tools/sound_entity.h \
+                tools/camera.h \
                 \
                 questGUI/quest_gui.h \
@@ -206,6 +200,6 @@
                 projectiles/spike_ball.h \
                 \
-                power_ups/turret_power_up.h \
-                power_ups/laser_power_up.h \
+                items/power_ups/turret_power_up.h \
+                items/power_ups/laser_power_up.h \
                 \
                 space_ships/space_ship.h \
Index: anches/cleanup/src/world_entities/blackscreen.cc
===================================================================
--- /branches/cleanup/src/world_entities/blackscreen.cc	(revision 10590)
+++ 	(revision )
@@ -1,199 +1,0 @@
-/*
-   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: Filip Gospodinov
-   co-programmer:
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "executor/executor.h"
-#include "util/loading/factory.h"
-#include "util/loading/load_param.h"
-#include "blackscreen.h"
-#include "debug.h"
-#include "material.h"
-#include "state.h"
-// #include "camera.h"
-#include "primitive_model.h"
-
-ObjectListDefinition(BlackScreen);
-CREATE_FACTORY(BlackScreen);
-
-
-
-/**
- *
- */
-BlackScreen::BlackScreen()
-{
-  this->init();
-
-
-}
-
-
-/**
- *
- */
-BlackScreen::BlackScreen(const TiXmlElement* root)
-{
-  this->init();
-
-  if( root != NULL)
-    this->loadParams(root);
-
-}
-
-
-/**
- *
- */
-BlackScreen::~BlackScreen()
-{}
-
-
-/**
- *
- */
-void BlackScreen::init()
-{
-  this->registerObject(this, BlackScreen::_objectList);
-  this->toList(OM_COMMON);
-
-  this->material = new Material();
-  this->material->setDiffuse(0,0,0);
-  this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
-  PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, 6., 10);
-  this->setModel(model);
-
-  i=0;
-  state=0;
-  fadeSpeed=1;
-
-}
-
-
-/**
- * loads the Settings of a MD2Creature from an XML-element.
- * @param root the XML-element to load the MD2Creature's properties from
- */
-void BlackScreen::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-}
-
-
-
-
-void BlackScreen::draw() const
-{
-  glPushAttrib(GL_ENABLE_BIT);
-  glDisable(GL_LIGHTING);
-  glEnable(GL_BLEND);   // Turn Blending On
-
-//   glMatrixMode(GL_MODELVIEW);
-//   glPushMatrix();
-//   /* translate */
-//   glTranslatef (this->getAbsCoor ().x,
-//                 this->getAbsCoor ().y,
-//                 this->getAbsCoor ().z);
-//   Vector tmpRot = this->getAbsDir().getSpacialAxis();
-//   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
-
-  this->material->select();
-
-
-  WorldEntity::draw(this->getModel( ));
-
-//   glBegin(GL_QUADS);
-
-//   glVertex3f(0.,-100.0f,-100.0f);
-//   glVertex3f(0., -100.0f,100.0f);
-//   glVertex3f(0., 100.0f,100.0f);
-//   glVertex3f(0., 100.0f,-100.0f);
-
-//   glEnd();
-
-  glPopMatrix();
-  glPopAttrib();
-}
-
-/**
- *
- */
-void BlackScreen::tick (float time)
-{
-if (state == true)
-  fadeOut();
-else
-  fadeIn();
-
-  this->material->setTransparency(i);
-//   Camera* cam = State::getCamera();
-//   if( cam != NULL)
-//     this->setParent(cam);
-}
-
-void BlackScreen::fadeIn()
-{
-  if (i>0)
-    i=i-0.005*fadeSpeed;
-  else
-    this->toList(OM_DEAD);
-}
-
-void BlackScreen::fadeOut()
-{
-  if (i<=1)
-    i=i+0.005*fadeSpeed;
-}
-
-void  BlackScreen::toggleFade ()
-{
-    this->state= !this->state;
-
-    if(state)
-    {
-      this->toList(OM_COMMON);
-    }
-}
-
-
-void BlackScreen::initFadeBlack()
-{
-  this->i = 1.;
-  this->state = true;
-  this->toList(OM_COMMON);
-}
-
-
-void BlackScreen::changeFadeSpeed(float newSpeed)
-{
-  fadeSpeed=newSpeed;
-}
-
-bool BlackScreen::isBlack()
-{
-if (i==1)
-  return 1;
-else
-  return 0;
-}
-
-bool BlackScreen::isTrans()
-{
-  if (i==0)
-    return 1;
-  else
-    return 0;
-}
Index: anches/cleanup/src/world_entities/blackscreen.h
===================================================================
--- /branches/cleanup/src/world_entities/blackscreen.h	(revision 10590)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#ifndef _BLACKSCREEN_H
-#define _BLACKSCREEN_H
-
-#include "world_entity.h"
-
-
-class TiXmlElement;
-class Material;
-
-class BlackScreen : public WorldEntity
-{
-    ObjectListDeclaration(BlackScreen);
-
-  private:
-    float i;
-    bool state;
-    Material*       material;
-    void fadeIn();
-    void fadeOut();
-    float fadeSpeed;
-
-  public:
-    BlackScreen();
-    BlackScreen(const TiXmlElement* root);
-    virtual ~BlackScreen();
-
-    void init();
-    virtual void loadParams(const TiXmlElement* root);
-
-    void toggleFade();
-    void initFadeBlack();
-    void changeFadeSpeed(float newSpeed);
-    bool isBlack();
-    bool isTrans();
-    virtual void tick (float time);
-
-    virtual void draw() const;
-
-
-};
-
-#endif /* _BLACKSCREEN_H */
Index: anches/cleanup/src/world_entities/bsp_entity.cc
===================================================================
--- /branches/cleanup/src/world_entities/bsp_entity.cc	(revision 10590)
+++ 	(revision )
@@ -1,165 +1,0 @@
-/*
-   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: Claudio Botta
-   co-programmer: ...
-*/
-
-#include "bsp_entity.h"
-
-#include "debug.h"
-#include "loading/resource_manager.h"
-
-
-ObjectListDefinition(BspEntity);
-CREATE_FACTORY(BspEntity);
-
-
-/**
- * constructs and loads a BspEntity from a XML-element
- * @param root the XML-element to load from
- */
-BspEntity::BspEntity(const TiXmlElement* root)
-{
-  this->init();
-
-  if (root != NULL)
-    this->loadParams(root);
-}
-
-
-/**
- * standard deconstructor
- */
-BspEntity::~BspEntity ()
-{
-  if( this->bspManager != NULL)
-    delete this->bspManager;
-}
-
-
-
-/**
- * initializes the BspEntity
- * @todo change this to what you wish
- */
-void BspEntity::init()
-{
-  this->registerObject(this, BspEntity::_objectList);
-
-  this->bspManager = NULL;
-  this->sortTransparency = 1;
-  this->sortTransparencyMore = 0;
-
-
-  this->name_handle = registerVarId( new SynchronizeableString( &this->name, &this->name_write, "name", PERMISSION_MASTER_SERVER ) );
-
-  this->setSynchronized( true );
-}
-
-
-void BspEntity::setName(const std::string& name)
-{
-  PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str());
-
-  this->name = name;
-
-  // Check wether file exists....
-  if ( File(Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(name)).exists()  ) {
-
-    this->bspManager = new BspManager(this);
-    this->bspManager->sortTransparency = this->sortTransparency;
-    this->bspManager->sortTransparencyMore = this->sortTransparencyMore;
-
-    if(this->bspManager->load(name.c_str(), 0.1f) == -1 ) {
-      this->bspManager = NULL;
-
-    } else {
-      this->toList(OM_ENVIRON); // Success!!!
-    }
-  } else {
-    this->bspManager = NULL;
-    this->toList(OM_DEAD);
-  }
-}
-
-void BspEntity::setTransparency(int sort, int sortMore)
-{
-  this->sortTransparency = sort;
-  this->sortTransparencyMore = sortMore;
-  
-  if (this->bspManager != NULL)
-  {
-    this->bspManager->sortTransparency = sort;
-    this->bspManager->sortTransparencyMore = sortMore;
-  }
-}
-
-/**
- * loads a BspEntity from a XML-element
- * @param root the XML-element to load from
- * @todo make the class Loadable
- */
-void BspEntity::loadParams(const TiXmlElement* root)
-{
-  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
-  // WorldEntity::loadParam(root);
-
-  LoadParam(root, "Name", this, BspEntity, setName)
-  .describe("Sets the of the BSP file.");
-
-  LoadParam(root, "Transparency", this, BspEntity, setTransparency)
-  .describe("1. argument: true -> sort transparent textures; 2. argument: true -> better but slower sorting")
-  .defaultValues(1, 0);
-  
-  /*  LoadParam(root, "Scale", this, BSpEntity, setScale)
-        .describe("Sets the scale factore of the bsp level.");
-  */
-
-  /**
-   * @todo: make the class Loadable
-   */
-}
-
-
-/**
- * advances the BspEntity about time seconds
- * @param time the Time to step
- */
-void BspEntity::tick(float time)
-{
-  this->bspManager->tick(time);
-}
-
-
-/**
- * draws this worldEntity
- */
-void BspEntity::draw () const
-{
-  this->bspManager->draw();
-}
-
-
-/**
- *
- *
- */
-void BspEntity::collidesWith (WorldEntity* entity, const Vector& location)
-{}
-
-void BspEntity::varChangeHandler( std::list< int > & id )
-{
-  if ( std::find( id.begin(), id.end(), this->name_handle ) != id.end() )
-  {
-    this->setName( this->name_write );
-  }
-}
Index: anches/cleanup/src/world_entities/bsp_entity.h
===================================================================
--- /branches/cleanup/src/world_entities/bsp_entity.h	(revision 10590)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*!
- * @file bsp_entity.h
- * @brief description
-*/
-
-#ifndef _BSP_ENTITY_H
-#define _BSP_ENTITY_H
-
-#include "world_entity.h"
-#include "bsp/bsp_manager.h"
-
-#include "util/loading/factory.h"
-#include "util/loading/load_param.h"
-
-
-
-//! A Class to ...
-class BspEntity : public WorldEntity
-{
-  ObjectListDeclaration(BspEntity);
- public:
-  BspEntity(const TiXmlElement* root = NULL);
-  virtual ~BspEntity();
-
-  virtual void loadParams(const TiXmlElement* root);
-
-  void setName(const std::string& name);
-  void setTransparency(int sort, int sortMore = 0);
-
-  void init();
-
-  virtual void varChangeHandler( std::list<int> & id );
-
-  virtual void draw() const;
-  virtual void tick(float time);
-  virtual void collidesWith (WorldEntity* entity, const Vector& location);
-
-  /** @returns the BspManager of this entity */
-  inline BspManager* getBspManager() { return this->bspManager; }
-
- private:
-   BspManager* bspManager;
-
-   std::string name;                   //!< store name
-   std::string name_write;             //!< temp variable to store name
-   int name_handle;                    //!< handle for name
-   int sortTransparency;              //!< sort transparent textures
-   int sortTransparencyMore;          //!< sort transparent textures better
-};
-
-#endif /* _BSP_ENTITY_H */
Index: anches/cleanup/src/world_entities/camera.cc
===================================================================
--- /branches/cleanup/src/world_entities/camera.cc	(revision 10590)
+++ 	(revision )
@@ -1,560 +1,0 @@
-/*
-   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: Benjamin Grauer
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-#include "camera.h"
-#include "key_mapper.h"
-#include "glincl.h"
-#include "util/loading/load_param.h"
-#include "world_entity.h"
-#include "vector.h"
-#include "targets.h"
-#include "track/track.h"
-#include "script_class.h"
-#include "state.h"
-
-#include "debug.h"
-
-
-ObjectListDefinition(Camera);
-
-CREATE_SCRIPTABLE_CLASS(Camera,
-                        addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
-                        ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
-                        ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
-                        ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
-                       );
-
-/**
- *  creates a Camera
-*/
-Camera::Camera()
-{
-  this->registerObject(this, Camera::_objectList);
-
-  this->init();
-}
-
-
-Camera::Camera(const TiXmlElement* root)
-{
-  this->registerObject(this, Camera::_objectList);
-
-  if( root != NULL)
-    this->loadParams(root);
-
-  this->init();
-
-}
-
-
-/**
- *  default destructor
-*/
-Camera::~Camera()
-{}
-
-void Camera::init()
-{
-  this->toList( OM_ENVIRON_NOTICK);
-  //this->setName("camera");
-  this->target = new CameraTarget();
-  this->target->masta=this;
-  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW0);
-  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW1);
-  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW2);
-  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW3);
-  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW4);
-  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW5);
-
-  //this->setFovy(90);
-  this->setAspectRatio(1.33f);
-  this->setClipRegion(.1, 10000);
-
-  this->viewTopFovy = 60;
-  this->viewNormalFovy = 90;
-  this->viewFrontFovy = 120;
-  this->viewRightFovy = 90;
-  this->viewLeftFovy = 90;
-
-  this->viewTopDistance = 70;
-  this->viewNormalDistance = 10;
-  this->viewFrontDistance = 4;
-  this->viewRightDistance = 10;
-  this->viewLeftDistance = 10;
-
-  this->setViewMode(Camera::ViewNormal);
-
-  this->setParentMode(PNODE_ALL);
-  this->eventHandling = true;
-
-  //add to track
-  if(this->entityTrack)
-   {
-    this->setParent(this->entityTrack->getTrackNode());
-    //this->setRelCoor(0,0,0);
-   }
-}
-
-/**
- *  focuses the Camera onto a Target
- * @param target the new PNode the Camera should look at.
-*/
-void Camera::lookAt(PNode* target)
-{
-  this->target->setParentSoft(target,0.2);
-}
-
-/**
- * @returns The PNode of the Target (from there you can get position and so on
-*/
-PNode* Camera::getTargetNode() const
-{
-  return (PNode*)this->target;
-}
-
-void Camera::setTargetNode(PNode* target)
-{
-  this->target->setParent(target);
-}
-
-/**
- *  sets a new AspectRatio
- * @param aspectRatio the new aspect ratio to set (width / height)
-*/
-void Camera::setAspectRatio(float aspectRatio)
-{
-  this->aspectRatio = aspectRatio;
-}
-
-/**
- * Sets a new clipping region
- * @param nearClip The near clip plane
- * @param farClip The far clip plane
-*/
-void Camera::setClipRegion(float nearClip, float farClip)
-{
-  this->nearClip = nearClip;
-  this->farClip = farClip;
-}
-
-/**
- *  sets the new VideoMode and initializes iteration to it.
- * @param mode the mode to change to.
-*/
-void Camera::setViewMode(ViewMode mode)
-{
-  currentMode = mode;
-  switch (mode)
-  {
-    default:
-    case Camera::ViewNormal:
-    {
-      this->fovy = viewNormalFovy;
-      this->toFovy = viewNormalFovy;
-      //this->fovy = 60;
-      //this->toFovy = 60;
-      this->setRelCoorSoft(-2.0/3.0 * this->viewNormalDistance, 1.0/3.0 * this->viewNormalDistance, 0);
-      this->target->setRelCoorSoft(0,0,0);
-      break;
-    }
-    case Camera::ViewBehind:
-      break;
-    case Camera::ViewFront:
-    {
-      this->fovy = viewFrontFovy;
-      this->toFovy = viewFrontFovy;
-      this->setRelCoorSoft(this->viewFrontDistance, 0, 0, 5);
-      this->target->setRelCoorSoft(Vector(10,0,0), 5);
-      break;
-    }
-    case Camera::ViewLeft:
-    {
-      this->fovy = viewLeftFovy;
-      this->toFovy = viewLeftFovy;
-      this->setRelCoorSoft(0, 1, -viewLeftDistance, .5);
-      this->target->setRelCoorSoft(0,0,0);
-      break;
-    }
-    case Camera::ViewRight:
-    {
-      this->fovy = viewRightFovy;
-      this->toFovy = viewRightFovy;
-      this->setRelCoorSoft(Vector(0, 1, viewRightDistance), 0.5);
-      this->target->setRelCoorSoft(0,0,0);
-      break;
-    }
-    case Camera::ViewTop:
-    {
-      this->fovy= viewTopFovy;
-      this->toFovy = viewTopFovy;
-      this->setRelCoor(Vector(-0.05, this->viewTopDistance , 0));
-      this->target->setRelCoor(0,0,0);
-    }
-  }
-}
-
-
-/**
- *  Updates the position of the camera.
- * @param dt: The time that elapsed.
-*/
-void Camera::tick(float dt)
-{
-  //update frustum plane
-  this->viewVector = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized();
-  this->frustumPlane = Plane(this->viewVector, this->getAbsCoor() + this->viewVector * 0.1);
-  this->upVector = this->getAbsDirV();
-
-  // iteration for fovy
-  float tmpFovy = (this->toFovy - this->fovy);
-  if (fabsf(tmpFovy) > 0.01)
-    this->fovy += tmpFovy * fabsf(dt);
-
-  if(this->entityTrack)
-  {
-    //PRINTF(0)("tickytackytucky\n");
-    this->entityTrack->tick(dt);
-    //this->setAbsCoor(this->entityTrack->getTrackNode()->getAbsCoor());
-  } 
-
-
-
-  //iterate(float dt, translate, target)
-  target->translate(dt);
-}
-
-
-void Camera::draw() const
-{
-  if( this->entityTrack != NULL && this->isDrawTrack())
-    this->entityTrack->drawGraph();
-}
-
-
-/**
- *  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 ()
-{
-  // switching to Projection Matrix
-  glMatrixMode (GL_PROJECTION);
-  glLoadIdentity ();
-
-  gluPerspective(this->fovy,
-                 this->aspectRatio,
-                 this->nearClip,
-                 this->farClip);
-
-
-    // setting up the perspective
-  // speed-up feature
-  glMatrixMode (GL_MODELVIEW);
-  glLoadIdentity();
-
-
-}
-
-void Camera::project()
-{
-  Vector cameraPosition = this->getAbsCoor();
-  Vector targetPosition = this->target->getAbsCoor();
-
-
-        //Setting the Camera Eye, lookAt and up Vectors
-  gluLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z,
-            targetPosition.x, targetPosition.y, targetPosition.z,
-            this->upVector.x, this->upVector.y, this->upVector.z);
-}
-
-
-/**
- *  processes an event
- * @param event: the event to process
-*/
-void Camera::process(const Event &event)
-{
-  if (eventHandling == true)
-  {
-    if( event.type == KeyMapper::PEV_VIEW0)
-    {
-      this->setViewMode(Camera::ViewNormal);
-    }
-    else if( event.type == KeyMapper::PEV_VIEW1)
-    {
-      this->setViewMode(Camera::ViewBehind);
-    }
-    else if( event.type == KeyMapper::PEV_VIEW2)
-    {
-      this->setViewMode(Camera::ViewFront);
-    }
-    else if( event.type == KeyMapper::PEV_VIEW3)
-    {
-      this->setViewMode(Camera::ViewLeft);
-    }
-    else if( event.type == KeyMapper::PEV_VIEW4)
-    {
-      this->setViewMode(Camera::ViewRight);
-    }
-    else if( event.type == KeyMapper::PEV_VIEW5)
-    {
-      this->setViewMode(Camera::ViewTop);
-    }
-  }
-}
-
-
-void Camera::loadParams(const TiXmlElement* root)
-{
-  // Do the PNode loading stuff
-  WorldEntity::loadParams(root);
-
-  LoadParam(root, "viewTopFovy", this, Camera, setViewTopFovy);
-  LoadParam(root, "viewFrontFovy", this, Camera, setViewFrontFovy);
-  LoadParam(root, "viewLeftFovy", this, Camera, setViewLeftFovy);
-  LoadParam(root, "viewRightFovy", this, Camera, setViewRightFovy);
-  LoadParam(root, "viewBehindFovy", this, Camera, setViewBehindFovy);
-  LoadParam(root, "viewNormalFovy", this, Camera, setViewNormalFovy);
-
-  LoadParam(root, "viewTopDistance", this, Camera, setViewTopDistance);
-  LoadParam(root, "viewFrontDistance", this, Camera, setViewFrontDistance);
-  LoadParam(root, "viewLeftDistance", this, Camera, setViewLeftDistance);
-  LoadParam(root, "viewRightDistance", this, Camera, setViewRightDistance);
-  LoadParam(root, "viewBehindDistance", this, Camera, setViewBehindDistance);
-  LoadParam(root, "viewNormalDistance", this, Camera, setViewNormalDistance);
-}
-
-
-void Camera::setViewTopFovy(float fovy)
-{
-  this->viewTopFovy = fovy;
-}
-
-void Camera::setViewFrontFovy(float fovy)
-{
-  this->viewFrontFovy = fovy;
-}
-
-void Camera::setViewLeftFovy(float fovy)
-{
-  this->viewLeftFovy = fovy;
-}
-
-void Camera::setViewRightFovy(float fovy)
-{
-  this->viewRightFovy = fovy;
-}
-
-void Camera::setViewBehindFovy(float fovy)
-{
-  this->viewBehindFovy = fovy;
-}
-
-void Camera::setViewNormalFovy(float fovy)
-{
-  this->viewNormalFovy = fovy;
-}
-
-void Camera::setViewTopDistance(float Distance)
-{
-  this->viewTopDistance = Distance;
-}
-
-void Camera::setViewFrontDistance(float Distance)
-{
-  this->viewFrontDistance = Distance;
-}
-
-void Camera::setViewLeftDistance(float Distance)
-{
-  this->viewLeftDistance = Distance;
-}
-
-void Camera::setViewRightDistance(float Distance)
-{
-  this->viewRightDistance = Distance;
-}
-
-void Camera::setViewBehindDistance(float Distance)
-{
-  this->viewBehindDistance = Distance;
-}
-
-void Camera::setViewNormalDistance(float Distance)
-{
-  this->viewNormalDistance = Distance;
-}
-
-
-
-
-void Camera::glLookAt(float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz)
-{
-  //Vector* eye=new Vector(eyex, eyey, eyez);
-  Vector* center=new Vector (centerx, centery, centerz);
-  Vector* up=new Vector(upx, upy, upz);
-
-  center->x-=eyex;
-  center->y-=eyey;
-  center->z-=eyez;
-
-  center->normalize();
-  up->normalize();
-  Vector* s = VectorProd(center, up);
-  Vector* u = VectorProd(s, center);
-  GLfloat Matrix[]={s->x, s->y, s->z, 0, u->x, u->y, u->z, 0, -center->x, -center->y, -center->z, 0, 0, 0, 0, 1};
-
-  glMultMatrixf(Matrix);
-  glTranslated(-eyex, -eyey, -eyez);
-  delete center;
-  delete up;
-  delete s;
-  delete u;
-
-}
-
-
-
-
-Vector* Camera::VectorProd(Vector* v1, Vector* v2)
-{
-Vector* temp= new Vector();
-temp->x=v1->y * v2->z - v1->z * v2->y;
-temp->y=v1->z * v2->x - v1->x * v2->z;
-temp->z=v1->x * v2->y - v1->y * v2->x;
-return temp;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-///////////////////
-// CAMERA-TARGET //
-///////////////////
-//REATE_FACTORY(CameraTarget);
-
-
-ObjectListDefinition(CameraTarget);
-
-
-CameraTarget::CameraTarget()
-{
-  this->registerObject(this, CameraTarget::_objectList);
-  //  this->setParentMode(PNODE_MOVEMENT);
-  this->speed=1;
-  translateTo.x=0;
-  translateTo.y=0;
-  translateTo.z=0;
-  rotateBy.x=0;
-  rotateBy.y=0;
-  rotateBy.z=0;
-  target=createStick();
-}
-
-
-void CameraTarget::detach()
-{
-  masta->setParentSoft(target);
-  masta->getTargetNode()->setParentSoft(target);
-}
-
-PNode* CameraTarget::createStick()
-{
-  return new Targets();
-}
-
-
-void CameraTarget::atach(PNode* object)
-{
-  masta->setParentSoft(object);
-  masta->getTargetNode()->setParentSoft(object);
-}
-
-
-
-
-Vector CameraTarget::iterate(float dt, const Vector* Target, const Vector* cam)
-{
-
-
-  Vector tmpVec;
-  tmpVec= (*Target - *cam);
-  tmpVec.normalize();
-  return  tmpVec;
-
-}
-
-
-void CameraTarget::translate(float dt)
-{
-  if (fabs(translateTo.len()  - (target->getAbsCoor()).len()) >= 11 )
- {
-   Vector tmpVec= iterate(dt,  &translateTo,  &(masta->getAbsCoor()));
-   target->shiftCoor(speed*tmpVec.x, speed*tmpVec.y, speed*tmpVec.z);
-  }
-}
-
-Vector * CameraTarget::rotate(Vector* newPos, float speed)
-{
-
-}
-
-void CameraTarget::jump(float x, float y, float z)
-{
-target->setAbsCoor(x,y,z);
-}
-
-
-void CameraTarget::trans(float x, float y, float z)
-{
-  Vector tmpVec=Vector(x,y,z);
-  if( this->getParent())
-    this->getParent()->setRelCoor(this->getParent()->getRelCoor());
-  translateNow(&tmpVec);
-}
-
-void CameraTarget::translateNow(Vector* vec)
-{
-translateTo=*vec;
-}
-
-void CameraTarget::changeSpeed(float speed)
-{
-  if (speed!=0)
-this->speed=speed;
-  return;
-}
-
-
-bool CameraTarget::isDone()
-{
-  if (fabs(translateTo.len()  - (target->getAbsCoor()).len()) >= 11 )
-    return 0;
-  else
-    return 1;
-}
Index: anches/cleanup/src/world_entities/camera.h
===================================================================
--- /branches/cleanup/src/world_entities/camera.h	(revision 10590)
+++ 	(revision )
@@ -1,174 +1,0 @@
-/*!
- * @file camera.h
- * Viewpoint controlling class definitions
-*/
-
-#ifndef _CAMERA_H
-#define _CAMERA_H
-
-#include "world_entity.h"
-#include "event_listener.h"
-#include "plane.h"
-
-
-class World;
-class CameraTarget;
-class Event;
-
-//! Camera
-/**
- * This class controls the viewpoint from which the World is rendered.
-*/
-class Camera : public WorldEntity, public EventListener
-{
-  friend class CameraTarget;
-  friend class CameraMan;
-  ObjectListDeclaration(Camera);
-public:
-  //! an enumerator for different types of view
-  typedef enum ViewMode
-  {
-    ViewNormal,
-    ViewBehind,
-    ViewFront,
-    ViewLeft,
-    ViewRight,
-    ViewTop
-  };
-  public:
-  Camera();
-  Camera(const TiXmlElement* root);
-  virtual ~Camera();
-
-  void lookAt(PNode* target);
-  CameraTarget* getTarget() const { return this->target; };
-  PNode* getTargetNode() const;
-  void setTargetNode(PNode* target);
-  void setAspectRatio(float aspectRatio);
-  inline float getAspectRatio() {return this->aspectRatio;};
-
-  void setClipRegion(float nearClip, float farClip);
-
-  /** @param fovy new field of view factor (in degrees) */
-  inline void setFovy(float fovy)
-  {
-    this->fovy = fovy;
-    this->toFovy = fovy;
-  };
-
-  inline float getFovy() {return this->fovy;};
-  /** @param fovy new field of view factor (in degrees) to iterate to */
-  void setToFovy(float toFovy) { this->toFovy = toFovy; };
-
-  void setViewMode(Camera::ViewMode mode);
-  inline const Vector& getViewVector() const { return this->viewVector; }
-  inline const Vector& getUpVector() const { return this->upVector; }
-  inline const Plane& getViewFrustum() const { return this->frustumPlane; }
-
-  inline float distance(const Vector& distance) const { return this->frustumPlane.distancePoint(distance); }
-  inline float distance(const PNode* node) const { return distance(node->getAbsCoor()); }
-
-  inline void setEventHandling(bool b) {this->eventHandling = b;}
-  inline bool getEventHandling() {return this->eventHandling;}
-
-  void glLookAt(float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz);
-  Vector* VectorProd(Vector* v1, Vector* v2);
-  void Rotate();
-  void draw() const;
-  void tick(float dt);
-  void apply ();
-  void project();
-
-  void process(const Event &event);
-  //CameraTarget*     target;          //!< The Target of the Camera (where this Camera Looks at)
-
-  virtual void loadParams(const TiXmlElement* root);
-
-  void              setViewTopFovy(float fovy);
-  void              setViewLeftFovy(float fovy);
-  void              setViewRightFovy(float fovy);
-  void              setViewBehindFovy(float fovy);
-  void              setViewFrontFovy(float fovy);
-  void              setViewNormalFovy(float fovy);
-
-  void              setViewTopDistance(float Distance);
-  void              setViewLeftDistance(float Distance);
-  void              setViewRightDistance(float Distance);
-  void              setViewBehindDistance(float Distance);
-  void              setViewFrontDistance(float Distance);
-  void              setViewNormalDistance(float Distance);
-
-private:
-
-  void              init();
-
-  CameraTarget*     target;          //!< The Target of the Camera (where this Camera Looks at)
-
-  bool              eventHandling;    //!< True, if the Camera handles the processing of events itself. Set false to overwrite the standard handling.
-
-  float             fovy;            //!< The field of view Angle (in degrees).
-  float             aspectRatio;     //!< The aspect ratio (width / height).
-  float             nearClip;        //!< The near clipping plane.
-  float             farClip;         //!< The far clipping plane.
-
-  float             toFovy;          //!< The fovy-mode to iterate to.
-  Camera::ViewMode  currentMode;     //!< The ViewMode the camera is in
-
-  Vector            delay;
-  Plane             frustumPlane;    //!< plane that marks the view frustum
-  Vector            viewVector;      //!< the direction of the camera view
-  Vector            upVector;        //!< direction of the up vector
-
-  float             viewTopFovy;
-  float             viewLeftFovy;
-  float             viewRightFovy;
-  float             viewBehindFovy;
-  float             viewFrontFovy;
-  float             viewNormalFovy;
-
-  float             viewTopDistance;
-  float             viewLeftDistance;
-  float             viewRightDistance;
-  float             viewBehindDistance;
-  float             viewFrontDistance;
-  float             viewNormalDistance;
-
-};
-
-//! A CameraTarget is where the Camera is looking at.
-class CameraTarget : public PNode
-{
-  friend class Camera;        //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it.
-  ObjectListDeclaration(CameraTarget);
-
-private:
-  CameraTarget();
-  virtual ~CameraTarget() {}
-  float speed;
-  PNode* target;
-  PNode* freeTarget;
-  Camera* masta;
-  Vector translateTo;
-  Vector rotateBy;
-
-
-public:
-
-  void detach();
-  void atach(PNode* object);
-  Vector iterate(float dt, const Vector* target, const Vector* cam);
-  void translate(float dt);
-  void changeSpeed(float speed);
-  Vector* rotate(Vector* newPos, float speed);
-  void jump(float x, float y, float z);
-  void translateNow(Vector* vec);
-  PNode* createStick();
-  void trans(float x, float y, float z);
-  bool isDone();
-};
-
-
-
-
-#endif /* _CAMERA_H */
-
Index: anches/cleanup/src/world_entities/cameraman.cc
===================================================================
--- /branches/cleanup/src/world_entities/cameraman.cc	(revision 10590)
+++ 	(revision )
@@ -1,384 +1,0 @@
-  /*
-   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: Filip Gospodinov
-   co-programmer: Silvan Nellen
-*/
-
-#include "shell_command.h"
-#include "cameraman.h"
-#include "game_world_data.h"
-#include "state.h"
-#include "sound_engine.h"
-#include <string>
-#include "script_class.h"
-#include "loading/load_param_xml.h"
-#include "blackscreen.h"
-#include "p_node.h"
-#include "camera.h"
-
-ObjectListDefinition(CameraMan);
-
-SHELL_COMMAND(camerainfo, CameraMan, cameraInfo);
-
-
-CREATE_SCRIPTABLE_CLASS(CameraMan,
-                        addMethod("changeCurrTarget", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::changeCurrTarget))
-                        ->addMethod("atachCurrCameraToWorldEntity", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::atachCurrCameraToWorldEntity))
-                        ->addMethod("changeTarget", Executor3<CameraMan, lua_State*, const std::string&, const std::string&,const std::string&>(&CameraMan::changeTarget))
-                        ->addMethod("atachCameraToWorldEntity", Executor3<CameraMan, lua_State*,const std::string&,const std::string&,const std::string&>(&CameraMan::atachCameraToWorldEntity))
-                        ->addMethod("detachCurrCamera", Executor0<CameraMan, lua_State*>(&CameraMan::detachCurrCamera))
-                        ->addMethod("setCam", Executor1<CameraMan, lua_State*, const std::string&>(&CameraMan::setCam))
-                        ->addMethod("toggleFade", Executor0<CameraMan, lua_State*>(&CameraMan::togglFade))
-                        ->addMethod("initFadeBlack", Executor0<CameraMan, lua_State*>(&CameraMan::initFadeBlack))
-                        ->addMethod("getCurrCameraCoorX", Executor0ret<CameraMan, lua_State*,float>(&CameraMan::getCurrCameraCoorX))
-                        ->addMethod("getCurrCameraCoorY", Executor0ret<CameraMan, lua_State*,float>(&CameraMan::getCurrCameraCoorY))
-                        ->addMethod("getCurrCameraCoorZ", Executor0ret<CameraMan, lua_State*,float>(&CameraMan::getCurrCameraCoorZ))
-                        ->addMethod("jumpCurrCam", Executor3<CameraMan, lua_State*,float,float,float>(&CameraMan::jumpCurrCam))
-                        ->addMethod("jumpCam", Executor4<CameraMan, lua_State*,const std::string&,float,float,float>(&CameraMan::jumpCam))
-                        //->addMethod("setViewMode", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::setViewMode))
-                        ->addMethod("setRelCoor", Executor4<CameraMan, lua_State*,const std::string&,float,float,float>(&CameraMan::setRelCameraCoor))
-                        ->addMethod("setRelCoorSoft", Executor5<CameraMan, lua_State*,const std::string&,float,float,float,float>(&CameraMan::setRelCameraCoorSoft))
-                        ->addMethod("pauseCamera", Executor2<CameraMan, lua_State*, const std::string&, bool>(&CameraMan::pauseCamera))
-                       );
-
-
-CameraMan::CameraMan(const TiXmlElement* root)
-{
-  this->registerObject(this, CameraMan::_objectList);
-
-  this->nearClip = 1.0;
-  this->farClip = 1000.0;
-
-  this->fadeToBlack=new BlackScreen();
-
-  this->setCam( State::getCamera());
-
-  if (root != NULL)
-    this->loadParams(root);
-}
-
-
-void CameraMan::loadParams(const TiXmlElement* root)
-{
-  BaseObject::loadParams(root);
-  LoadParamXML(root, "Cameras", this, CameraMan, createCameras);
-}
-
-
-void CameraMan::createCameras(const TiXmlElement* camerasTag)
-{
-
-    LOAD_PARAM_START_CYCLE(camerasTag, object);
-    {
-      this->createCam(object);
-    }
-    LOAD_PARAM_END_CYCLE(object);
-
-}
-
-
-void CameraMan::createCam(const TiXmlElement* root)
-{
-  this->cameras.push_back(new Camera(root));
-  cameras[cameras.size()-1]->setClipRegion(nearClip, farClip);
-}
-
-/*void CameraMan::setViewMode(const std::string& cameraName, const std::string& viewMode)
-{
-     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", cameraName);
-     
-     if (!strcmp(viewMode, "ViewNormal"))
-     {
-         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewNormal);
-     }
-     else if (!strcmp(viewMode, "ViewTop"))
-     {
-         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewTop);
-     }
-     else if (!strcmp(viewMode, "ViewBehind"))
-     {
-         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewBehind);
-     }
-     else if (!strcmp(viewMode, "ViewFront"))
-     {
-         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewFront);
-     }
-     else if (!strcmp(viewMode, "ViewLeft"))
-     {
-         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewLeft);
-     }
-     else if (!strcmp(viewMode, "ViewRight"))
-     {
-         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewRight);
-     }
-}*/
-
-void CameraMan::setRelCameraCoor(const std::string& camName, float x, float y, float z)
-{
-     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
-     dynamic_cast<Camera*>(newCam)->setRelCoor(x,y,z);
-     dynamic_cast<Camera*>(newCam)->target->setRelCoor(0,0,0);
-}
-
-void CameraMan::setRelCameraCoorSoft(const std::string& camName, float x, float y, float z, float bias)
-{
-     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
-     dynamic_cast<Camera*>(newCam)->setRelCoorSoft(x,y,z,bias);
-     dynamic_cast<Camera*>(newCam)->target->setRelCoorSoft(0,0,0,bias);
-}
-
-void CameraMan::pauseCamera(const std::string& camName, bool stop)
-{
-     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
-     dynamic_cast<Camera*>(newCam)->pauseTrack(stop);
-}
-
-void CameraMan::setCam(unsigned int cameraNo)
-{
-  if (cameraNo<cameras.size())
-  {
-    this->setCam( cameras[cameraNo]);
-  }
-}
-
-void CameraMan::setCam(const std::string& camName)
-{
-  BaseObject* object = ObjectListBase::getBaseObject("Camera", camName);
-
-  if(object != NULL)
-  {
-    this->setCam(dynamic_cast<Camera*>(object));
-    return;
-  }
-  printf("ERROR CAMERAMANAGER: Couldn't set camera : %s \n", camName.c_str());
-}
-
-
-void CameraMan::setCam(Camera* camera)
-{
-  if( camera == NULL)
-  {
-    PRINTF(0)("trying to add a zero camera! uiuiui!\n");
-    return;
-  }
-  
-  this->currentCam = camera;
-
-  State::setCamera(currentCam, currentCam->getTarget());
-  OrxSound::SoundEngine::getInstance()->setListener(currentCam);
-
-  // check if it is already added
-  if( ! this->cameraIsInVector(currentCam) )
-    this->cameras.push_back(currentCam);
-
-  this->fadeToBlack->setRelCoor(0., 0., 0.);
-  this->fadeToBlack->setParent(this->currentCam);
-}
-
-
-void CameraMan::moveCurrCam(int x, int y, int z)
-{
-  currentCam->target->trans(x,y,z);
-}
-
-
-void CameraMan::changeCurrTarget(const std::string& className, const std::string& objectName)
-{
-  BaseObject* object = ObjectListBase::getBaseObject(className, objectName);
-  if( object != NULL && object->isA(PNode::staticClassID()))
-  {
-    currentCam->lookAt(dynamic_cast<PNode*>(object));
-    State::setCamera(this->currentCam,  dynamic_cast<CameraTarget*>(object));
-  }
-}
-
-
-void CameraMan::atachCurrCameraToWorldEntity(const std::string& className, const std::string& targetEntity)
-{
-  BaseObject* object = ObjectListBase::getBaseObject(className, targetEntity);
-
-  if(object != NULL && object->isA(PNode::staticClassID()))
-  {
-   this->atachTarget(this->currentCam, dynamic_cast<PNode*>(object));
-   return;
-  }
-
-printf("ERROR CAMERAMANAGER: Couldn't set camera to: %s %s \n", className.c_str(),targetEntity.c_str() );
-}
-
-
-
-void CameraMan::detachCurrCamera()
-{
-  currentCam->target->detach();
-}
-
-
-
-void CameraMan::jumpCurrCam(float x, float y, float z)
-{
-  currentCam->target->jump(x, y, z);
-}
-
-void CameraMan::togglFade()
-{
-  if( this->fadeToBlack)
-    fadeToBlack->toggleFade();
-}
-
-
-void CameraMan::initFadeBlack()
-{
-  if( this->fadeToBlack)
-    fadeToBlack->initFadeBlack();
-}
-
-
-void CameraMan::moveCam(int x, int y, int z, int camNo)
-{
-  cameras[camNo]->target->trans(x,y,z);
-}
-
-
-void CameraMan::changeTarget(int camNo,const std::string& className, const std::string& objectName)
-{
-  BaseObject* object = ObjectListBase::getBaseObject(className, objectName);
-  if( object != NULL && object->isA(PNode::staticClassID()))
-  {
-    cameras[camNo]->lookAt(dynamic_cast<PNode*>(object));
-  }
-}
-
-
-void CameraMan::changeTarget(const std::string& camName,const std::string& className, const std::string& objectName)
-{
-  BaseObject* object = ObjectListBase::getBaseObject(className, objectName);
-  BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
-  if( object != NULL && newCam != NULL && object->isA(PNode::staticClassID()))
-  {
-    dynamic_cast<Camera*>(newCam)->lookAt(dynamic_cast<PNode*>(object));
-    State::setCamera( dynamic_cast<Camera*>(newCam),  dynamic_cast<CameraTarget*>(object));
-  }
-}
-
-
-void CameraMan::atachCameraToWorldEntity(const std::string& cameraName, const std::string& className, const std::string& targetEntity)
-{
-  BaseObject* object = ObjectListBase::getBaseObject(className, targetEntity);
-  BaseObject* targetCam = ObjectListBase::getBaseObject("Camera", cameraName);
-
-  if( object != NULL && targetCam != NULL && object->isA(PNode::staticClassID()) )
-  {
-    this->atachTarget(dynamic_cast<Camera*>(targetCam), dynamic_cast<PNode*>( object ));
-    return;
-  }
-
-  printf("ERROR CAMERAMANAGER: Couldn't set camera %s to: %s %s \n", cameraName.c_str(), className.c_str(),targetEntity.c_str() );
-}
-
-
-
-void CameraMan::jumpCam(int x, int y, int z, int camNo)
-{
-  cameras[camNo]->target->jump(x, y, z);
-}
-
-
-void CameraMan::jumpCam(const std::string& cameraName, float x, float y, float z)
-{
-  BaseObject* targetCam = ObjectListBase::getBaseObject("Camera", cameraName);
-  if( targetCam != NULL )
-  {
-    dynamic_cast<Camera*>(targetCam)->target->jump( x, y, z );
-  }
-
-}
-
-
-void CameraMan::setClipRegion(float nearCli, float farCli)
-{
-  this->nearClip=nearCli;
-  this->farClip=farCli;
-
-  for(unsigned int i = 0; i < this->cameras.size(); i++)
-    cameras[i]->setClipRegion(nearCli, farCli);
-}
-
-
-
-bool CameraMan::cameraIsInVector(Camera* camera)
-{
-
-  for(std::vector<Camera*>::const_iterator it = cameras.begin(); it != cameras.end(); it++ )
-  {
-    if( (*it) == camera)
-    {
-      return true;
-    }
-  }
-  return false;
-
-
-}
-
-
-void CameraMan::cameraInfo()
-{
-  bool sameCam = (this->currentCam == State::getCamera());
-
-
-  PRINT(0)("==== CameraMan::cameraInfo ===\n");
-  PRINT(0)("=  Camera Name: %s\n", this->currentCam->getName().c_str());
-  PRINT(0)("=  Tests:\n");
-  PRINT(0)("==  State::Cam == this::Cam  %i\n", sameCam);
-  PRINT(0)("==  Parenting Informations:\n");
-  this->currentCam->debugNode(10);
-  PRINT(0)("==============================\n");
-}
-
-
-float CameraMan::getCurrCameraCoorX()
-{ return this->currentCam->getAbsCoorX(); }
-
-float CameraMan::getCurrCameraCoorY()
-{ return this->currentCam->getAbsCoorY(); }
-
-float CameraMan::getCurrCameraCoorZ()
-{ return this->currentCam->getAbsCoorZ(); }
-
-
-
-void CameraMan::atachTarget(Camera* cam ,PNode* target)
-{
-  cam->target->atach(target);
-  cam->setViewMode(Camera::ViewNormal);
-  State::setCamera( cam,  dynamic_cast<CameraTarget*>(target));
-
-}
-
-//how to get a class fkt pointer
-
-//BaseObject* object = ObjectListBase::getBaseObject(className, objectName);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: anches/cleanup/src/world_entities/cameraman.h
===================================================================
--- /branches/cleanup/src/world_entities/cameraman.h	(revision 10590)
+++ 	(revision )
@@ -1,73 +1,0 @@
-#ifndef _CAMERAMAN_H
-#define _CAMERAMAN_H
-
-
-#include <vector>
-#include "base_object.h"
-
-class BlackScreen;
-class Camera;
-class PNode;
-
-class CameraMan : public BaseObject {
-  ObjectListDeclaration(CameraMan);
-
-  private:
-    Camera* currentCam;
-    float nearClip;
-    float farClip;
-    BlackScreen* fadeToBlack;
-
-  public:
-    std::vector<Camera*> cameras;
-    CameraMan(const TiXmlElement* root = NULL);
-    void setCam(unsigned int CameraNo);
-    void setCam(const std::string& camName);
-    void setCam(Camera* camera);
-
-    /// LOADING
-    virtual void loadParams(const TiXmlElement* root);
-    void createCameras(const TiXmlElement* camerasTag);
-    void createCam(const TiXmlElement* root);
-
-    /// POLLING
-    float getCurrCameraCoorX();
-    float getCurrCameraCoorY();
-    float getCurrCameraCoorZ();
-    const Camera* getCurrentCam() const { return this->currentCam; }
-    Camera* getCurrentCam() { return this->currentCam; }
-
-    
-    /// Current camera
-    void moveCurrCam(int x, int y, int z);
-    void changeCurrTarget(const std::string& className, const std::string& objectName);
-    void atachCurrCameraToWorldEntity(const std::string& className, const std::string& targetEntity);
-    void detachCurrCamera();
-    void jumpCurrCam(float x, float y, float z);
-    void togglFade();
-    void initFadeBlack();
-    
-    /// Camera
-    void moveCam(int x, int y, int z,  int camNo);
-    void changeTarget(int camNo, const std::string& className,const std::string& objectName);
-    void changeTarget(const std::string& camName,const std::string& className, const std::string& objectName);
-    void atachCameraToWorldEntity(const std::string& cameraName, const std::string& className, const std::string& targetEntity);
-    void jumpCam(int x, int y, int z, int camNo);
-    void jumpCam(const std::string& cameraName, float x, float y, float z);
-    void setRelCameraCoor(const std::string& cameraName, float x, float y, float z);
-    void setRelCameraCoorSoft(const std::string& cameraName, float x, float y, float z, float bias);
-    //void setViewMode(const std::string& camName, const std::string& viewMode);
-    void pauseCamera(const std::string& camName, bool stop);
-    
-    void changeSpeed(float speed);
-    void setClipRegion(float nearClip, float farClip);
-    void cameraInfo();
-    
-  private:
-    bool cameraIsInVector(Camera* camera);
-    void atachTarget(Camera* cam, PNode* pnode);
-    
-
-};
-
-#endif /* _CAMERAMAN_H */
Index: anches/cleanup/src/world_entities/character_attributes.cc
===================================================================
--- /branches/cleanup/src/world_entities/character_attributes.cc	(revision 10590)
+++ 	(revision )
@@ -1,378 +1,0 @@
-
-
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer: ...
-*/
-
-
-#include "character_attributes.h"
-
-
-ObjectListDefinition(CharacterAttributes);
-
-
-/**
- *  standard constructor
-   @todo this constructor is not jet implemented - do it
-*/
-CharacterAttributes::CharacterAttributes ()
-{
-  this->registerObject(this, CharacterAttributes::_objectList);
-}
-
-
-/**
- *  standard deconstructor
-
-*/
-CharacterAttributes::~CharacterAttributes ()
-{
-}
-
-
-/*=====================health=====================*/
-
-/**
- *  sets the health of the character
- * @param helath
- */
-void CharacterAttributes::setHealth(int health)
-{
-  this->health = health;
-}
-
-/**
- *  adds health to the charater
- * @param health
- * @returns health that couldnt be added due to healt limit, 0 if everything worked as normal
- */
-int CharacterAttributes::addHealth(int health)
-{
-  this->health += health;
-  int rest = this->healthMax - this->health;
-  if( rest < 0)
-    {
-      this->health = this->healthMax;
-      return 0;
-    }
-  return rest;
-}
-
-/**
- *  remove health due to damager for example
- * @param amount of health
- * @returns false if health is zero -> dead
- */
-bool CharacterAttributes::substractHealth(int health)
-{
-  this->health -= health;
-  if( this->health < 0)
-    {
-      this->health = 0;
-      return false;
-    }
-  return true;
-}
-
-/**
- *  gets the current amount of health
- * @returns health
- */
-int CharacterAttributes::getHealth()
-{
-  return this->health;
-}
-
-
-/**
- *  sets maximum health
- * @param health
-
-   if healthMax = 0 -> unlimited
- */
-void CharacterAttributes::setHealthMax(int healthMax)
-{
-  this->healthMax = healthMax;
-}
-
-/**
- *  gets health maximium
- * @returns the health maximum
- */
-int CharacterAttributes::getHealthMax()
-{
-  return this->healthMax;
-}
-
-
-/*======================armor/ shields===================== */
-/**
- *  sets the shild strength
- * @param strength
- */
-void CharacterAttributes::setShieldStrength(int shieldStrength)
-{
-  this->shieldStrength = shieldStrength;
-}
-
-/**
- *  adds shield strength
- * @param strength
-
-   there is currently no limit to shieldstrength
- */
-void CharacterAttributes::addShieldStrength(int shiledStrength)
-{
-  this->shieldStrength += shieldStrength;
-}
-
-/**
- *  substracts shield strength
- * @param strength
- * @returns amount of shield strength below zero after substraction. Magic: Troumble. if everything works allright, it returns 0
- */
-int CharacterAttributes::substractShieldStrength(int shieldStrength)
-{
-  int rest = this->shieldStrength -= shieldStrength;
-  if( rest < 0)
-    {
-      this->shieldStrength = 0;
-      return -rest;
-    }
-  return 0;
-}
-
-/**
- *  gets shield strength
- * @returns the shield strength
- */
-int CharacterAttributes::getShieldStrength()
-{
-  return this->shieldStrength;
-}
-
-
-/*=====================damage=====================*/
-/**
- *  sets the amount of base damage dealt to all aircrafts
- * @param damage
-
-   There can be a difference between arms that hit a ground/air craft. Eg.
-   a tank will react differently to explosives than something in the air
-   (think about physics)
- */
-void CharacterAttributes::setDamageToAirCraft(int damage)
-{
-  this->damageToAirCraft = damage;
-}
-
-/**
- *  gets the amount of base damage
- * @returns base damage to aircrafts
-
-   There can be a difference between arms that hit a ground/air craft. Eg.
-   a tank will react differently to explosives than something in the air
-   (think about physics)
- */
-int CharacterAttributes::getDamageToAirCraft()
-{
-  return this->damageToAirCraft;
-}
-
-
-/**
- *  sets the amount of base damage dealt to all groundcrafts
- * @param damage
-
-   There can be a difference between arms that hit a ground/air craft. Eg.
-   a tank will react differently to explosives than something in the air
-   (think about physics)
- */
-void CharacterAttributes::setDamageToGroundCraft(int damage)
-{
-  this->damageToGroundCraft = damage;
-}
-
-/**
- * gets the amount of base damage
- * @returns base damage to groundcrafts
-
-   There can be a difference between arms that hit a ground/air craft. Eg.
-   a tank will react differently to explosives than something in the air
-   (think about physics)
- */
-int CharacterAttributes::getDamageToGroundCraft()
-{
-  return this->damageToGroundCraft;
-}
-
-
-/**
- *  sets the damage modifier to the damage that is dealed via laser weapons
- * @param modifier [0..1]
-
-   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
- */
-void CharacterAttributes::setDamageLaserModifier(float modifier)
-{
-  this->damageLaserModifier = modifier;
-}
-
-/**
- *  gets the damage modifier to the damage that is dealed via laser weapons
- * @returns damage modifier
-
-   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
- */
-float CharacterAttributes::getDamageLaserModifier()
-{
-  return this->damageLaserModifier;
-}
-
-
-/**
- *  sets the damage modifier to the damage that is dealed via plasma weapons
- * @param damage modifier
-
-   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
- */
-void CharacterAttributes::setDamagePlasmaModifier(float modifier)
-{
-  this->damagePlasmaModifier = modifier;
-}
-
-/**
- *  gets the damage modifier to the damage that is dealed plasma weapons
- * @returns damage modifier
-
-   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
- */
-float CharacterAttributes::getDamagePlasmaModifier()
-{
-  return this->damagePlasmaModifier;
-}
-
-
-/**
- *  sets the damage modifier to the damage that is dealed via explosives
- * @param damage modifier
-
-   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
- */
-void CharacterAttributes::setDamageExplosiveModifier(float modifier)
-{
-  this->damageExplosiveModifier = modifier;
-}
-
-/**
- *  sets the damage modifier to the damage that is dealed via explosives
- * @returns damage modifier
-
-   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
- */
-float CharacterAttributes::getDamageExplosiveModifier()
-{
-  return this->damageExplosiveModifier;
-}
-
-
-/*=====================energy=====================*/
-/**
- *  sets the amount of energy
- * @param energy
- */
-void CharacterAttributes::setEnergy(int energy)
-{
-  this->energy = energy;
-}
-
-/**
- *  adds energy to the system
- * @param amount of energy
- * @returns amount of energy that is too much due to energy limit
- */
-int CharacterAttributes::addEnergy(int addEnergy)
-{
-  this->energy += addEnergy;
-  int rest = this->energyMax - this->energy;
-  if(rest < 0)
-    {
-      this->energy = 0;
-      return rest;
-    }
-  return 0;
-}
-
-/**
- *  substracts energy from a system
- * @param amount of energy
- * @returns false if there is no energy anymore
- */
-bool CharacterAttributes::substractEnergy(int subEnergy)
-{
-  this->energy -= subEnergy;
-  if(this->energy < 0)
-    {
-      this->energy = 0;
-      return false;
-    }
-  return true;
-}
-
-/**
- *  gets the amount of energy
- * @returns energy
- */
-int CharacterAttributes::getEnergy()
-{
-  return this->energy;
-}
-
-
-/**
- *  sets the energy consumption
- * @param amount of energy
-*/
-void CharacterAttributes::setEnergyConsumption(int energy)
-{
-  this->energyConsumption = energy;
-}
-
-/**
- *  gets the energy consumption
- * @returns amount of energy
-*/
-int CharacterAttributes::getEnergyConsumption()
-{
-  return this->energyConsumption;
-}
-
-
-/**
- *  sets the maximum energy level
- * @param amount of energy
-*/
-void CharacterAttributes::setEnergyMax(int energy)
-{
-  this->energyMax = energy;
-}
-
-/**
- *  gets the max energy level
- * @returns amount of energy
-*/
-int CharacterAttributes::getEnergyMax()
-{
-  return this->energyMax;
-}
Index: anches/cleanup/src/world_entities/character_attributes.h
===================================================================
--- /branches/cleanup/src/world_entities/character_attributes.h	(revision 10590)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*!
- * @file character_attributes.h
- * Definition of the attributes of a character (healt, armor,.. ) whatever is important to the character
- */
-
-#ifndef _CHARACTER_ATTRIBUTES_H
-#define _CHARACTER_ATTRIBUTES_H
-
-#include "base_object.h"
-
-
-//! A class including all important information about a character
-/**
-  its not yet clear, what the character-attributes will be.
-*/
-class CharacterAttributes : public BaseObject {
-    ObjectListDeclaration(CharacterAttributes);
-
- public:
-  CharacterAttributes();
-  virtual ~CharacterAttributes();
-
-  /* health */
-  void setHealth(int health);
-  int addHealth(int health);
-  bool substractHealth(int health);
-  int getHealth();
-
-  void setHealthMax(int healthMax);
-  int getHealthMax();
-
-
-  /* armor/ shields */
-  void setShieldStrength(int shieldStrength);
-  void addShieldStrength(int shiledStrength);
-  int substractShieldStrength(int shieldStrength);
-  int getShieldStrength();
-
-
-  /* damage */
-  void setDamageToAirCraft(int damage);
-  int getDamageToAirCraft();
-
-  void setDamageToGroundCraft(int damage);
-  int getDamageToGroundCraft();
-
-  void setDamageLaserModifier(float modifier);
-  float getDamageLaserModifier();
-
-  void setDamagePlasmaModifier(float modifier);
-  float getDamagePlasmaModifier();
-
-  void setDamageExplosiveModifier(float modifier);
-  float getDamageExplosiveModifier();
-
-
-  /* energy */
-  void setEnergy(int energy);
-  int addEnergy(int addEnergy);
-  bool substractEnergy(int subEnergy);
-  int getEnergy();
-
-  void setEnergyConsumption(int energy);
-  int getEnergyConsumption();
-
-  void setEnergyMax(int energy);
-  int getEnergyMax();
-
-
- private:
-  /* healt */
-  int health;                        //<! the healt of a projectile
-  int healthMax;                     //<! the max healt of a projectile, =0 if no limit
-
-  /* armor/ shields */
-  int shieldStrength;                //<! the shiled strength of a character, =0 if no shields
-
-  /* damage */
-  int damageToAirCraft;              //<! damage dealt to a air craft in case of a hit
-  int damageToGroundCraft;           //<! damage dealt to a ground craft in case of a hit
-
-  float damageLaserModifier;         //<! [0..1] the damage from laser is multiplied with this modifier. there can be things in the world, that are immune to certain damage
-  float damagePlasmaModifier;        //<! [0..1] the damage from plasma is multiplied with this modifier. there can be things in the world, that are immune to certain damage
-  float damageExplosiveModifier;      //<! [0..1] the damage from exposives (rockets, tnt,...) is multiplied with this modifier. there can be things in the world, that are immune to certain damage
-
-  /* energy */
-  int energyConsumption;             //<! if the character defines an action, it will consume energy
-  int energy;                        //<! the current amount of energy saved in this part
-  int energyMax;                     //<! the maximal energy a character can handle
-};
-
-#endif /* _CHARACTER_ATTRIBUTES_H */
Index: /branches/cleanup/src/world_entities/creatures/fps_player.cc
===================================================================
--- /branches/cleanup/src/world_entities/creatures/fps_player.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/creatures/fps_player.cc	(revision 10591)
@@ -32,5 +32,5 @@
 
 #include "aabb.h"
-#include "bsp_entity.h"
+#include "environments/bsp_entity.h"
 
 #include "key_mapper.h"
Index: /branches/cleanup/src/world_entities/effects/billboard.cc
===================================================================
--- /branches/cleanup/src/world_entities/effects/billboard.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/effects/billboard.cc	(revision 10591)
@@ -22,6 +22,6 @@
 #include "glincl.h"
 #include "state.h"
-#include "cameraman.h"
-#include "camera.h"
+#include "tools/cameraman.h"
+#include "tools/camera.h"
 
 #include "debug.h"
Index: /branches/cleanup/src/world_entities/effects/wobblegrid.cc
===================================================================
--- /branches/cleanup/src/world_entities/effects/wobblegrid.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/effects/wobblegrid.cc	(revision 10591)
@@ -24,8 +24,8 @@
 #include "grid.h"
 
-#include "cameraman.h"
-#include "camera.h"
-
-#include <assert.h>
+#include "tools/cameraman.h"
+#include "tools/camera.h"
+
+#include <cassert>
 #include "debug.h"
 
Index: anches/cleanup/src/world_entities/environment.cc
===================================================================
--- /branches/cleanup/src/world_entities/environment.cc	(revision 10590)
+++ 	(revision )
@@ -1,83 +1,0 @@
-
-
-/*
-   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:
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "environment.h"
-
-#include "obj/objModel.h"
-#include "obb_tree.h"
-#include "util/loading/factory.h"
-
-
-ObjectListDefinition(Environment);
-CREATE_FACTORY(Environment);
-
-/**
- *  creates an environment
-*/
-Environment::Environment () : WorldEntity()
-{
-  this->init();
-  this->loadModel("models/ships/bolido.obj");
-//   if(this->obbTree == NULL)
-//     this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
-}
-
-/**
- * create an environment out of a XML-element
- * @param root the XML-element to load the Environment from
- */
-Environment::Environment(const TiXmlElement* root)
-{
-  this->init();
-  if (root != NULL)
-    this->loadParams(root);
-}
-
-/**
- *  deletes an environment
-*/
-Environment::~Environment ()
-{}
-
-/**
- * initialize an Environment
- */
-void Environment::init()
-{
-  this->registerObject(this, Environment::_objectList);
-  this->toList(OM_ENVIRON);
-}
-
-/**
- * loads the Settings of an Environment from an XML-element.
- * @param root the XML-element to load the ELements properties from
- */
-void Environment::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-}
-
-
-/**
- *  ticks the environment
- * @param time the time about which to tick
-*/
-void Environment::tick (float time) {}
-
-
Index: anches/cleanup/src/world_entities/environment.h
===================================================================
--- /branches/cleanup/src/world_entities/environment.h	(revision 10590)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/*!
-  \file environment.h
-  \brief This file handles the environment of the game
-*/
-
-#ifndef _ENVIRONEMENT_H
-#define _ENVIRONEMENT_H
-
-#include "world_entity.h"
-
-//! environment of orxonox
-/**
-   everything that does not interact with the player comes here
-   Environment is a container for all the worldEntities that are non-interactive
-*/
-class Environment : public WorldEntity
-{
-  ObjectListDeclaration(Environment);
-
- public:
-  Environment ();
-  Environment (const TiXmlElement* root);
-  virtual ~Environment ();
-
-  void init();
-  virtual void loadParams(const TiXmlElement* root);
-
-
-
-  virtual void tick (float time);
-
-};
-
-#endif /* _ENVIRONEMENT_H */
Index: /branches/cleanup/src/world_entities/environments/bsp_entity.cc
===================================================================
--- /branches/cleanup/src/world_entities/environments/bsp_entity.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/bsp_entity.cc	(revision 10591)
@@ -0,0 +1,165 @@
+/*
+   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: Claudio Botta
+   co-programmer: ...
+*/
+
+#include "bsp_entity.h"
+
+#include "debug.h"
+#include "loading/resource_manager.h"
+
+
+ObjectListDefinition(BspEntity);
+CREATE_FACTORY(BspEntity);
+
+
+/**
+ * constructs and loads a BspEntity from a XML-element
+ * @param root the XML-element to load from
+ */
+BspEntity::BspEntity(const TiXmlElement* root)
+{
+  this->init();
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+/**
+ * standard deconstructor
+ */
+BspEntity::~BspEntity ()
+{
+  if( this->bspManager != NULL)
+    delete this->bspManager;
+}
+
+
+
+/**
+ * initializes the BspEntity
+ * @todo change this to what you wish
+ */
+void BspEntity::init()
+{
+  this->registerObject(this, BspEntity::_objectList);
+
+  this->bspManager = NULL;
+  this->sortTransparency = 1;
+  this->sortTransparencyMore = 0;
+
+
+  this->name_handle = registerVarId( new SynchronizeableString( &this->name, &this->name_write, "name", PERMISSION_MASTER_SERVER ) );
+
+  this->setSynchronized( true );
+}
+
+
+void BspEntity::setName(const std::string& name)
+{
+  PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str());
+
+  this->name = name;
+
+  // Check wether file exists....
+  if ( File(Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(name)).exists()  ) {
+
+    this->bspManager = new BspManager(this);
+    this->bspManager->sortTransparency = this->sortTransparency;
+    this->bspManager->sortTransparencyMore = this->sortTransparencyMore;
+
+    if(this->bspManager->load(name.c_str(), 0.1f) == -1 ) {
+      this->bspManager = NULL;
+
+    } else {
+      this->toList(OM_ENVIRON); // Success!!!
+    }
+  } else {
+    this->bspManager = NULL;
+    this->toList(OM_DEAD);
+  }
+}
+
+void BspEntity::setTransparency(int sort, int sortMore)
+{
+  this->sortTransparency = sort;
+  this->sortTransparencyMore = sortMore;
+  
+  if (this->bspManager != NULL)
+  {
+    this->bspManager->sortTransparency = sort;
+    this->bspManager->sortTransparencyMore = sortMore;
+  }
+}
+
+/**
+ * loads a BspEntity from a XML-element
+ * @param root the XML-element to load from
+ * @todo make the class Loadable
+ */
+void BspEntity::loadParams(const TiXmlElement* root)
+{
+  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
+  // WorldEntity::loadParam(root);
+
+  LoadParam(root, "Name", this, BspEntity, setName)
+  .describe("Sets the of the BSP file.");
+
+  LoadParam(root, "Transparency", this, BspEntity, setTransparency)
+  .describe("1. argument: true -> sort transparent textures; 2. argument: true -> better but slower sorting")
+  .defaultValues(1, 0);
+  
+  /*  LoadParam(root, "Scale", this, BSpEntity, setScale)
+        .describe("Sets the scale factore of the bsp level.");
+  */
+
+  /**
+   * @todo: make the class Loadable
+   */
+}
+
+
+/**
+ * advances the BspEntity about time seconds
+ * @param time the Time to step
+ */
+void BspEntity::tick(float time)
+{
+  this->bspManager->tick(time);
+}
+
+
+/**
+ * draws this worldEntity
+ */
+void BspEntity::draw () const
+{
+  this->bspManager->draw();
+}
+
+
+/**
+ *
+ *
+ */
+void BspEntity::collidesWith (WorldEntity* entity, const Vector& location)
+{}
+
+void BspEntity::varChangeHandler( std::list< int > & id )
+{
+  if ( std::find( id.begin(), id.end(), this->name_handle ) != id.end() )
+  {
+    this->setName( this->name_write );
+  }
+}
Index: /branches/cleanup/src/world_entities/environments/bsp_entity.h
===================================================================
--- /branches/cleanup/src/world_entities/environments/bsp_entity.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/bsp_entity.h	(revision 10591)
@@ -0,0 +1,51 @@
+/*!
+ * @file bsp_entity.h
+ * @brief description
+*/
+
+#ifndef _BSP_ENTITY_H
+#define _BSP_ENTITY_H
+
+#include "world_entity.h"
+#include "bsp/bsp_manager.h"
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+
+
+//! A Class to ...
+class BspEntity : public WorldEntity
+{
+  ObjectListDeclaration(BspEntity);
+ public:
+  BspEntity(const TiXmlElement* root = NULL);
+  virtual ~BspEntity();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  void setName(const std::string& name);
+  void setTransparency(int sort, int sortMore = 0);
+
+  void init();
+
+  virtual void varChangeHandler( std::list<int> & id );
+
+  virtual void draw() const;
+  virtual void tick(float time);
+  virtual void collidesWith (WorldEntity* entity, const Vector& location);
+
+  /** @returns the BspManager of this entity */
+  inline BspManager* getBspManager() { return this->bspManager; }
+
+ private:
+   BspManager* bspManager;
+
+   std::string name;                   //!< store name
+   std::string name_write;             //!< temp variable to store name
+   int name_handle;                    //!< handle for name
+   int sortTransparency;              //!< sort transparent textures
+   int sortTransparencyMore;          //!< sort transparent textures better
+};
+
+#endif /* _BSP_ENTITY_H */
Index: /branches/cleanup/src/world_entities/environments/environment.cc
===================================================================
--- /branches/cleanup/src/world_entities/environments/environment.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/environment.cc	(revision 10591)
@@ -0,0 +1,83 @@
+
+
+/*
+   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:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "environment.h"
+
+#include "obj/objModel.h"
+#include "obb_tree.h"
+#include "util/loading/factory.h"
+
+
+ObjectListDefinition(Environment);
+CREATE_FACTORY(Environment);
+
+/**
+ *  creates an environment
+*/
+Environment::Environment () : WorldEntity()
+{
+  this->init();
+  this->loadModel("models/ships/bolido.obj");
+//   if(this->obbTree == NULL)
+//     this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
+}
+
+/**
+ * create an environment out of a XML-element
+ * @param root the XML-element to load the Environment from
+ */
+Environment::Environment(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  deletes an environment
+*/
+Environment::~Environment ()
+{}
+
+/**
+ * initialize an Environment
+ */
+void Environment::init()
+{
+  this->registerObject(this, Environment::_objectList);
+  this->toList(OM_ENVIRON);
+}
+
+/**
+ * loads the Settings of an Environment from an XML-element.
+ * @param root the XML-element to load the ELements properties from
+ */
+void Environment::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+}
+
+
+/**
+ *  ticks the environment
+ * @param time the time about which to tick
+*/
+void Environment::tick (float time) {}
+
+
Index: /branches/cleanup/src/world_entities/environments/environment.h
===================================================================
--- /branches/cleanup/src/world_entities/environments/environment.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/environment.h	(revision 10591)
@@ -0,0 +1,34 @@
+/*!
+  \file environment.h
+  \brief This file handles the environment of the game
+*/
+
+#ifndef _ENVIRONEMENT_H
+#define _ENVIRONEMENT_H
+
+#include "world_entity.h"
+
+//! environment of orxonox
+/**
+   everything that does not interact with the player comes here
+   Environment is a container for all the worldEntities that are non-interactive
+*/
+class Environment : public WorldEntity
+{
+  ObjectListDeclaration(Environment);
+
+ public:
+  Environment ();
+  Environment (const TiXmlElement* root);
+  virtual ~Environment ();
+
+  void init();
+  virtual void loadParams(const TiXmlElement* root);
+
+
+
+  virtual void tick (float time);
+
+};
+
+#endif /* _ENVIRONEMENT_H */
Index: /branches/cleanup/src/world_entities/environments/planet.cc
===================================================================
--- /branches/cleanup/src/world_entities/environments/planet.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/planet.cc	(revision 10591)
@@ -0,0 +1,157 @@
+/*
+   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: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "planet.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "static_model.h"
+
+#include "material.h"
+#include "texture.h"
+
+#include "network_game_manager.h"
+#include "converter.h"
+#include "vertex_array_model.h"
+#include "primitive_model.h"
+#include "effects/billboard.h"
+
+#include "debug.h"
+
+
+ObjectListDefinition(Planet);
+CREATE_FACTORY(Planet);
+
+
+/**
+ *  initializes a skybox from a XmlElement
+*/
+Planet::Planet(const TiXmlElement* root)
+{
+  this->registerObject(this, Planet::_objectList);
+  this->toList(OM_GROUP_01);
+
+  this->rotSpeedPlanet = 0.0;
+  this->rotSpeedCloud = 0.0;
+  this->bClouds = false;
+
+  //this->materialPlanet->setIllum(20);
+  //this->materialPlanet->setAmbient(0.1, 0.1, 0.1);
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, this->size, 50);
+  this->setModel(model);
+}
+
+
+/**
+ *  default destructor
+*/
+Planet::~Planet()
+{
+  PRINTF(5)("Deleting Planet\n");
+}
+
+
+void Planet::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "texture", this, Planet, setTexture)
+      .describe("Sets the materialPlanet on the Planet. The string must be the path relative to the data-dir, and without a trailing .jpg");
+
+    LoadParam(root, "size", this, Planet, setSize)
+      .describe("Sets the Size of the Planet (normally this should be 90% of the maximal viewing Distance).");
+
+  LoadParam(root, "cloud-texture", this, Planet, setCloudTexture)
+      .describe("Sets the cloud texture of the planet");
+
+  LoadParam(root, "cloud-rotation", this, Planet, setCloudRotation)
+      .describe("Sets the cloud rotation speed");
+}
+
+
+/**
+ *  Defines which textures should be loaded onto the Planet.
+ * @param textureName the top texture.
+*/
+void Planet::setTexture(const std::string& textureName)
+{
+  this->materialPlanet.setDiffuseMap(textureName);
+}
+
+
+/**
+ *  Defines which textures should be loaded onto the Planet.
+ * @param textureName the top texture.
+*/
+void Planet::setCloudTexture(const std::string& textureName)
+{
+//   this->materialCloud.setDiffuseMap(textureName);
+//   this->halo = new Billboard();
+//   this->halo->setTexture( textureName);
+//   this->halo->setSize(this->size + 5, this->size + 5);
+//   this->halo->setParent( this);
+  this->bClouds = true;
+}
+
+
+void Planet::setCloudRotation(float rotationSpeed)
+{
+  this->rotSpeedCloud = rotationSpeed;
+}
+
+/**
+ * @param size The new size of the Planet
+
+ * do not forget to rebuild the Planet after this.
+*/
+void Planet::setSize(float size)
+{
+  this->size = size;
+}
+
+
+void Planet::tick( float dt)
+{
+  if( dt != 0.)
+    this->shiftDir( Quaternion( this->rotSpeedPlanet * dt, Vector(1,0,0)));
+}
+
+
+/**
+ * draws the planet
+ */
+void Planet::draw() const
+{
+  // draw the clouds
+  this->materialPlanet.select();
+  WorldEntity::draw();
+
+//   if( this->bClouds)
+//   {
+//     glDisable(GL_LIGHTING);
+//     this->materialCloud.select();
+//     WorldEntity::draw(this->cloudModel);
+//     glEnable(GL_LIGHTING);
+//   }
+}
+
+
+
Index: /branches/cleanup/src/world_entities/environments/planet.h
===================================================================
--- /branches/cleanup/src/world_entities/environments/planet.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/planet.h	(revision 10591)
@@ -0,0 +1,59 @@
+/*!
+ * @file planet.h
+ *  Definition of the Planet, that handles the Display of an atmosphere for orxonox.
+ */
+
+#ifndef _PLANET_H
+#define _PLANET_H
+
+/* INCLUDES */
+#include "world_entity.h"
+#include "material.h"
+/* FORWARD DECLARATION */
+class Texture;
+class Billboard;
+
+//! A Class to handle a Planet
+class Planet : public WorldEntity
+{
+  ObjectListDeclaration(Planet);
+
+ public:
+  Planet(const TiXmlElement* root);
+
+  virtual ~Planet();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  void setSize(float size);
+  /** assumes jpg as input-format */
+  void setTexture(const std::string& textureName);
+  void setCloudTexture(const std::string& textureName);
+  void setCloudRotation(float rotationSpeed);
+
+
+
+  virtual void tick( float dt);
+  virtual void draw() const;
+
+
+
+ private:
+  Material        materialPlanet;  //!< Materials for the Planet. sorted by number (0-5) top, bottom, left, right, front, back
+  Material        materialCloud;   //!< the material for the cloud surrounding the planet
+
+  Model*          cloudModel;      //!< the model for the cloud
+
+  bool            bClouds;         //!< true if there are clouds defined
+  float           rotSpeedCloud;   //! cloud rotation speed
+  float           rotSpeedPlanet;  //! planet rotation speed
+  float           size;            //!< Size of the Planet. This should match the frustum maximum range.
+  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
+  char*           textureName;     //!< Name of the Texture
+
+};
+
+#endif  /* _PLANET_H */
+
+
+
Index: /branches/cleanup/src/world_entities/environments/skybox.cc
===================================================================
--- /branches/cleanup/src/world_entities/environments/skybox.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/skybox.cc	(revision 10591)
@@ -0,0 +1,313 @@
+/*
+   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: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "skybox.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "static_model.h"
+
+#include "material.h"
+#include "texture.h"
+
+#include "network_game_manager.h"
+#include "converter.h"
+#include "resource_texture.h"
+
+#include "debug.h"
+
+
+ObjectListDefinition(SkyBox);
+CREATE_FACTORY(SkyBox);
+
+/**
+ * Constructs a SkyBox and takes fileName as a map.
+ * @param fileName the file to take as input for the SkyBox
+*/
+SkyBox::SkyBox(const std::string& fileName)
+{
+  this->preInit();
+  if (!fileName.empty())
+    this->setTextureAndType(fileName, ".jpg");
+  this->postInit();
+}
+
+/**
+ *  initializes a skybox from a XmlElement
+*/
+SkyBox::SkyBox(const TiXmlElement* root)
+{
+  this->preInit();
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  this->postInit();
+}
+
+void SkyBox::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "Materialset", this, SkyBox, setTexture)
+      .describe("Sets the material on the SkyBox. The string must be the path relative to the data-dir, and without a trailing .jpg");
+
+  LoadParam(root, "Size", this, SkyBox, setSize)
+      .describe("Sets the Size of the SkyBox (normally this should be 90% of the maximal viewing Distance).");
+}
+
+void SkyBox::preInit()
+{
+  this->registerObject(this, SkyBox::_objectList);
+  this->toList(OM_BACKGROUND);
+  this->toReflectionList();
+  //this->size = 100.0;
+  this->textureSize = 1024.0f;
+
+  for (int i = 0; i < 6; i++)
+    {
+      this->material[i] = new Material();
+      this->material[i]->setIllum(3);
+      this->material[i]->setDiffuse(0.0,0.0,0.0);
+      this->material[i]->setSpecular(0.0,0.0,0.0);
+      this->material[i]->setAmbient(2.0, 2.0, 2.0);
+
+      this->cubeTexture[i] = NULL;
+    }
+  this->setParentMode(PNODE_MOVEMENT);
+
+  this->textureName = "";
+}
+
+void SkyBox::postInit()
+{
+  this->rebuild();
+
+  textureName_handle = registerVarId( new SynchronizeableString( &textureName, &textureName, "textureName", PERMISSION_MASTER_SERVER) );
+  size_handle = registerVarId( new SynchronizeableFloat( &size, &size, "size", PERMISSION_MASTER_SERVER ) );
+}
+
+
+/**
+ *  default destructor
+*/
+SkyBox::~SkyBox()
+{
+  PRINTF(5)("Deleting SkyBox\n");
+  for (int i = 0; i < 6; i++)
+  {
+    if (this->material[i])
+      delete this->material[i];
+  }
+}
+
+void SkyBox::setTexture(const std::string& name)
+{
+  this->textureName = name;
+  this->setTextureAndType (name, "jpg");
+};
+
+
+/**
+ * @brief sets A set of textures when just giving a Name and an extension:
+ * @param name the prefix of the Name
+ * @param extension the file extension (jpg by default)
+ * usage: give this function an argument like
+ * setTexture("skybox", "jpg");
+ * and it will convert this to
+ * setTextures("skybox_negx.jpg", "skybox_posx.jpg", "skybox_negy.jpg",
+ *             "skybox_posy.jpg", "skybox_negz.jpg", "skybox_posz.jpg");
+ */
+void SkyBox::setTextureAndType(const std::string& name, const std::string& extension)
+{
+  std::string negX = name + "_negx." + extension;
+  std::string posX = name + "_posx." + extension;
+
+  std::string negY = name + "_negy." + extension;
+  std::string posY = name + "_posy." + extension;
+
+  std::string negZ = name + "_negz." + extension;
+  std::string posZ = name + "_posz." + extension;
+
+  this->setTextures(negX, posX, negY, posY, negZ, posZ);
+}
+
+/**
+ * @brief Defines which textures should be loaded onto the SkyBox.
+ * @param negX the top texture.
+ * @param posX the bottom texture.
+ * @param negY the left texture.
+ * @param posY the right texture.
+ * @param negZ the front texture.
+ * @param posZ the back texture.
+*/
+void SkyBox::setTextures(const std::string& negX, const std::string& posX,
+                         const std::string& negY, const std::string& posY,
+                         const std::string& negZ, const std::string& posZ)
+{
+  this->material[0]->setDiffuseMap(negX);
+  this->material[1]->setDiffuseMap(posX);
+  this->material[2]->setDiffuseMap(negY);
+  this->material[3]->setDiffuseMap(posY);
+  this->material[4]->setDiffuseMap(negZ);
+  this->material[5]->setDiffuseMap(posZ);
+  if (GLEW_EXT_texture_cube_map)
+    this->loadCubeMapTextures(negX, posX, negY, posY, negZ, posZ);
+}
+
+void SkyBox::loadCubeMapTextures(const std::string& posY, const std::string& negY, const std::string& negZ,
+                                  const std::string& posZ, const std::string& posX, const std::string& negX)
+{
+  this->cubeTexture[0] = ResourceTexture(negX, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT);
+  this->cubeTexture[1] = ResourceTexture(posX, GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT);
+
+  this->cubeTexture[2] = ResourceTexture(negY, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT);
+  this->cubeTexture[3] = ResourceTexture(posY, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT);
+
+  this->cubeTexture[4] = ResourceTexture(negZ, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT);
+  this->cubeTexture[5] = ResourceTexture(posZ, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT);
+}
+
+void SkyBox::enableCubeMap()
+{
+  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
+  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
+  glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
+
+  glEnable(GL_TEXTURE_CUBE_MAP_EXT);
+
+  glEnable(GL_TEXTURE_GEN_S);
+  glEnable(GL_TEXTURE_GEN_T);
+  glEnable(GL_TEXTURE_GEN_R);
+
+}
+
+void SkyBox::disableCubeMap()
+{
+  glDisable(GL_TEXTURE_CUBE_MAP);
+  glDisable(GL_TEXTURE_2D);
+  glDisable(GL_TEXTURE_GEN_S);
+  glDisable(GL_TEXTURE_GEN_T);
+  glDisable(GL_TEXTURE_GEN_R);
+
+  glDisable(GL_TEXTURE_GEN_S);
+  glDisable(GL_TEXTURE_GEN_T);
+  glDisable(GL_TEXTURE_GEN_R);
+}
+
+
+
+/**
+ * @param size The new size of the SkyBox
+
+ * do not forget to rebuild the SkyBox after this.
+*/
+void SkyBox::setSize(float size)
+{
+  this->size = size;
+}
+
+
+
+void SkyBox::draw()
+{
+  glPushAttrib(GL_ENABLE_BIT);
+//   glPushAttrib(GL_LIGHTING_BIT);
+  glDisable(GL_LIGHTING);
+
+  glDisable(GL_FOG);
+
+  WorldEntity::draw();
+
+  glPopAttrib();
+
+}
+
+
+/**
+ *  rebuilds the SkyBox
+
+   this must be done, when changing the Size of the Skybox (runtime-efficency)
+*/
+void SkyBox::rebuild()
+{
+  StaticModel* model = new StaticModel();
+
+  model->addVertex (-0.5*size, -0.5*size, 0.5*size);
+  model->addVertex (0.5*size, -0.5*size, 0.5*size);
+  model->addVertex (-0.5*size, 0.5*size, 0.5*size);
+  model->addVertex (0.5*size, 0.5*size, 0.5*size);
+  model->addVertex (-0.5*size, 0.5*size, -0.5*size);
+  model->addVertex (0.5*size, 0.5*size, -0.5*size);
+  model->addVertex (-0.5*size, -0.5*size, -0.5*size);
+  model->addVertex (0.5*size, -0.5*size, -0.5*size);
+
+//   model->addVertexTexture (0.0, 1.0);
+//   model->addVertexTexture (1.0, 1.0);
+//   model->addVertexTexture (1.0, 0.0);
+//   model->addVertexTexture (0.0, 0.0);
+
+  model->addVertexTexture (1.0/this->textureSize, (this->textureSize - 1.0)/this->textureSize);
+  model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, (this->textureSize - 1.0)/this->textureSize);
+  model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, 1.0/this->textureSize);
+  model->addVertexTexture (1.0/this->textureSize, 1.0/this->textureSize);
+
+
+  model->addVertexNormal (0.0, 0.0, 1.0);
+  model->addVertexNormal (0.0, 1.0, 0.0);
+  model->addVertexNormal (0.0, 0.0, -1.0);
+  model->addVertexNormal (0.0, -1.0, 0.0);
+  model->addVertexNormal (1.0, 0.0, 0.0);
+  model->addVertexNormal (-1.0, 0.0, 0.0);
+
+  model->setMaterial(material[0]);
+  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
+  model->setMaterial(material[1]);
+  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,5); // front
+  model->setMaterial(material[2]);
+  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,1, 7,1,1, 1,2,1, 0,3,1); // bottom
+  model->setMaterial(material[3]);
+  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,0,3, 3,1,3, 5,2,3, 4,3,3); // top
+  model->setMaterial(material[4]);
+  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,2, 5,3,2, 7,0,2, 6,1,2); // left
+  model->setMaterial(material[5]);
+  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,0, 3,2,0, 2,3,0); // right
+
+  model->finalize();
+
+  this->setModel(model);
+}
+
+void SkyBox::varChangeHandler( std::list< int > & id )
+{
+  bool somethinChanged = false;
+
+  if ( std::find( id.begin(), id.end(), textureName_handle ) != id.end() )
+  {
+    somethinChanged = true;
+    setTexture( textureName );
+  }
+
+  if ( std::find( id.begin(), id.end(), size_handle ) != id.end() )
+  {
+    somethinChanged = true;
+  }
+
+  rebuild();
+
+  WorldEntity::varChangeHandler( id );
+}
Index: /branches/cleanup/src/world_entities/environments/skybox.h
===================================================================
--- /branches/cleanup/src/world_entities/environments/skybox.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/skybox.h	(revision 10591)
@@ -0,0 +1,81 @@
+/*!
+ * @file skybox.h
+ *  Definition of the SkyBox, that handles the Display of an atmosphere for orxonox.
+ *
+ * A SkyBox is always centered at the current working Camera, and will only obey the cameras
+ * movment but not its rotation.
+*/
+
+#ifndef _SKYBOX_H
+#define _SKYBOX_H
+
+/* INCLUDES */
+#include "world_entity.h"
+#include "material.h"
+
+enum SKY_SIDE
+{
+  SKY_BACK = 0,
+  SKY_FRONT,
+  SKY_BOTTOM,
+  SKY_TOP,
+  SKY_LEFT,
+  SKY_RIGHT,
+};
+
+//! A Class to handle a SkyBox
+class SkyBox : public WorldEntity
+{
+  ObjectListDeclaration(SkyBox);
+public:
+  SkyBox(const std::string& fileName = "");
+  SkyBox(const TiXmlElement* root);
+
+  virtual ~SkyBox();
+
+  void init();
+  void preInit();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  void postInit();
+
+  virtual void draw();
+
+  void setSize(float size);
+  /** assumes jpg as input-format */
+  void setTexture(const std::string& name);
+
+  void setTextureAndType(const std::string& name, const std::string& extension);
+  void setTextures(const std::string& negX, const std::string& posX, const std::string& negY,
+                   const std::string& posY, const std::string& negZ, const std::string& posZ);
+
+  void loadCubeMapTextures(const std::string& negX, const std::string& posX, const std::string& negY,
+                           const std::string& posY, const std::string& negZ, const std::string& posZ);
+
+  GLuint getTexture(SKY_SIDE side) const { return (this->material[side]) ? this->material[side]->diffuseTextureID(): 0; };
+
+  static void enableCubeMap();
+  static void disableCubeMap();
+
+  virtual void varChangeHandler( std::list<int> & id );
+
+ private:
+  void rebuild();
+
+  Material*       material[6];     //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
+  Texture         cubeTexture[6];  //!< Textures for the CubeMap.
+
+  float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
+  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
+  std::string     textureName;     //!< Name of the Texture
+
+  int textureName_handle;          //!< used to notify about changes of textureName
+  int size_handle;                 //!< used to notify about changes of size
+
+};
+
+#endif  /* _SKYBOX_H */
+
+
+
Index: /branches/cleanup/src/world_entities/environments/skydome.cc
===================================================================
--- /branches/cleanup/src/world_entities/environments/skydome.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/skydome.cc	(revision 10591)
@@ -0,0 +1,229 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2006 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: hdavid, amaechler
+   co-programmer: ...
+*/
+
+#include "skydome.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "static_model.h"
+#include "shader.h"
+
+#include "network_game_manager.h"
+#include "converter.h"
+
+#include "debug.h"
+
+#define DTOR (PI/180.0f)
+#define SQR(x) (x*x)
+
+
+
+ObjectListDefinition(Skydome);
+
+/**
+ *  initializes a skybox from a XmlElement
+ */
+Skydome::Skydome()
+{
+  this->init();
+}
+
+
+void Skydome::init()
+{
+  PRINTF(4)("Skydome init\n");
+
+  this->registerObject(this, Skydome::_objectList);
+  this->toList(OM_BACKGROUND);
+  this->toReflectionList();
+  this->indices = NULL;
+  this->vertices = NULL;
+  this->planeVertices = NULL;
+  this->shader = NULL;
+  activateDome = false;
+
+}
+
+
+/**
+ *  default destructor
+ */
+Skydome::~Skydome()
+{
+  PRINTF(4)("Deleting Skydome\n");
+
+  if (glIsTexture(texture))
+    glDeleteTextures(1, &texture);
+}
+
+
+void Skydome::setShader(Shader* shader)
+{
+  this->shader = shader;
+}
+
+void Skydome::setTexture(GLuint texture)
+{
+  this->texture = texture;
+}
+
+
+void Skydome::activate()
+{
+  this->activateDome = true;
+}
+
+void Skydome::deactivate()
+{
+  this->activateDome = false;
+}
+
+
+void Skydome::draw() const
+{
+  if(!activateDome)
+    return;
+
+  glPushAttrib(GL_ENABLE_BIT);
+
+  glDisable(GL_LIGHTING);
+  glDisable(GL_BLEND);
+  glDisable(GL_FOG);
+
+  glEnable(GL_TEXTURE_3D);
+  glBindTexture(GL_TEXTURE_3D, texture);
+
+  if ( this->shader && Shader::isSupported() )
+  {
+    this->shader->activateShader();
+  
+    glPushMatrix();
+    glTranslatef(0.0f,pRadius,0.0f);
+  
+    glBegin(GL_TRIANGLES);
+    for (int i=0; i < numIndices; i++)
+    {
+      glColor3f(1.0f, 1.0f, 1.0f);
+  
+      glTexCoord2f(planeVertices[indices[i]].u, planeVertices[indices[i]].v);
+      glVertex3f(planeVertices[indices[i]].x, planeVertices[indices[i]].y, planeVertices[indices[i]].z);
+    }
+    glEnd();
+  
+    WorldEntity::draw();
+  
+    glPopMatrix();
+  
+    this->shader->deactivateShader();
+  }
+  glPopAttrib();
+}
+
+
+void Skydome::generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius, float hTile, float vTile)
+{
+  PRINTF(0)("Generating a sky plane\n");
+
+  // Make sure our vertex array is clear
+  if (planeVertices)
+  {
+    delete planeVertices;
+    planeVertices = NULL;
+  }
+
+  // Make sure our index array is clear
+  if (indices)
+  {
+    delete indices;
+    indices = NULL;
+  }
+
+  // Set the number of divisions into a valid range
+  int divs = divisions;
+  if (divisions < 1)
+    divs = 1;
+
+  if (divisions > 256)
+    divs = 256;
+
+  pRadius = planetRadius;
+
+  // Initialize the Vertex and indices arrays
+  numPlaneVertices = (divs + 1) * (divs + 1);   // 1 division would give 4 verts
+  numIndices  = divs * divs * 2 * 3;       // 1 division would give 6 indices for 2 tris
+
+  planeVertices = new VertexInfo[numPlaneVertices];
+  memset(planeVertices, 0, sizeof(VertexInfo));
+
+  indices = new int[numIndices];
+  memset(indices, 0, sizeof(int)*numIndices);
+
+  // Calculate some values we will need
+  float plane_size = 2.0f * (float)sqrt((SQR(atmosphereRadius)-SQR(planetRadius)));
+  float delta = plane_size/(float)divs;
+  float tex_delta = 2.0f/(float)divs;
+
+  // Variables we'll use during the dome's generation
+  float x_dist   = 0.0f;
+  float z_dist   = 0.0f;
+  float x_height = 0.0f;
+  float z_height = 0.0f;
+  float height = 0.0f;
+
+  VertexInfo SV; // temporary vertex
+
+  for (int i=0;i <= divs;i++)
+  {
+    for (int j=0; j <= divs; j++)
+    {
+      x_dist = (-0.5f * plane_size) + ((float)j*delta);
+      z_dist = (-0.5f * plane_size) + ((float)i*delta);
+
+      x_height = (x_dist*x_dist) / atmosphereRadius;
+      z_height = (z_dist*z_dist) / atmosphereRadius;
+      height = x_height + z_height;
+
+      SV.x = x_dist;
+      SV.y = 0.0f - height;
+      SV.z = z_dist;
+
+      // Calculate the texture coordinates
+      SV.u = hTile*((float)j * tex_delta*0.5f);
+      SV.v = vTile*(1.0f - (float)i * tex_delta*0.5f);
+
+      planeVertices[i*(divs+1)+j] = SV;
+    }
+  }
+
+  // Calculate the indices
+  int index = 0;
+  for (int i=0; i < divs;i++)
+  {
+    for (int j=0; j < divs; j++)
+    {
+      int startvert = (i*(divs+1) + j);
+
+      // tri 1
+      indices[index++] = startvert;
+      indices[index++] = startvert+1;
+      indices[index++] = startvert+divs+1;
+
+      // tri 2
+      indices[index++] = startvert+1;
+      indices[index++] = startvert+divs+2;
+      indices[index++] = startvert+divs+1;
+    }
+  }
+}
Index: /branches/cleanup/src/world_entities/environments/skydome.h
===================================================================
--- /branches/cleanup/src/world_entities/environments/skydome.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/skydome.h	(revision 10591)
@@ -0,0 +1,67 @@
+/*!
+ * @file skydome.h
+ */
+
+#ifndef _SKYDOME_H
+#define _SKYDOME_H
+
+/* INCLUDES */
+#include "world_entity.h"
+#include "shader.h"
+
+//   typedef struct VERTEX
+// {
+//   float x,y,z;
+//   unsigned int color;
+//   float u, v;
+// }  ;
+
+
+//! A Class to handle a SkyDome
+class Skydome : public WorldEntity
+{
+  ObjectListDeclaration(Skydome);
+public:
+  Skydome();
+
+  virtual ~Skydome();
+
+  void init();
+  virtual void draw() const;
+
+  void generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius,
+                        float hTile, float vTile);
+
+  void setShader(Shader* shader);
+  void setTexture(GLuint texture);
+
+  void activate();
+  void deactivate();
+
+private:
+
+  typedef struct VertexInfo
+  {
+    float x,y,z;
+    unsigned int color;
+    float u, v;
+  };
+
+  bool activateDome;
+
+  VertexInfo *planeVertices;
+  int numPlaneVertices;
+
+  int *indices;
+  int numIndices;
+
+  float pRadius;
+
+  VertexInfo *vertices;
+  int numVertices;
+
+  GLuint texture;
+  Shader* shader;
+};
+
+#endif  /* _SKYDOME_H */
Index: /branches/cleanup/src/world_entities/environments/skysphere.cc
===================================================================
--- /branches/cleanup/src/world_entities/environments/skysphere.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/skysphere.cc	(revision 10591)
@@ -0,0 +1,121 @@
+/*
+   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: David Gruetter
+   co-programmer: Benjamin Grauer
+
+   Created by Dave: this file is actually quite similar to player.cc and so is
+   skybox.h similar to player.h
+   With that said, things should be clear:)
+
+   Edited:
+   Bensch: more constructors, changeability, comments...
+   Patrick: giving it the common orxonox style, not much to do... good work Dave!
+
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "skysphere.h"
+
+#include "material.h"
+#include "debug.h"
+
+
+ObjectListDefinition(Skysphere);
+
+/**
+ *  Constructs a SkySphere and takes fileName as a map.
+ * @param fileName the file to take as input for the skysphere
+*/
+Skysphere::Skysphere(char* fileName)
+{
+  this->registerObject(this, Skysphere::_objectList);
+  this->toList(OM_BACKGROUND);
+  if (fileName == NULL)
+    this->initialize("textures/sky-replace.jpg");
+  else
+    this->initialize(fileName);
+}
+
+
+/**
+ *  default destructor
+*/
+Skysphere::~Skysphere()
+{
+  PRINTF(3)("Deleting the SkySphere\n");
+  delete this->skyMaterial;
+  gluDeleteQuadric(this->sphereObj);
+}
+
+/**
+ *  initializes the Skysphere.
+ * @param fileName the file to take as input for the skysphere
+*/
+void Skysphere::initialize(char* fileName)
+{
+  PRINTF(1)("initializing the Skysphere with Material %s.\n", fileName);
+  this->sphereObj = gluNewQuadric();
+  this->setParentMode(PNODE_MOVEMENT);
+
+  gluQuadricTexture(this->sphereObj, GL_TRUE);
+  this->setRadius(1900.0);
+
+  this->skyMaterial = new Material("Sky");
+  this->setTexture(fileName);
+  this->skyMaterial->setIllum(3);
+  this->skyMaterial->setAmbient(1.0, 1.0, 1.0);
+}
+
+
+/**
+ *  Defines which texture should be loaded onto the skysphere.
+ * @param fileName The filename of the Texture
+*/
+void Skysphere::setTexture(char* fileName)
+{
+  this->skyMaterial->setDiffuseMap(fileName);
+}
+
+
+/**
+ *  draws the Skysphere
+
+   This part is normally precessed in the "Painting Phase".
+*/
+void Skysphere::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  Vector r = this->getAbsCoor();
+  glTranslatef(r.x, r.y, r.z);
+
+  //glRotatef(-30, 1, 0, 0);
+  //glRotatef(95.0f, 0.0f, 0.0f, 1.0f);
+  //glRotatef(-250.0f, 0.0, 1.0f, 0.0f);
+
+  skyMaterial->select();
+  gluSphere(this->sphereObj, this->sphereRadius, 20, 20);
+  glPopMatrix();
+}
+
+
+/**
+ *  sets the Radius of the Sphere.
+ * @param radius The Radius of The Sphere
+*/
+void Skysphere::setRadius(float radius)
+{
+  this->sphereRadius = radius;
+}
Index: /branches/cleanup/src/world_entities/environments/skysphere.h
===================================================================
--- /branches/cleanup/src/world_entities/environments/skysphere.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/skysphere.h	(revision 10591)
@@ -0,0 +1,49 @@
+/*!
+ * @file skysphere.h
+  *  Definition of the Skysphere, that handles the Display of an atmosphere of orxonox.
+
+    A SkySphere is always centered at the current working Camera, and will only obey the cameras
+    movment but not its rotation.
+
+    @todo self-rotation
+    @todo handle reference to parent-object
+*/
+
+#ifndef _SKYSPHERE_H
+#define _SKYSPHERE_H
+
+/* INCLUDES */
+#include "world_entity.h"
+#include "glincl.h"
+
+/* FORWARD DECLARATION */
+class Material;
+class Vector;
+
+//! A Class to handle a SkySphere
+class Skysphere : public WorldEntity
+{
+  ObjectListDeclaration(Skysphere);
+
+ public:
+  Skysphere(char* fileName = NULL);
+  virtual ~Skysphere();
+
+  void setRadius(float radius);
+  void setTexture(char* fileName);
+
+  virtual void draw() const;
+
+  private:
+    void initialize(char* fileName);
+
+ private:
+  GLUquadricObj*    sphereObj;           //!< A Placeholder for the SkySphere.
+  Material*         skyMaterial;         //!< A Material for the SkySphere.
+  float             sphereRadius;        //!< Radius of the SkySphere. This should match the frustum maximum range.
+};
+
+#endif  /* _SKYSPHERE_H */
+
+
+
Index: /branches/cleanup/src/world_entities/environments/terrain.cc
===================================================================
--- /branches/cleanup/src/world_entities/environments/terrain.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/terrain.cc	(revision 10591)
@@ -0,0 +1,429 @@
+/*
+   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: Benjamin Grauer
+   co-programmer: ...
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "terrain.h"
+
+#include "util/loading/resource_manager.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "spatial_separation.h"
+
+#include "model.h"
+#include "network_game_manager.h"
+
+#include "height_map.h"
+#include "material.h"
+
+#include "glincl.h"
+
+#include "state.h"
+#include "debug.h"
+
+
+ObjectListDefinition(Terrain);
+CREATE_FACTORY(Terrain);
+
+/**
+ *  standard constructor
+ */
+Terrain::Terrain (const TiXmlElement* root)
+{
+  this->init();
+
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  //  if (this->model != NULL)
+  //this->ssp = new SpatialSeparation((Model*)this->model, 10.0f);
+}
+
+
+/**
+ *  Constructor for loading a Terrain out of a file
+ * @param fileName The file to load data from.
+
+   this either loads out of an OBJ-file, or loads a heightmap if no .obj-extension is found.
+*/
+Terrain::Terrain(const std::string& fileName)
+{
+  this->init();
+
+  if (fileName.rfind(".obj" ) != std::string::npos || fileName.rfind(".OBJ") != std::string::npos )
+  {
+    this->loadModel(fileName);
+  }
+  else
+  {
+    // load the hightMap here.
+  }
+}
+
+/**
+ *  a Constructor for the Debug-Worlds
+ */
+Terrain::Terrain(DebugTerrain debugTerrain)
+{
+  this->init();
+  this->buildDebugTerrain(debugTerrain);
+}
+
+/**
+ *  standard deconstructor
+
+*/
+Terrain::~Terrain ()
+{
+  if (modelList)
+    glDeleteLists(this->modelList, 1);
+  if( this->ssp)
+    delete ssp;
+
+  if(this->heightMap)
+    delete heightMap;
+}
+
+
+void Terrain::init()
+{
+  this->registerObject(this, Terrain::_objectList);
+  this->toList(OM_ENVIRON_NOTICK);
+  this->toReflectionList();
+
+  this->modelList = 0;
+  this->ssp = NULL;
+  this->vegetation = NULL;
+
+  this->heightMap = NULL;
+
+  this->heightMapMaterial = new Material();
+}
+
+
+void Terrain::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "scale", this, Terrain, setScale)
+  .describe("The scale in x,y,z direction");
+
+  LoadParam(root, "texture", this, Terrain, loadTexture)
+  .describe("The name of the Texture for this heightMap");
+
+  LoadParam(root, "vegetation", this, Terrain, loadVegetation)
+  .describe("the fileName of the vegetation, that should be loaded onto this terrain. (must be relative to the data-dir)") ;
+
+  LoadParam(root, "height-map", this, Terrain, loadHeightMap)
+  .describe("The HeightMap, splitted into two strings seperated by ','. 1: HeighMap, 2: ColorMap");
+
+}
+
+void Terrain::setScale(float x, float y, float z)
+{
+  this->terrainScale = Vector(x, y, z);
+}
+
+void Terrain::loadHeightMap(const std::string& heightMapFile, const std::string& colorMap)
+{
+  if (this->heightMap != NULL)
+    delete this->heightMap;
+  this->heightMap = NULL;
+
+  std::string hmName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(heightMapFile);
+  std::string hmColorName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(colorMap);
+
+
+  this->heightMap = new HeightMap(hmName, hmColorName);
+  //   heightMap->scale(Vector(43.0f,4.7f,43.0f));
+  heightMap->scale(this->terrainScale);
+  heightMap->setAbsCoor(this->getAbsCoor());
+  heightMap->load();
+}
+
+
+void Terrain::loadTexture(const std::string& textureName)
+{
+  PRINTF(4)("Load texture: %s\n", textureName.c_str());
+
+  heightMapMaterial->setDiffuse(1.0,1.0,1.0);
+  heightMapMaterial->setAmbient(1.0,1.0,1.0 );
+  heightMapMaterial->setSpecular(1.0,1.0,1.0);
+  heightMapMaterial->setShininess(.5);
+  heightMapMaterial->setTransparency(1.0);
+
+  heightMapMaterial->setDiffuseMap(textureName);
+  //   heightMapMaterial->setAmbientMap(textureName);
+  //   heightMapMaterial->setSpecularMap(textureName);
+}
+
+
+
+void Terrain::loadVegetation(const std::string& vegetationFile)
+{
+  PRINTF(4)("loadVegetation: %s\n", vegetationFile.c_str());
+  if (this->vegetation)
+    this->vegetation = 0;
+  if (!vegetationFile.empty())
+  {
+    PRINTF(4)("fetching %s\n", vegetationFile.c_str());
+    this->loadModel(vegetationFile, 1.0, 2);
+    this->vegetation = this->getModel(2);
+  }
+  else
+    this->vegetation = NULL;
+}
+
+
+
+
+
+void Terrain::draw () const
+{
+  glPushMatrix();
+
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  /* rotate */
+  // Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  //glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+  if (this->modelList)
+    glCallList(this->modelList);
+  else if (this->getModel())
+    this->getModel()->draw();
+
+  if (this->vegetation)
+    this->vegetation->draw();
+
+  if( this->heightMap)
+  {
+    this->heightMapMaterial->select();
+
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+    this->heightMap->draw();
+  }
+  glPopMatrix();
+
+
+  /*
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+    glLoadIdentity();
+    Vector camera =   State::getCameraNode()->getAbsCoor(); // Go on here ..........!!!
+
+    float height =    heightMap->getHeight(camera.x, camera.z);
+
+    glEnable (GL_COLOR_MATERIAL) ;
+    glBegin(GL_QUADS);            // Draw The Cube Using quads
+    glColor3f(0.0f,1.0f,0.0f);  // Color Blue
+    glVertex3f(camera.x + 63.0f,Terrain->getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Right Of The Quad (Top)
+    glVertex3f(camera.x-63.0f, getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Left Of The Quad (Top)
+    glVertex3f(camera.x-63.0f, getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Left Of The Quad (Top)
+    glVertex3f(camera.x+ 63.0f, getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Right Of The Quad (Top)
+    glEnd();                      // End Drawing The Plan
+
+    glPopMatrix();*/
+
+
+  /* THIS IS ONLY FOR DEBUGGING INFORMATION */
+  //  if (this->ssp != NULL)
+  //    this->ssp->drawQuadtree();
+}
+
+
+void Terrain::buildDebugTerrain(DebugTerrain debugTerrain)
+{
+  // if the terrain is the Terrain of Dave
+  if (debugTerrain == TERRAIN_DAVE)
+  {
+    modelList = glGenLists(1);
+    glNewList (modelList, GL_COMPILE);
+
+    glColor3f(1.0,0,0);
+
+    int sizeX = 100;
+    int sizeZ = 80;
+    float length = 1000;
+    float width = 200;
+    float widthX = float (length /sizeX);
+    float widthZ = float (width /sizeZ);
+
+    float height [sizeX][sizeZ];
+    Vector normal_vectors[sizeX][sizeZ];
+
+
+    for ( int i = 0; i<sizeX-1; i+=1)
+      for (int j = 0; j<sizeZ-1;j+=1)
+        //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
+#ifdef __WIN32__
+        height[i][j]=(sin((float)j/3)*rand()*i/182400)*.5;
+#else
+        height[i][j]=(sin((float)j/3)*rand()*(long)i/6282450500.0)*.5;
+#endif
+
+    //Die Huegel ein wenig glaetten
+    for (int h=1; h<2;h++)
+      for (int i=1;i<sizeX-2 ;i+=1 )
+        for(int j=1;j<sizeZ-2;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<sizeX-2;i+=1)
+      for(int j=1;j<sizeZ-2 ;j+=1)
+      {
+        Vector v1 = Vector (widthX*(1),      height[i][j],      widthZ*(j) );
+        Vector v2 = Vector (widthX*(i-1),    height[i-1][j],    widthZ*(j));
+        Vector v3 = Vector (widthX*(i),      height[i][j+1],    widthZ*(j+1));
+        Vector v4 = Vector (widthX*(i+1),    height[i+1][j],    widthZ*(j));
+        Vector v5 = Vector (widthX*(i),      height[i][j-1],    widthZ*(j-1));
+
+        Vector c1 = v2 - v1;
+        Vector c2 = v3 - v1;
+        Vector c3=  v4 - v1;
+        Vector c4 = v5 - v1;
+        Vector zero = Vector (0,0,0);
+        normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4);
+        normal_vectors[i][j].normalize();
+      }
+
+    glBegin(GL_QUADS);
+    int snowheight=3;
+    for ( int i = 0; i<sizeX; i+=1)
+      for (int j = 0; j<sizeZ;j+=1)
+      {
+        Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
+        Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
+        Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
+        Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
+        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();
+    glEndList();
+  }
+
+  if (debugTerrain == TERRAIN_BENSCH)
+  {
+    /*
+      this->model = (OBJModel*) new Model();
+    this->model->setName("CUBE");
+    this->model->addVertex (-0.5, -0.5, 0.5);
+    this->model->addVertex (0.5, -0.5, 0.5);
+    this->model->addVertex (-0.5, 0.5, 0.5);
+    this->model->addVertex (0.5, 0.5, 0.5);
+    this->model->addVertex (-0.5, 0.5, -0.5);
+    this->model->addVertex (0.5, 0.5, -0.5);
+    this->model->addVertex (-0.5, -0.5, -0.5);
+    this->model->addVertex (0.5, -0.5, -0.5);
+
+    this->model->addVertexTexture (0.0, 0.0);
+    this->model->addVertexTexture (1.0, 0.0);
+    this->model->addVertexTexture (0.0, 1.0);
+    this->model->addVertexTexture (1.0, 1.0);
+    this->model->addVertexTexture (0.0, 2.0);
+    this->model->addVertexTexture (1.0, 2.0);
+    this->model->addVertexTexture (0.0, 3.0);
+    this->model->addVertexTexture (1.0, 3.0);
+    this->model->addVertexTexture (0.0, 4.0);
+    this->model->addVertexTexture (1.0, 4.0);
+    this->model->addVertexTexture (2.0, 0.0);
+    this->model->addVertexTexture (2.0, 1.0);
+    this->model->addVertexTexture (-1.0, 0.0);
+    this->model->addVertexTexture (-1.0, 1.0);
+
+    this->model->finalize();
+    */
+  }
+}
+
+float Terrain::getHeight(float x, float y)
+{
+  if(this->heightMap != NULL)
+    return (this->heightMap->getHeight(x, y));
+  return 0;
+}
Index: /branches/cleanup/src/world_entities/environments/terrain.h
===================================================================
--- /branches/cleanup/src/world_entities/environments/terrain.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/environments/terrain.h	(revision 10591)
@@ -0,0 +1,61 @@
+/*!
+ * @file terrain.h
+  *  Defines and handles the terrain of the World
+
+    @todo implement it
+
+    The terrain should either be build from a Model a OBJModel or from a HeightMap.
+*/
+
+#ifndef _TERRAIN_H
+#define _TERRAIN_H
+
+#include "world_entity.h"
+
+// FORWARD DECLARATION
+class SpatialSeparation;
+class HeightMap;
+class Material;
+
+//! A simple method to call a desired debug world.
+enum DebugTerrain {TERRAIN_DAVE, TERRAIN_BENSCH};
+
+
+//! A Class to handle Terrain of orxonox
+class Terrain : public WorldEntity
+{
+  ObjectListDeclaration(Terrain);
+
+ public:
+  Terrain(const TiXmlElement* root = NULL);
+  Terrain(const std::string& fileName);
+  Terrain(DebugTerrain debugTerrain);
+  virtual ~Terrain();
+
+  void init();
+  virtual void loadParams(const TiXmlElement* root);
+
+  void loadVegetation(const std::string& vegetationFile);
+
+  void loadHeightMap(const std::string& heightMapFile, const std::string& colorMap);
+  void loadTexture(const std::string& textureName);
+  void setScale(float x, float y, float z);
+
+  void buildDebugTerrain(DebugTerrain debugTerrain);
+
+  float getHeight(float x, float y);
+  virtual void draw() const;
+
+  public:
+    SpatialSeparation* ssp;
+
+ private:
+   Model*              vegetation;
+   int                 modelList;
+
+   HeightMap*          heightMap;
+   Material*           heightMapMaterial;
+   Vector              terrainScale;
+};
+
+#endif /* _TERRAIN_H */
Index: /branches/cleanup/src/world_entities/extendable.h
===================================================================
--- /branches/cleanup/src/world_entities/extendable.h	(revision 10590)
+++ /branches/cleanup/src/world_entities/extendable.h	(revision 10591)
@@ -13,5 +13,5 @@
 
 
-#include "power_ups/power_up.h"
+#include "items/power_ups/power_up.h"
 //! A class for Extendable Entities
 class Extendable : virtual public BaseObject {
Index: /branches/cleanup/src/world_entities/items/power_ups/laser_power_up.cc
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/laser_power_up.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/laser_power_up.cc	(revision 10591)
@@ -0,0 +1,123 @@
+/*
+   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: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "laser_power_up.h"
+#include "util/loading/factory.h"
+#include "state.h"
+#include "network_game_manager.h"
+
+#include "primitive_model.h"
+
+
+
+ObjectListDefinition(LaserPowerUp);
+CREATE_FACTORY(LaserPowerUp);
+
+LaserPowerUp::LaserPowerUp () : PowerUp(0.0, 1.0, 0.0)
+{
+  this->init();
+}
+
+LaserPowerUp::LaserPowerUp(const TiXmlElement* root) : PowerUp(0.0, 1.0, 0.0)
+{
+  this->init();
+
+  this->loadParams(root);
+}
+
+
+LaserPowerUp::~LaserPowerUp ()
+{
+  delete this->sphereModel;
+  delete this->sphereMaterial;
+}
+
+
+void LaserPowerUp::init()
+{
+  this->registerObject(this, LaserPowerUp::_objectList);
+  this->loadModel("models/guns/test_gun.obj", 2.0);
+
+  this->sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
+  this->sphereMaterial = new Material;
+  this->sphereMaterial->setTransparency(.1);
+  this->sphereMaterial->setDiffuse(.7, .7, .1);
+
+  this->rotation = Vector(0,1,0);
+  this->cycle    = (float)rand()/RAND_MAX*M_2_PI;
+  this->shiftDir(Quaternion((float)rand()/RAND_MAX*M_2_PI, this->rotation));
+}
+
+
+void LaserPowerUp::loadParams(const TiXmlElement* root)
+{
+  PowerUp::loadParams(root);
+
+}
+
+
+/**
+ * this function is called, when two entities collide
+ * @param entity: the world entity with whom it collides
+ *
+ * Implement behaviour like damage application or other miscellaneous collision stuff in this function
+ */
+void LaserPowerUp::collidesWith(WorldEntity* entity, const Vector& location)
+{
+ // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z);
+  if (entity->isA(Playable::staticClassID()))
+  this->toList(OM_DEAD);
+}
+
+/**
+ *  this method is called every frame
+ * @param time: the time in seconds that has passed since the last tick
+ *
+ * Handle all stuff that should update with time inside this method (movement, animation, etc.)
+*/
+void LaserPowerUp::tick(float dt)
+{
+  this->shiftDir(Quaternion(dt, this->rotation));
+  this->cycle+=dt;
+
+}
+
+/**
+ *  the entity is drawn onto the screen with this function
+ *
+ * This is a central function of an entity: call it to let the entity painted to the screen.
+ * Just override this function with whatever you want to be drawn.
+*/
+void LaserPowerUp::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y + cos(this->cycle*3.0)*2.0,
+                this->getAbsCoor ().z);
+  /* rotate */
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+  this->getModel()->draw();
+
+  this->sphereMaterial->select();
+  this->sphereModel->draw();
+  glPopMatrix();
+}
+
+
Index: /branches/cleanup/src/world_entities/items/power_ups/laser_power_up.h
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/laser_power_up.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/laser_power_up.h	(revision 10591)
@@ -0,0 +1,40 @@
+/*!
+ * @file laser_power_up.h
+ * @brief A class representing a PowerUp in the world.
+*/
+
+#ifndef _LASER_POWER_UP_H
+#define _LASER_POWER_UP_H
+
+#include "power_up.h"
+
+/* FORWARD DEFINITION */
+class Material;
+
+class LaserPowerUp : public PowerUp {
+  ObjectListDeclaration(LaserPowerUp);
+
+ public:
+  LaserPowerUp();
+  LaserPowerUp(const TiXmlElement* root);
+  virtual ~LaserPowerUp ();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+
+  virtual void collidesWith(WorldEntity* entity, const Vector& location);
+  virtual void tick(float dt);
+  virtual void draw() const;
+
+  private:
+   void init();
+
+  private:
+   Vector              rotation;
+   float               cycle;
+
+   Model*              sphereModel;
+   Material*           sphereMaterial;
+};
+
+#endif /* _LASER_POWER_UP_H */
Index: /branches/cleanup/src/world_entities/items/power_ups/param_power_up.cc
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/param_power_up.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/param_power_up.cc	(revision 10591)
@@ -0,0 +1,126 @@
+/*
+   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: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "param_power_up.h"
+#include "util/loading/factory.h"
+#include "state.h"
+
+#include "primitive_model.h"
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+#include "network_game_manager.h"
+
+
+
+ObjectListDefinition(ParamPowerUp);
+CREATE_FACTORY(ParamPowerUp);
+
+const char* ParamPowerUp::paramTypes[] = {
+  "shield",
+  "max-shield",
+  "health",
+  "max-health",
+};
+
+ParamPowerUp::ParamPowerUp(const TiXmlElement* root) : PowerUp(0.0, 1.0, 0.0)
+{
+  this->init();
+  this->loadPickupSound("sounds/powerups/power_up_6.wav");
+  if( root != NULL)
+    this->loadParams(root);
+
+  registerVar( new SynchronizeableInt( (int*)&type, (int*)&type, "type", PERMISSION_MASTER_SERVER ) );
+  registerVar( new SynchronizeableFloat( &value, &value, "value", PERMISSION_MASTER_SERVER ) );
+  registerVar( new SynchronizeableFloat( &max_value, &max_value, "max_value", PERMISSION_MASTER_SERVER ) );
+  registerVar( new SynchronizeableFloat( &min_value, &min_value, "min_value", PERMISSION_MASTER_SERVER ) );
+}
+
+
+ParamPowerUp::~ParamPowerUp ()
+{
+}
+
+
+void ParamPowerUp::init()
+{
+  this->registerObject(this, ParamPowerUp::_objectList);
+  this->value = 0;
+  this->max_value = 0;
+  this->min_value = 0;
+}
+
+
+void ParamPowerUp::loadParams(const TiXmlElement* root)
+{
+  PowerUp::loadParams(root);
+  LoadParam(root, "type", this, ParamPowerUp, setType);
+
+  if( root != NULL && root->FirstChildElement("value") != NULL) {
+
+    LoadParam(root, "value", this, ParamPowerUp, setValue);
+  }
+  else {
+    LoadParam(root, "max-value", this, ParamPowerUp, setMaxValue);
+    LoadParam(root, "min-value", this, ParamPowerUp, setMinValue);
+    respawn();
+  }
+}
+
+void ParamPowerUp::setValue(float value)
+{
+  this->value = value;
+}
+
+void ParamPowerUp::setType(const std::string& type)
+{
+  for(int i = 0; i < POWERUP_PARAM_size; ++i) {
+    if(type == paramTypes[i]) {
+      this->type = (EnumParamPowerUpType)i;
+      break;
+    }
+  }
+}
+
+void ParamPowerUp::setMaxValue(float value)
+{
+  this->max_value = value;
+}
+
+void ParamPowerUp::setMinValue(float value)
+{
+  this->min_value = value;
+}
+
+float ParamPowerUp::getValue()
+{
+  return this->value;
+}
+
+EnumParamPowerUpType ParamPowerUp::getType()
+{
+  return this->type;
+}
+
+void ParamPowerUp::respawn()
+{
+  if(this->min_value != this->max_value)
+  {
+    this->value = this->min_value + rand() * (this->max_value - this->min_value);
+  }
+}
+
Index: /branches/cleanup/src/world_entities/items/power_ups/param_power_up.h
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/param_power_up.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/param_power_up.h	(revision 10591)
@@ -0,0 +1,52 @@
+/*!
+ * @file weapon_power_up.h
+ * @brief A class representing a PowerUp modifying parameters.
+*/
+
+#ifndef _PARAM_POWER_UP_H
+#define _PARAM_POWER_UP_H
+
+#include "power_up.h"
+
+/* FORWARD DEFINITION */
+
+typedef enum EnumParamPowerUpType {
+  POWERUP_PARAM_SHIELD,
+  POWERUP_PARAM_MAX_SHIELD,
+  POWERUP_PARAM_HEALTH,
+  POWERUP_PARAM_MAX_HEALTH,
+  POWERUP_PARAM_size
+} EnumParamPowerUpType;
+
+class ParamPowerUp : public PowerUp {
+  ObjectListDeclaration(ParamPowerUp);
+
+public:
+  ParamPowerUp(const TiXmlElement* root = NULL);
+  virtual ~ParamPowerUp ();
+
+  void setValue(float value);
+  void setMaxValue(float value);
+  void setMinValue(float value);
+  void setType(const std::string& type);
+  EnumParamPowerUpType getType();
+  float getValue();
+
+protected:
+  virtual void respawn();
+
+private:
+  void init();
+  virtual void loadParams(const TiXmlElement* root);
+
+private:
+  EnumParamPowerUpType    type;
+  float                   value;
+  float                   max_value;
+  float                   min_value;
+
+  static const char*      paramTypes[];
+
+};
+
+#endif /* _PARAM_POWER_UP_H */
Index: /branches/cleanup/src/world_entities/items/power_ups/power_up.cc
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/power_up.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/power_up.cc	(revision 10591)
@@ -0,0 +1,175 @@
+/*
+   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: Manuel Leuenberger
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "power_up.h"
+#include "extendable.h"
+#include "primitive_model.h"
+
+#include "sound/resource_sound_buffer.h"
+#include "util/loading/load_param.h"
+
+#include "debug.h"
+
+ObjectListDefinition(PowerUp);
+
+PowerUp::PowerUp(float r, float g, float b)
+{
+  this->registerObject(this, PowerUp::_objectList);
+
+  this->respawnType = RESPAWN_TIME;
+  this->respawnStart = 10;
+  this->model = NULL;
+  /*  if(!PowerUp::sphereModel) {*/
+
+  Model* sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
+
+  this->setModel(sphereModel);
+  this->buildObbTree( 4);
+  this->sphereMaterial = new Material;
+  this->sphereMaterial->setTransparency(.8);
+  this->sphereMaterial->setDiffuse(r, g, b);
+  this->toList(OM_COMMON);
+
+  this->soundSource.setSourceNode(this);
+
+  this->collider = NULL;
+}
+
+PowerUp::~PowerUp ()
+{
+  delete this->sphereMaterial;
+}
+
+
+void PowerUp::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "respawnType", this, PowerUp, setRespawnType);
+
+  LoadParam(root, "respawnTime", this, PowerUp, setRespawnTime);
+
+  LoadParam(root, "pickup-sound", this, PowerUp, loadPickupSound);
+
+  LoadParam(root, "respawn-sound", this, PowerUp, loadRespawnSound);
+}
+
+
+void PowerUp::loadPickupSound(const std::string& pickupSound)
+{
+  if (!pickupSound.empty())
+    this->pickupBuffer = OrxSound::ResourceSoundBuffer(pickupSound);
+  else
+    this->pickupBuffer = OrxSound::SoundBuffer();
+}
+
+void PowerUp::loadRespawnSound(const std::string& respawnSound)
+{
+  if (!respawnSound.empty())
+    this->respawnBuffer = OrxSound::ResourceSoundBuffer(respawnSound);
+  else
+    this->respawnBuffer = OrxSound::SoundBuffer();
+}
+
+
+void PowerUp::collidesWith (WorldEntity* entity, const Vector& location)
+{
+  if(this->collider != entity && entity->isA(Extendable::staticClassID()))
+  {
+    this->collider = entity;
+    if(dynamic_cast<Extendable*>(entity)->pickup(this))
+    {
+      if(pickupBuffer.loaded())
+        this->soundSource.play(this->pickupBuffer);
+
+      switch(respawnType)
+      {
+      case RESPAWN_NONE:
+        this->toList(OM_DEAD);
+        break;
+      case RESPAWN_TIME:
+        this->toList(OM_DEAD_TICK);
+        this->respawnTime = this->respawnStart;
+        break;
+        default:
+          /* NOT HANDLED */
+          break;
+      }
+    }
+  }
+}
+
+void PowerUp::tick(float dt)
+{
+  if(this->getOMListNumber() != OM_COMMON)
+  {
+    this->respawnTime -= dt;
+    if(this->respawnTime <= 0)
+    {
+      this->toList(OM_COMMON);
+      this->collider = NULL;
+      if (likely(this->respawnBuffer.loaded()))
+        this->soundSource.play(this->respawnBuffer);
+
+    }
+  }
+}
+
+void PowerUp::draw() const
+{
+  if(this->model != NULL)
+  {
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+    glTranslatef (this->getAbsCoor ().x,
+                  this->getAbsCoor ().y,
+                  this->getAbsCoor ().z);
+    Vector tmpRot = this->getAbsDir().getSpacialAxis();
+    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+    this->model->draw();
+    glPopMatrix();
+  }
+  this->sphereMaterial->select();
+  WorldEntity::draw();
+}
+
+const char* PowerUp::respawnTypes[] =
+  {
+    "none",
+    "time"
+  };
+
+
+void PowerUp::setRespawnType(const std::string& type)
+{
+  for(int i = 0; i < RESPAWN_size; ++i)
+  {
+    if(type == respawnTypes[i])
+    {
+      this->respawnType = (PowerUpRespawn)i;
+      break;
+    }
+  }
+}
+
+void PowerUp::setRespawnTime(const float respawnTime)
+{
+  this->respawnStart = respawnTime;
+}
+
+
Index: /branches/cleanup/src/world_entities/items/power_ups/power_up.h
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/power_up.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/power_up.h	(revision 10591)
@@ -0,0 +1,57 @@
+/*!
+ * @file power_up.h
+ * @brief A class representing a PowerUp in the world.
+*/
+
+#ifndef _POWER_UP_H
+#define _POWER_UP_H
+
+#include "world_entity.h"
+
+#include "sound_buffer.h"
+#include "sound_source.h"
+
+class Material;
+
+typedef enum PowerUpRespawn {
+  RESPAWN_NONE,
+  RESPAWN_TIME,
+  RESPAWN_size
+} PowerUpRespawn;
+
+class PowerUp : public WorldEntity {
+  ObjectListDeclaration(PowerUp);
+
+public:
+  virtual void loadParams(const TiXmlElement* root);
+  void collidesWith (WorldEntity* entity, const Vector& location);
+
+  void loadPickupSound(const std::string& pickupSound);
+  void loadRespawnSound(const std::string& respawnSound);
+
+  virtual void draw () const;
+  virtual void tick(float dt);
+  void setRespawnType(const std::string& type);
+  void setRespawnTime(const float respawn);
+
+protected:
+  PowerUp(float r, float g, float b);
+  virtual ~PowerUp ();
+
+protected:
+  Model* model;
+
+private:
+  OrxSound::SoundSource  soundSource;
+  OrxSound::SoundBuffer  pickupBuffer;
+  OrxSound::SoundBuffer  respawnBuffer;
+  Material*              sphereMaterial;
+  PowerUpRespawn         respawnType;
+  float                  respawnTime;
+  float                  respawnStart;
+  static const char*     respawnTypes[];
+
+  WorldEntity*           collider;
+};
+
+#endif /* _POWER_UP_H */
Index: /branches/cleanup/src/world_entities/items/power_ups/turret_power_up.cc
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/turret_power_up.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/turret_power_up.cc	(revision 10591)
@@ -0,0 +1,117 @@
+/*
+   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: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "turret_power_up.h"
+#include "util/loading/factory.h"
+#include "network_game_manager.h"
+#include "state.h"
+
+#include "primitive_model.h"
+
+
+
+ObjectListDefinition(TurretPowerUp);
+CREATE_FACTORY(TurretPowerUp);
+
+TurretPowerUp::TurretPowerUp(const TiXmlElement* root) : PowerUp(0.0, 1.0, 0.0)
+{
+  this->init();
+
+  if( root != NULL)
+    this->loadParams(root);
+}
+
+
+TurretPowerUp::~TurretPowerUp ()
+{
+  delete this->sphereModel;
+  delete this->sphereMaterial;
+}
+
+
+void TurretPowerUp::init()
+{
+  this->registerObject(this, TurretPowerUp::_objectList);
+  this->loadModel("models/guns/turret1.obj", 2.0);
+
+  this->sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
+  this->sphereMaterial = new Material;
+  this->sphereMaterial->setTransparency(.1);
+  this->sphereMaterial->setDiffuse(.1, .1, .8);
+
+  this->rotation = Vector(0,1,0);
+  this->cycle    = (float)rand()/RAND_MAX*M_2_PI;
+  this->shiftDir(Quaternion((float)rand()/RAND_MAX*M_2_PI, this->rotation));
+}
+
+
+void TurretPowerUp::loadParams(const TiXmlElement* root)
+{
+  PowerUp::loadParams(root);
+
+}
+
+
+/**
+ * this function is called, when two entities collide
+ * @param entity: the world entity with whom it collides
+ *
+ * Implement behaviour like damage application or other miscellaneous collision stuff in this function
+ */
+void TurretPowerUp::collidesWith(WorldEntity* entity, const Vector& location)
+{
+ // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z);
+  if (entity->isA(Playable::staticClassID()))
+   this->toList(OM_DEAD);
+}
+
+/**
+ *  this method is called every frame
+ * @param time: the time in seconds that has passed since the last tick
+ *
+ * Handle all stuff that should update with time inside this method (movement, animation, etc.)
+*/
+void TurretPowerUp::tick(float dt)
+{
+  this->shiftDir(Quaternion(dt, this->rotation));
+  this->cycle+=dt;
+
+}
+
+/**
+ *  the entity is drawn onto the screen with this function
+ *
+ * This is a central function of an entity: call it to let the entity painted to the screen.
+ * Just override this function with whatever you want to be drawn.
+*/
+void TurretPowerUp::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y + cos(this->cycle*3.0)*2.0,
+                this->getAbsCoor ().z);
+  /* rotate */
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+  this->getModel()->draw();
+
+  this->sphereMaterial->select();
+  this->sphereModel->draw();
+  glPopMatrix();
+}
Index: /branches/cleanup/src/world_entities/items/power_ups/turret_power_up.h
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/turret_power_up.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/turret_power_up.h	(revision 10591)
@@ -0,0 +1,38 @@
+/*!
+ * @file turret_power_up.h
+ * @brief A class representing a PowerUp in the world.
+*/
+
+#ifndef _TURRET_POWER_UP_H
+#define _TURRET_POWER_UP_H
+
+#include "power_up.h"
+
+/* FORWARD DEFINITION */
+class Material;
+
+class TurretPowerUp : public PowerUp {
+  ObjectListDeclaration(TurretPowerUp);
+
+ public:
+  TurretPowerUp(const TiXmlElement* root = NULL);
+  virtual ~TurretPowerUp ();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  virtual void collidesWith(WorldEntity* entity, const Vector& location);
+  virtual void tick(float dt);
+  virtual void draw() const;
+
+  private:
+   void init();
+
+  private:
+   Vector              rotation;
+   float               cycle;
+
+   Model*              sphereModel;
+   Material*           sphereMaterial;
+};
+
+#endif /* _TURRET_POWER_UP_H */
Index: /branches/cleanup/src/world_entities/items/power_ups/weapon_power_up.cc
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/weapon_power_up.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/weapon_power_up.cc	(revision 10591)
@@ -0,0 +1,105 @@
+/*
+   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: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "weapon_power_up.h"
+#include "util/loading/factory.h"
+#include "state.h"
+#include "network_game_manager.h"
+
+#include "primitive_model.h"
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+#include "debug.h"
+
+
+ObjectListDefinition(WeaponPowerUp);
+CREATE_FACTORY(WeaponPowerUp);
+
+WeaponPowerUp::WeaponPowerUp(const TiXmlElement* root) : PowerUp(1.0, 1.0, 0.0)
+{
+  this->init();
+  if( root != NULL)
+    this->loadParams(root);
+}
+
+
+WeaponPowerUp::~WeaponPowerUp ()
+{
+}
+
+
+void WeaponPowerUp::init()
+{
+  this->registerObject(this, WeaponPowerUp::_objectList);
+  this->loadPickupSound("sounds/powerups/whats this2.wav");
+
+  this->weaponXML = NULL;
+  this->weapon = NULL;
+}
+
+
+void WeaponPowerUp::loadParams(const TiXmlElement* root)
+{
+  PowerUp::loadParams(root);
+  const TiXmlElement* elem = root->FirstChildElement("weapon");
+  if(elem != NULL && (elem = elem->FirstChildElement()) != NULL)
+  {
+    this->weaponXML = elem;
+    newWeapon();
+  }
+  else
+  {
+    LoadParam(root, "weaponID", this, WeaponPowerUp, setWeaponClass);
+  }
+}
+
+Weapon* WeaponPowerUp::getWeapon()
+{
+  return this->weapon;
+}
+
+bool WeaponPowerUp::process(WeaponManager* manager)
+{
+  if(manager->addWeapon(this->weapon)) {
+    newWeapon();
+  }
+  else {
+    manager->increaseAmmunition(this->weapon->getProjectileType(), this->weapon->getEnergy());
+  }
+  return true;
+}
+
+void WeaponPowerUp::newWeapon()
+{
+  this->weapon = dynamic_cast<Weapon*>((weaponXML == NULL)
+      ? Factory::fabricate((this->weapon->getClassID()))
+      : Factory::fabricate((const TiXmlElement*)this->getXmlElem()->FirstChildElement("weapon")));
+  this->model = this->weapon->getModel(0);
+}
+
+void WeaponPowerUp::setWeaponClass(const std::string& name)
+{
+  this->weapon = dynamic_cast<Weapon*>(Factory::fabricate(name));
+  if (this->weapon == NULL)
+  {
+    PRINTF(1)("Unable to load Weapon. %s\n", name.c_str());
+    this->weapon = dynamic_cast<Weapon*>(Factory::fabricate("Turret"));
+  }
+  this->model = this->weapon->getModel(0);
+}
+
Index: /branches/cleanup/src/world_entities/items/power_ups/weapon_power_up.h
===================================================================
--- /branches/cleanup/src/world_entities/items/power_ups/weapon_power_up.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/items/power_ups/weapon_power_up.h	(revision 10591)
@@ -0,0 +1,38 @@
+/*!
+ * @file weapon_power_up.h
+ * @brief A class representing a PowerUp containing a weapon.
+*/
+
+#ifndef _WEAPON_POWER_UP_H
+#define _WEAPON_POWER_UP_H
+
+#include "power_up.h"
+#include "weapons/weapon.h"
+#include "weapons/weapon_manager.h"
+
+/* FORWARD DEFINITION */
+
+class WeaponPowerUp : public PowerUp {
+ObjectListDeclaration(WeaponPowerUp);
+public:
+  WeaponPowerUp(const TiXmlElement* root = NULL);
+  virtual ~WeaponPowerUp ();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  Weapon* getWeapon();
+  void setWeaponClass(const std::string& name);
+
+  bool process(WeaponManager* manager);
+
+private:
+  void init();
+  void newWeapon();
+private:
+  Weapon* weapon;
+  const TiXmlElement* weaponXML;
+
+  void createWeapon();
+};
+
+#endif /* _WEAPON_POWER_UP_H */
Index: anches/cleanup/src/world_entities/mount_point.cc
===================================================================
--- /branches/cleanup/src/world_entities/mount_point.cc	(revision 10590)
+++ 	(revision )
@@ -1,262 +1,0 @@
-/*
-   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, patrick@orxonox.net
-   co-programmer:
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "executor/executor.h"
-#include "util/loading/factory.h"
-#include "util/loading/load_param.h"
-#include "util/loading/load_param_xml.h"
-
-#include "weapons/weapon_slot.h"
-
-#include "particles/particle_system.h"
-
-#include "mount_point.h"
-#include "debug.h"
-#include "state.h"
-
-
-ObjectListDefinition(MountPoint);
-
-
-/**
- * construct
- */
-MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name)
-{
-//   PRINTF(0)("Created mount point %s\n", name.c_str());
-  this->registerObject(this, MountPoint::_objectList);
-
-  this->_name = name;
-  this->setRelCoor( center);
-  this->setRelDir( Quaternion(forward, up));
-
-  this->_center = center;
-  this->_up = up;
-  this->_forward = forward;
-
-  this->init();
-}
-
-
-
-/**
- * deconstructor
- */
-MountPoint::~MountPoint ()
-{}
-
-
-/**
- * initializing function
- */
-void MountPoint::init()
-{
-  this->registerObject(this, MountPoint::_objectList);
-  this->toList(OM_GROUP_00);
-
-  this->_mount = NULL;
-}
-
-
-/**
- * loads the Settings of a MD2Creature from an XML-element.
- * @param root the XML-element to load the MD2Creature's properties from
- */
-void MountPoint::initMountPoint(const TiXmlElement* root)
-{
-  if( root == NULL)
-  {
-    PRINTF(1)("MountPoint - initialization failed, since I got no valid xml element\n");
-    return;
-  }
-  // now get the first element
-  const TiXmlElement* element = root->FirstChildElement("MountPoints");
-  if( element == NULL)
-  {
-    PRINTF(1)("I am in section: %s, Object Information file is missing a proper 'MountPoints' section\n", root->Value());
-//     element = root->FirstChildElement( );
-//     PRINTF(0)("first child: %s\n", element->Value());
-  }
-  else
-  {
-    element = element->FirstChildElement();
-    // parse the information for this mount point
-
-    PRINTF(4)("Loading WorldEntities\n");
-    while( element != NULL)
-    {
-      std::string name = element->Value();
-
-      PRINTF(5)("checking %s against local %s\n", name.c_str(), this->_name.c_str());
-      // check if we got the right mount point
-      if( this->_name.find(name, 0) != std::string::npos)
-      {
-        PRINTF(5)("found mount point %s\n", this->_name.c_str());
-        // load it
-        this->loadParam(element);
-      }
-
-      element = element->NextSiblingElement();
-    }
-  }
-}
-
-
-
-/**
- * load the parameters from the xml section
- * @param root the root element of this xml branche
- */
-void MountPoint::loadParam(const TiXmlElement* root)
-{
-  // first check for the description
-  LoadParam(root, "Description", this, MountPoint, setDescription)
-  .describe("Sets this mount point a description");
-
-  // now check for the orx class to create
-  LoadParam(root, "OrxClass", this, MountPoint, setOrxClass)
-  .describe("Sets the class this mount points should host");
-
-  LoadParamXML(root, "Details", this, MountPoint, loadDetails);
-}
-
-
-/**
- * load the parameters from the world entity
- * @param root the root element of this xml branche
- */
-void MountPoint::loadDetails(const TiXmlElement* root)
-{
-  if( this->_mount != NULL)
-  {
-//     PRINTF(0)("Got detailed informations\n");
-    this->_mount->loadParams( root);
-
-    if( this->_mount->isA(ParticleSystem::staticClassID()))
-    {
-//       PRINTF(0)("got particle system. attaching it to mp\n");
-      dynamic_cast<ParticleSystem*>(this->_mount)->attachEmmittersTo(this, Vector(0,0,0),
-                                    this->getRelDir()*Quaternion(M_PI, Vector(0,1,0)));
-    }
-  }
-}
-
-
-/**
- * setst the description (optional) via xml tag
- * @param description string containing the description
- */
-void MountPoint::setDescription(const std::string& description)
-{
-  this->_description = description;
-}
-
-
-
-/**
- * sets the class of this mount point
- * @param orxClass class
- */
-void MountPoint::setOrxClass(const std::string& orxClass)
-{
-  // create the object for this mount point
-  BaseObject* obj = Factory::fabricate(orxClass);
-  // check if the object is created correctly
-  if( obj != NULL)
-  {
-    if( obj->isA( WorldEntity::staticClassID()))
-    {
-//       PRINTF(0)("Mount Point created a %s\n", obj->getCName());
-      // cast down the object to WE
-      this->_mount = dynamic_cast<WorldEntity*>(obj);
-
-      // now set the position, direction and reparent it to this node
-      this->_mount->setAbsCoor( this->getAbsCoor());
-      this->_mount->setAbsDir( this->getAbsDir());
-      this->_mount->setParent( this);
-
-      dynamic_cast<WorldEntity*>(this->_mount)->toList((OM_LIST)(this->getOMListNumber()));
-    }
-    else if( obj->isA( WeaponSlot::staticClassID()))
-    {
-//       PRINTF(0)("=========+>we got a weapon slot at\n");
-//       this->getAbsCoor().debug();
-// //       this->_center.debug();
-
-
-      // cast down the object to WE
-      this->_mount = dynamic_cast<WeaponSlot*>(obj);
-
-      // now set the position, direction and reparent it to this node
-      this->_mount->setAbsCoor( this->_center);
-      this->_mount->setAbsDir( Quaternion(_forward, _up));
-      this->_mount->setParent( this);
-    }
-  }
-  else
-    PRINTF(1)("Couldn't create %s for this mount point (%s)\n", orxClass.c_str(), this->_name.c_str());
-}
-
-
-
-/**
- * tick
- * @param time  time passed since the last tick
- */
-void MountPoint::tick (float time)
-{
-
-}
-
-
-/**
- * draw this entity
- */
-void MountPoint::draw() const
-{
-}
-
-
-
-/**
- *  function called to draw the mount point itself for debug purposes only
- */
-void MountPoint::debugDraw() const
-{
-  // invoke the underlying pnode debug draw
-  this->debugDraw();
-}
-
-
-/**
- * adds an entity to this mount point
- * @param entity entity to be added
- */
-void MountPoint::mount(PNode* entity)
-{
-  this->_mount = entity;
-}
-
-
-/**
- * removes an entity from this mount point
- */
-void MountPoint::unmount()
-{
-  this->_mount = NULL;
-}
-
Index: anches/cleanup/src/world_entities/mount_point.h
===================================================================
--- /branches/cleanup/src/world_entities/mount_point.h	(revision 10590)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#ifndef _MOUNT_POINT_H
-#define _MOUNT_POINT_H
-
-#include "world_entity.h"
-
-class TiXmlElement;
-
-
-class MountPoint : public WorldEntity
-{
-    ObjectListDeclaration(MountPoint);
-
-  public:
-    MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name);
-    virtual ~MountPoint ();
-
-    void init();
-    void initMountPoint(const TiXmlElement* root);
-    void loadParam(const TiXmlElement* root);
-    void loadDetails(const TiXmlElement* root);
-
-    void setDescription(const std::string& description);
-    void setOrxClass(const std::string& orxClass);
-
-    virtual void tick (float time);
-    virtual void draw() const;
-
-    void debugDraw() const;
-
-    inline const Vector& getCenter() { return this->_center; }
-
-    void mount(PNode* entity);
-    void unmount();
-    PNode* getMount() { return this->_mount; }
-
-  private:
-    PNode*               _mount;       //!< the entity mounted at this mount point
-    std::string          _name;        //!< the name of the mount point
-
-    std::string          _description; //!< string containing an optional description
-
-    Vector               _center;
-    Vector               _up;
-    Vector               _forward;
-
-};
-
-#endif /* _MOUNT_POINT_H */
Index: anches/cleanup/src/world_entities/movie_entity.cc
===================================================================
--- /branches/cleanup/src/world_entities/movie_entity.cc	(revision 10590)
+++ 	(revision )
@@ -1,169 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2005 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: David Hasenfratz, Stefan Lienhard
-   co-programmer:
-*/
-
-#include "movie_entity.h"
-
-#include "media_container.h"
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-
-
-
-ObjectListDefinition(MovieEntity);
-CREATE_FACTORY(MovieEntity);
-
-/**
- *  standard constructor
- */
-MovieEntity::MovieEntity (const TiXmlElement* root)
-{
-  this->registerObject(this, MovieEntity::_objectList);
-
-  media_container = new MediaContainer();
-
-  axis = 0;
-  rotation = 0;
-  height = 20;
-  width = 20;
-  mediaLoaded = false;
-
-  this->toList(OM_COMMON);
-
-  if( root != NULL)
-    this->loadParams(root);
-
-  counter = 0;
-  timer = 0;
-}
-
-/**
- *  standard destructor
- */
-MovieEntity::~MovieEntity ()
-{
-  if( this->media_container)
-    delete this->media_container;
-}
-
-void MovieEntity::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-
-  LoadParam(root, "name", this, MovieEntity, loadMovie);
-  LoadParam(root, "axis", this, MovieEntity, setAxis);
-  LoadParam(root, "rotation", this, MovieEntity, setRotation);
-  LoadParam(root, "size", this, MovieEntity, setSize);
-  LoadParam(root, "fps", this, MovieEntity, setFPS);
-}
-
-void MovieEntity::setFPS(float fps)
-{
-  this->fps = fps;
-//PRINTF(0)("fps: %f\n", fps);
-}
-
-void MovieEntity::loadMovie(const std::string& filename)
-{
-  if(media_container->loadMedia(filename))
-  {
-    mediaLoaded = true;
-    fps = media_container->getFPS();
-  }
-  else
-    mediaLoaded = false;
-}
-
-void MovieEntity::setAxis(float axis)
-{
-//PRINTF(0)("fps: %f\n", fps);
-  this->axis = axis;
-}
-
-// Seconds for one loop
-void MovieEntity::setRotation(float rotation)
-{
-  this->rotation = rotation;
-}
-
-void MovieEntity::setSize(float width, float height)
-{
-  this->width = width;
-  this->height = height;
-}
-
-/**
- *  this method is called every frame
- * @param time: the time in seconds that has passed since the last tick
-
-   Handle all stuff that should update with time inside this method (movement, animation, etc.)
- */
-void MovieEntity::tick(float time)
-{
-  if(!mediaLoaded)
-    return;
-
-  timer += time;
-
-  if(counter != fps * timer)
-  {
-    counter = (int)(fps * timer);
-
-    if ((unsigned int)counter >= media_container->getFrameCount())
-    {
-      timer = 0;
-      counter = 0;
-    }
-  }
-
-  axis += (time * rotation/360.0);
-}
-
-
-/**
- *  the entity is drawn onto the screen with this function
-
-   This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
- */
-void MovieEntity::draw() const
-{
-//   if(!mediaLoaded)
-//     false;
-
-  glPushAttrib(GL_ENABLE_BIT);
-  glDisable(GL_LIGHTING);
-  glDisable(GL_BLEND);
-
-  glEnable(GL_TEXTURE_2D);
-  glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
-
-  glPushMatrix();
-  glTranslatef (this->getAbsCoor ().x,
-                this->getAbsCoor ().y,
-                this->getAbsCoor ().z);
-  glRotatef(axis, 0.0f, 1.0f, 0.0f);
-//PRINTF(0)("axis: %f\n", axis);
-
-  glColor3f(1.0, 1.0, 1.0);
-
-  glBegin(GL_QUADS);
-    glTexCoord2f(1.0f, 1.0f); glVertex3f(-width/2, -height/2,  0.0f);
-    glTexCoord2f(0.0f, 1.0f); glVertex3f( width/2, -height/2,  0.0f);
-    glTexCoord2f(0.0f, 0.0f); glVertex3f( width/2,  height/2,  0.0f);
-    glTexCoord2f(1.0f, 0.0f); glVertex3f(-width/2,  height/2,  0.0f);
-  glEnd();
-
-  glPopMatrix();
-  glPopAttrib();
-}
Index: anches/cleanup/src/world_entities/movie_entity.h
===================================================================
--- /branches/cleanup/src/world_entities/movie_entity.h	(revision 10590)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*!
- * @file movie_entity.h
- *  Definition of a Movie Screen
- */
-
-#ifndef _MOVIE_ENTITY_H
-#define _MOVIE_ENTITY_H
-
-#include "world_entity.h"
-
-
-class MediaContainer;
-
-class MovieEntity : public WorldEntity
-{
-  ObjectListDeclaration(MovieEntity);
-  private:
-    MediaContainer* media_container;
-
-    int counter;
-    float timer;
-    float fps;
-
-    float axis;
-    float rotation;
-    float height;
-    float width;
-
-    bool mediaLoaded;
-
-  public:
-    MovieEntity (const TiXmlElement* root = NULL);
-    virtual ~MovieEntity ();
-
-    virtual void draw () const;
-    virtual void tick (float time);
-
-    virtual void loadParams(const TiXmlElement* root);
-
-    void loadMovie(const std::string& filename);
-    void setAxis(float axis);
-    void setRotation(float rotation);
-    void setSize(float width, float height);
-    void setFPS(float fps);
-
-};
-
-#endif /* _MOVIE_ENTITY_H */
Index: /branches/cleanup/src/world_entities/npcs/generic_npc.cc
===================================================================
--- /branches/cleanup/src/world_entities/npcs/generic_npc.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/npcs/generic_npc.cc	(revision 10591)
@@ -31,5 +31,5 @@
 #include "sound/resource_sound_buffer.h"
 
-#include "bsp_entity.h"
+#include "environments/bsp_entity.h"
 
 
Index: /branches/cleanup/src/world_entities/npcs/mover.cc
===================================================================
--- /branches/cleanup/src/world_entities/npcs/mover.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/npcs/mover.cc	(revision 10591)
@@ -21,5 +21,5 @@
 #include "mover.h"
 #include "state.h"
-#include "camera.h"
+#include "tools/camera.h"
 
 
Index: /branches/cleanup/src/world_entities/npcs/npc.cc
===================================================================
--- /branches/cleanup/src/world_entities/npcs/npc.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/npcs/npc.cc	(revision 10591)
@@ -52,5 +52,5 @@
 #include "weapons/cannon.h"
 
-#include "mount_point.h"
+#include "tools/mount_point.h"
 #include "weapons/weapon_slot.h"
 
Index: /branches/cleanup/src/world_entities/npcs/npc_test1.cc
===================================================================
--- /branches/cleanup/src/world_entities/npcs/npc_test1.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/npcs/npc_test1.cc	(revision 10591)
@@ -22,6 +22,6 @@
 
 #include "state.h"
-#include "power_ups/turret_power_up.h"
-#include "power_ups/laser_power_up.h"
+#include "items/power_ups/turret_power_up.h"
+#include "items/power_ups/laser_power_up.h"
 
 ObjectListDefinition(NPCTest1);
Index: /branches/cleanup/src/world_entities/particles/sprite_particles.cc
===================================================================
--- /branches/cleanup/src/world_entities/particles/sprite_particles.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/particles/sprite_particles.cc	(revision 10591)
@@ -23,6 +23,6 @@
 #include "state.h"
 #include "shell_command.h"
-#include "camera.h"
-#include "cameraman.h"
+#include "tools/camera.h"
+#include "tools/cameraman.h"
 
 
Index: anches/cleanup/src/world_entities/planet.cc
===================================================================
--- /branches/cleanup/src/world_entities/planet.cc	(revision 10590)
+++ 	(revision )
@@ -1,157 +1,0 @@
-/*
-   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: ...
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-#include "planet.h"
-
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-#include "static_model.h"
-
-#include "material.h"
-#include "texture.h"
-
-#include "network_game_manager.h"
-#include "converter.h"
-#include "vertex_array_model.h"
-#include "primitive_model.h"
-#include "effects/billboard.h"
-
-#include "debug.h"
-
-
-ObjectListDefinition(Planet);
-CREATE_FACTORY(Planet);
-
-
-/**
- *  initializes a skybox from a XmlElement
-*/
-Planet::Planet(const TiXmlElement* root)
-{
-  this->registerObject(this, Planet::_objectList);
-  this->toList(OM_GROUP_01);
-
-  this->rotSpeedPlanet = 0.0;
-  this->rotSpeedCloud = 0.0;
-  this->bClouds = false;
-
-  //this->materialPlanet->setIllum(20);
-  //this->materialPlanet->setAmbient(0.1, 0.1, 0.1);
-
-  if( root != NULL)
-    this->loadParams(root);
-
-  PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, this->size, 50);
-  this->setModel(model);
-}
-
-
-/**
- *  default destructor
-*/
-Planet::~Planet()
-{
-  PRINTF(5)("Deleting Planet\n");
-}
-
-
-void Planet::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-
-  LoadParam(root, "texture", this, Planet, setTexture)
-      .describe("Sets the materialPlanet on the Planet. The string must be the path relative to the data-dir, and without a trailing .jpg");
-
-    LoadParam(root, "size", this, Planet, setSize)
-      .describe("Sets the Size of the Planet (normally this should be 90% of the maximal viewing Distance).");
-
-  LoadParam(root, "cloud-texture", this, Planet, setCloudTexture)
-      .describe("Sets the cloud texture of the planet");
-
-  LoadParam(root, "cloud-rotation", this, Planet, setCloudRotation)
-      .describe("Sets the cloud rotation speed");
-}
-
-
-/**
- *  Defines which textures should be loaded onto the Planet.
- * @param textureName the top texture.
-*/
-void Planet::setTexture(const std::string& textureName)
-{
-  this->materialPlanet.setDiffuseMap(textureName);
-}
-
-
-/**
- *  Defines which textures should be loaded onto the Planet.
- * @param textureName the top texture.
-*/
-void Planet::setCloudTexture(const std::string& textureName)
-{
-//   this->materialCloud.setDiffuseMap(textureName);
-//   this->halo = new Billboard();
-//   this->halo->setTexture( textureName);
-//   this->halo->setSize(this->size + 5, this->size + 5);
-//   this->halo->setParent( this);
-  this->bClouds = true;
-}
-
-
-void Planet::setCloudRotation(float rotationSpeed)
-{
-  this->rotSpeedCloud = rotationSpeed;
-}
-
-/**
- * @param size The new size of the Planet
-
- * do not forget to rebuild the Planet after this.
-*/
-void Planet::setSize(float size)
-{
-  this->size = size;
-}
-
-
-void Planet::tick( float dt)
-{
-  if( dt != 0.)
-    this->shiftDir( Quaternion( this->rotSpeedPlanet * dt, Vector(1,0,0)));
-}
-
-
-/**
- * draws the planet
- */
-void Planet::draw() const
-{
-  // draw the clouds
-  this->materialPlanet.select();
-  WorldEntity::draw();
-
-//   if( this->bClouds)
-//   {
-//     glDisable(GL_LIGHTING);
-//     this->materialCloud.select();
-//     WorldEntity::draw(this->cloudModel);
-//     glEnable(GL_LIGHTING);
-//   }
-}
-
-
-
Index: anches/cleanup/src/world_entities/planet.h
===================================================================
--- /branches/cleanup/src/world_entities/planet.h	(revision 10590)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*!
- * @file planet.h
- *  Definition of the Planet, that handles the Display of an atmosphere for orxonox.
- */
-
-#ifndef _PLANET_H
-#define _PLANET_H
-
-/* INCLUDES */
-#include "world_entity.h"
-#include "material.h"
-/* FORWARD DECLARATION */
-class Texture;
-class Billboard;
-
-//! A Class to handle a Planet
-class Planet : public WorldEntity
-{
-  ObjectListDeclaration(Planet);
-
- public:
-  Planet(const TiXmlElement* root);
-
-  virtual ~Planet();
-
-  virtual void loadParams(const TiXmlElement* root);
-
-  void setSize(float size);
-  /** assumes jpg as input-format */
-  void setTexture(const std::string& textureName);
-  void setCloudTexture(const std::string& textureName);
-  void setCloudRotation(float rotationSpeed);
-
-
-
-  virtual void tick( float dt);
-  virtual void draw() const;
-
-
-
- private:
-  Material        materialPlanet;  //!< Materials for the Planet. sorted by number (0-5) top, bottom, left, right, front, back
-  Material        materialCloud;   //!< the material for the cloud surrounding the planet
-
-  Model*          cloudModel;      //!< the model for the cloud
-
-  bool            bClouds;         //!< true if there are clouds defined
-  float           rotSpeedCloud;   //! cloud rotation speed
-  float           rotSpeedPlanet;  //! planet rotation speed
-  float           size;            //!< Size of the Planet. This should match the frustum maximum range.
-  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
-  char*           textureName;     //!< Name of the Texture
-
-};
-
-#endif  /* _PLANET_H */
-
-
-
Index: /branches/cleanup/src/world_entities/playable.cc
===================================================================
--- /branches/cleanup/src/world_entities/playable.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/playable.cc	(revision 10591)
@@ -21,10 +21,10 @@
 #include "player.h"
 #include "state.h"
-#include "camera.h"
+#include "tools/camera.h"
 
 #include "util/loading/load_param.h"
 
-#include "power_ups/weapon_power_up.h"
-#include "power_ups/param_power_up.h"
+#include "items/power_ups/weapon_power_up.h"
+#include "items/power_ups/param_power_up.h"
 
 #include "game_rules.h"
Index: anches/cleanup/src/world_entities/recorder.cc
===================================================================
--- /branches/cleanup/src/world_entities/recorder.cc	(revision 10590)
+++ 	(revision )
@@ -1,370 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2006 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: David Hasenfratz
-   co-programmer:
-*/
-
-#include "recorder.h"
-
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-#include "state.h"
-#include "debug.h"
-
-
-ObjectListDefinition(Recorder);
-CREATE_FACTORY(Recorder);
-
-
-Recorder::Recorder (const TiXmlElement* root)
-{
-  this->registerObject(this, Recorder::_objectList);
-
-  // initialize libavcodec, and register all codecs and formats
-  av_register_all();
-
-  // Default values
-  stream_duration = 10;
-  stream_frame_rate = 20;
-
-  this->loadParams(root);
-
-  this->toList(OM_COMMON);
-}
-
-
-Recorder::~Recorder ()
-{
-
-}
-
-
-void Recorder::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-
-  LoadParam(root, "duration", this, Recorder, setStreamDuration);
-
-  LoadParam(root, "fps", this, Recorder, setFPS);
-
-  LoadParam(root, "name", this, Recorder, initVideo);
-}
-
-
-void Recorder::setStreamDuration(float duration)
-{
-  this->stream_duration = duration;
-}
-
-
-void Recorder::setFPS(float fps)
-{
-  this->stream_frame_rate = fps;
-}
-
-
-void Recorder::initVideo(const std::string& filename)
-{
-  frame_count = 0;
-  time = 0;
-  stream_nb_frames = (int)(stream_duration * stream_frame_rate);
-
-  // auto detect the output format from the name, default is mpeg
-  output_format = guess_format(NULL, filename.c_str(), NULL);
-  if (!output_format)
-  {
-      PRINTF(0)("Could not deduce output format from file extension: using MPEG.\n");
-      output_format = guess_format("mpeg", NULL, NULL);
-  }
-  if (!output_format)
-    PRINTF(1)("Could not find suitable output format\n");
-
-  // allocate the output media context
-  format_context = av_alloc_format_context();
-  if (!format_context)
-    PRINTF(1)("Memory error\n");
-
-  format_context->oformat = output_format;
-  snprintf(format_context->filename, sizeof(format_context->filename), "%s", filename.c_str());
-
-  // add video stream using the default format codec and initialize the codec
-  if (output_format->video_codec != CODEC_ID_NONE)
-      this->addVideoStream();
-
-  // set the output parameters (must be done even if no parameters)
-  if (av_set_parameters(format_context, NULL) < 0)
-    PRINTF(1)("Invalid output format parameters\n");
-
-  // print some information
-  dump_format(format_context, 0, filename.c_str(), 1);
-
-  // now that all the parameters are set, we can open the
-  // video codec and allocate the necessary encode buffer
-  if(video_stream)
-    this->openVideo();
-
-  // open the output file, if needed
-  if(!(output_format->flags & AVFMT_NOFILE))
-  {
-    if(url_fopen(&format_context->pb, filename.c_str(), URL_WRONLY) < 0)
-      PRINTF(1)("Could not open %s\n", filename.c_str());
-  }
-
-  // write the stream header, if any
-  av_write_header(format_context);
-}
-
-void Recorder::closeVideo()
-{
-  avcodec_close(video_stream->codec);
-  av_free(picture->data[0]);
-  av_free(picture);
-  av_free(buffer);
-
-  // write the trailer, if any
-  av_write_trailer(format_context);
-
-  // free the streams
-  for(int i = 0; i < format_context->nb_streams; i++)
-    av_freep(&format_context->streams[i]);
-
-  // close the output file
-  if (!(output_format->flags & AVFMT_NOFILE))
-    url_fclose(&format_context->pb);
-
-  // free the stream
-  av_free(format_context);
-}
-
-
-void Recorder::openVideo()
-{
-  codec_context = video_stream->codec;
-
-  // find the video encoder
-  codec = avcodec_find_encoder(codec_context->codec_id);
-  if(!codec)
-    PRINTF(1)("codec not found\n");
-
-  // open the codec
-  if(avcodec_open(codec_context, codec) < 0)
-    PRINTF(1)("could not open codec\n");
-
-  buffer = NULL;
-  if(!(format_context->oformat->flags & AVFMT_RAWPICTURE))
-  {
-      // allocate output buffer
-      // XXX: API change will be done
-      buffer_size = 200000;
-      buffer = new uint8_t[buffer_size];
-  }
-
-  // allocate the encoded raw picture
-  this->allocPicture();
-  if(!picture)
-    PRINTF(0)("Could not allocate picture\n");
-}
-
-
-void Recorder::allocPicture()
-{
-  picture = avcodec_alloc_frame();
-  if(!picture)
-  {
-    picture = NULL;
-    return;
-  }
-  size = avpicture_get_size(codec_context->pix_fmt, width, height);
-  picture_buf = new uint8_t[size];
-  if(!picture_buf)
-  {
-      av_free(picture);
-      return;
-  }
-  avpicture_fill((AVPicture *)picture, picture_buf,
-                  codec_context->pix_fmt, width, height);
-
-
-
-  RGB_frame = avcodec_alloc_frame();
-
-  // Determine required buffer size and allocate buffer
-  size = avpicture_get_size(PIX_FMT_RGB24, width, height);
-  picture_buf = new uint8_t[size];
-
-  // Assign appropriate parts of buffer to image planes in RGB_frame
-  avpicture_fill((AVPicture *)RGB_frame, picture_buf, PIX_FMT_RGB24, width, height);
-}
-
-
-// add a video output stream
-void Recorder::addVideoStream()
-{
-  video_stream = av_new_stream(format_context, 0);
-  if (!video_stream)
-    PRINTF(1)("Could not alloc stream\n");
-
-  codec_context = video_stream->codec;
-  codec_context->codec_id = output_format->video_codec;
-  codec_context->codec_type = CODEC_TYPE_VIDEO;
-
-  // put sample parameters
-  codec_context->bit_rate = 400000;
-  // resolution must be a multiple of two
-  codec_context->width = State::getResX();
-  codec_context->height = State::getResY();
-
-  this->width = codec_context->width;
-  this->height = codec_context->height;
-
-  // time base: this is the fundamental unit of time (in seconds) in terms
-  // of which frame timestamps are represented. for fixed-fps content,
-  // timebase should be 1/framerate and timestamp increments should be
-  // identically 1
-  codec_context->time_base.den = (int)stream_frame_rate;
-  codec_context->time_base.num = 1;
-  codec_context->gop_size = 12;  // emit one intra frame every twelve frames at most
-  codec_context->pix_fmt = PIX_FMT_YUV420P;
-
-  if (codec_context->codec_id == CODEC_ID_MPEG1VIDEO)
-      // needed to avoid using macroblocks in which some coeffs overflow
-      // this doesnt happen with normal video, it just happens here as the
-      // motion of the chroma plane doesnt match the luma plane
-      codec_context->mb_decision=2;
-
-  // some formats want stream headers to be seperate
-  if(!strcmp(format_context->oformat->name, "mp4") ||
-     !strcmp(format_context->oformat->name, "mov") ||
-     !strcmp(format_context->oformat->name, "3gp"))
-    format_context->flags |= CODEC_FLAG_GLOBAL_HEADER;
-}
-
-
-void Recorder::tick(float dt)
-{
-  time += dt;
-  if(time < 1/stream_frame_rate)
-    return;
-  else
-    time = 0;
-
-  // compute current video time
-  if (video_stream)
-      video_pts = (double)video_stream->pts.val * video_stream->time_base.num / video_stream->time_base.den;
-  else
-      video_pts = 0.0;
-
-  if (!video_stream || video_pts >= stream_duration)
-  {
-    this->toList(OM_DEAD);
-    this->closeVideo();
-  }
-  else
-    // write video frame
-    this->writeVideoFrame();
-}
-
-void Recorder::writeVideoFrame()
-{
-  int out_size, err;
-
-  codec_context = video_stream->codec;
-
-  if(frame_count >= stream_nb_frames)
-  {
-    /* no more frame to compress. The codec has a latency of a few
-        frames if using B frames, so we get the last frames by
-        passing the same picture again */
-  }
-  else
-    this->fillYuvImage();
-
-
-  if(format_context->oformat->flags & AVFMT_RAWPICTURE)
-  {
-    // raw video case. The API will change slightly in the near
-    // futur for that
-    av_init_packet(&packet);
-
-    packet.flags |= PKT_FLAG_KEY;
-    packet.stream_index= video_stream->index;
-    packet.data= (uint8_t *)picture;
-    packet.size= sizeof(AVPicture);
-
-    err = av_write_frame(format_context, &packet);
-  }
-  else
-  {
-    // encode the image
-    out_size = avcodec_encode_video(codec_context, buffer, buffer_size, picture);
-    // if zero size, it means the image was buffered
-    if (out_size > 0)
-    {
-      av_init_packet(&packet);
-
-      packet.pts= av_rescale_q(codec_context->coded_frame->pts, codec_context->time_base, video_stream->time_base);
-      if(codec_context->coded_frame->key_frame)
-        packet.flags |= PKT_FLAG_KEY;
-      packet.stream_index = video_stream->index;
-      packet.data= buffer;
-      packet.size= out_size;
-
-      // write the compressed frame in the media file
-      err = av_write_frame(format_context, &packet);
-    }
-    else
-      err = 0;
-  }
-
-  if(err != 0)
-    PRINTF(1)("Error while writing video frame\n");
-
-  frame_count++;
-}
-
-
-void Recorder::fillYuvImage()
-{
-  unsigned char *outputImage = 0;
-
-  // Allocate the neccessary memory.
-  outputImage = (unsigned char*)malloc(width * height * 3);
-
-  // Clear the variable.
-  memset(outputImage, 0, width * height * 3);
-
-  // You use the glReadPixels() to read every pixel on the screen
-  // that you specify.  You must use one less than each size.
-  glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, outputImage);
-
-  int i = 0;
-  for(int y=height-1;y>=0;y--)
-  {
-    for(int x=0;x<width*3;x++)
-    {
-      RGB_frame->data[0][y*width*3+x] = outputImage[i];
-      i++;
-    }
-  }
-
-
-  img_convert((AVPicture*)picture, PIX_FMT_YUV420P, (AVPicture*)RGB_frame,
-              PIX_FMT_RGB24, width, height);
-
-  // Clear the allocated memory.
-  free(outputImage);
-}
-
-
-void Recorder::draw() const
-{
-}
Index: anches/cleanup/src/world_entities/recorder.h
===================================================================
--- /branches/cleanup/src/world_entities/recorder.h	(revision 10590)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/*!
- * @file recorder.h
- *
- */
-
-#ifndef _RECORDER_H
-#define _RECORDER_H
-
-#include "sdlincl.h"
-
-#ifdef HAVE_AVFORMAT_H
-  #include <avformat.h>
-#else
-  #include <ffmpeg/avformat.h>
-#endif
-
-#include "glincl.h"
-#include "world_entity.h"
-
-class Recorder : public WorldEntity
-{
-  ObjectListDeclaration(Recorder);
-  public:
-    Recorder (const TiXmlElement* root = NULL);
-    virtual ~Recorder ();
-
-    virtual void draw () const;
-    virtual void tick (float dt);
-
-    virtual void loadParams(const TiXmlElement* root);
-
-  private:
-    void initVideo(const std::string& filename);
-    void addVideoStream();
-    void openVideo();
-    void closeVideo();
-    void allocPicture();
-    void writeVideoFrame();
-    void fillYuvImage();
-
-    void setStreamDuration(float duration);
-    void setFPS(float fps);
-
-
-  private:
-    AVFrame*            picture;
-    uint8_t*            buffer;
-    int                 frame_count;
-    int                 buffer_size;
-
-    AVOutputFormat*     output_format;
-    AVFormatContext*    format_context;
-    AVCodecContext*     codec_context;
-    AVCodec*            codec;
-    AVStream*           video_stream;
-    AVPacket            packet;
-    double              video_pts;
-
-    uint8_t*            picture_buf;
-    int                 size;
-
-    int                 height;
-    int                 width;
-    float               time;
-
-    float               stream_duration;
-    float               stream_frame_rate;
-    int                 stream_nb_frames;
-
-    AVFrame*            RGB_frame;
-};
-
-#endif /* _RECORDER_H */
Index: anches/cleanup/src/world_entities/satellite.cc
===================================================================
--- /branches/cleanup/src/world_entities/satellite.cc	(revision 10590)
+++ 	(revision )
@@ -1,65 +1,0 @@
-
-
-/*
-   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:
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "satellite.h"
-
-#include "obj/objModel.h"
-
-
-
-
-ObjectListDefinition(Satellite);
-
-/**
- *  standard constructor
-*/
-Satellite::Satellite (Vector axis, float speed)
-{
-  this->registerObject(this, Satellite::_objectList);
-
-  this->loadModel("cube");
-  this->speed = speed;
-  this->axis = new Vector();
-  *this->axis = axis;
-}
-
-/**
- *  standard destructor
-*/
-Satellite::~Satellite ()
-{
-}
-
-
-/**
- *  this method is called every frame
- * @param time: the time in seconds that has passed since the last tick
-
-   Handle all stuff that should update with time inside this method (movement, animation, etc.)
-*/
-void Satellite::tick(float time)
-{
-  float w = this->speed * M_PI;
-
-  Quaternion rotation(w * time, *this->axis);
-  Quaternion v = this->getRelDir();
-
-  this->setRelDir(v * rotation);
-}
-
Index: anches/cleanup/src/world_entities/satellite.h
===================================================================
--- /branches/cleanup/src/world_entities/satellite.h	(revision 10590)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*!
- * @file world_entity.h
-  *  Definition of the basic WorldEntity
-*/
-
-#ifndef _SATELLITE_H
-#define _SATELLITE_H
-
-#include "world_entity.h"
-
-class CharacterAttributes;
-class Model;
-
-
-//! Basic class from which all interactive stuff in the world is derived from
-class Satellite : public WorldEntity
-{
-  ObjectListDeclaration(Satellite);
-
- public:
-  Satellite (Vector axis, float speed);
-  virtual ~Satellite ();
-
-  virtual void tick (float time);
-
- private:
-  Vector*       axis;
-  float         speed;
-
-
-};
-
-#endif /* _SATELLITE_H */
Index: anches/cleanup/src/world_entities/script_trigger.cc
===================================================================
--- /branches/cleanup/src/world_entities/script_trigger.cc	(revision 10590)
+++ 	(revision )
@@ -1,245 +1,0 @@
-/*
-   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: Silvan Nellen
-   co-programmer: ...
-*/
-
-
-#include "script_trigger.h"
-#include "script.h"
-
-#include "state.h"
-#include "debug.h"
-ObjectListDefinition(ScriptTrigger);
-
-CREATE_SCRIPTABLE_CLASS(ScriptTrigger,
-            // Coordinates
-			addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
-			    ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
-			    ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
-			    ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
-            //Properties
-			    ->addMethod("setName", Executor1<BaseObject, lua_State*, const std::string&>(&BaseObject::setName))
-			    ->addMethod("setTarget", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setTarget))
-			    ->addMethod("setTriggerParent", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setTriggerParent))
-			    ->addMethod("setTriggerRemains", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setTriggerRemains))
-			    ->addMethod("setActiveOnCreation", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setActiveOnCreation))
-			    ->addMethod("setInvert", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setInvert))
-			    ->addMethod("setRadius", Executor1<ScriptTrigger, lua_State*, float>(&ScriptTrigger::setRadius))
-			    ->addMethod("setScript", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setScript))
-			    ->addMethod("setFunction", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setFunction))
-			    ->addMethod("setDebugDraw", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setDebugDraw))
-			    ->addMethod("setAddToScript", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setAddToScript))
-             );
-
-
-/**
- * Constructs a new ScriptTrigger.
- * @param root the xml element to load the parameters from.
- *
- */
-ScriptTrigger::ScriptTrigger(const TiXmlElement* root)
-{
-  this->registerObject(this, ScriptTrigger::_objectList);
-  this->toList(OM_COMMON);
-
-  radius = 10;
-  returnCount = 1;
-  scriptFinished = false;
-  doDebugDraw = false;
-  invert = false;
-  scriptCalled = false;
-  scriptIsOk = false;
-  triggerRemains = true;
-  addToScript = false;
-  this->activeOnCreation = false;
-  target = NULL;
-
-  if(root != NULL)
-  {
-
-    loadParams(root);
-
-    if(addToScript && scriptIsOk)
-    {
-      script->addObject( "ScriptTrigger", this->getName());
-    }
-
-  }
-
-}
-
-/**
- * Deletes the ScriptTrigger.
- *
- */
-ScriptTrigger::~ScriptTrigger()
-{
-
-}
-
-/**
- * Reads the values from the tml element and sets them.
- * @param root the xml element to load the parameters from.
- *
- */
-void ScriptTrigger::loadParams(const TiXmlElement* root)
-{
-
-  WorldEntity ::loadParams(root);
-
-  LoadParam(root, "file", this, ScriptTrigger, setScript)
-      .describe("the fileName of the script, that should be triggered by this script trigger")
-      .defaultValues("");
-  LoadParam(root, "function", this, ScriptTrigger, setFunction)
-      .describe("the function of the script, that should be triggered by this script trigger")
-      .defaultValues("");
-  LoadParam(root, "abs-coor", this, ScriptTrigger, setAbsCoor)
-      .describe("where this script trigger should be located")
-      .defaultValues("");
-  LoadParam(root, "radius", this, ScriptTrigger, setRadius)
-      .describe("the fileName of the script, that should be triggered by this script trigger")
-      .defaultValues(0);
-  LoadParam(root, "delay", this, ScriptTrigger, setDelay)
-      .describe("the delay after which the funtion sould be triggered")
-      .defaultValues(0);
-  LoadParam(root, "worldentity", this, ScriptTrigger, setTarget)
-      .describe("The name of the target as it is in the *.oxw file")
-      .defaultValues("");
-  LoadParam(root, "triggerparent", this, ScriptTrigger, setTriggerParent)
-      .describe("The name of the parent as it is in the *.oxw file")
-      .defaultValues("");
-  LoadParam(root, "invert", this, ScriptTrigger, setInvert)
-      .describe("")
-      .defaultValues(false);
-  LoadParam(root, "triggerRemains", this, ScriptTrigger, setTriggerRemains)
-      .describe("")
-      .defaultValues(true);
-  LoadParam(root, "debugdraw", this, ScriptTrigger, setDebugDraw)
-      .describe("")
-      .defaultValues(false);
-  LoadParam(root, "addtoscript", this, ScriptTrigger, setAddToScript)
-      .describe("True if this scripttrigger should be aviable in the script")
-      .defaultValues(false);
-}
-
-
-/**
- * Sets the target(a world entity) of the ScriptTrigger. If the distance between the target and this trigger is smaller than the radius, the script gets triggered.
- * @param target The worldentity that the script supervises.
- */
-void ScriptTrigger::setTarget(const std::string& target)
-{
-
-  WorldEntity* targetEntity = WorldEntity::objectList().getObject(target);
-  if (targetEntity != NULL)
-  {
-    this->setTarget(targetEntity);
-  }
-  else
-  {
-    PRINTF(2)("ERROR SCRTIPTTRIGGER : Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassCName(), this->getCName());
-  }
-}
-
-/**
- * Sets the parent of the trigger.
- * @param parent The parrent.
- */
-void ScriptTrigger::setTriggerParent(const std::string& parent)
-{
-  WorldEntity* parentEntity = WorldEntity::objectList().getObject(parent);
-
-  if (parentEntity != NULL)
-  {
-    this->setParent(parentEntity);
-    this->setParentMode(PNODE_MOVEMENT);
-  }
-  else
-  {
-    PRINTF(2)("ERROR SCRTIPTTRIGGER : Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassCName(), this->getCName());
-  }
-}
-
-void ScriptTrigger::tick(float timestep)
-{
-  if(scriptFinished) return;
-
-  if(activeOnCreation)
-   {
-     executeAction(timestep);
-     return;
-   }
-
- if(triggerRemains && scriptCalled)
-  {
-    executeAction(timestep);
-    return;
-  }
-
-  if( this->target != NULL)
-  {
-    if( !invert && this->distance(target) < radius)
-    {
-    //printf("Distance is %f \n", this->distance(target));
-    executeAction(timestep);
-    scriptCalled = true;
-    return;
-
-    }
-    else if( invert && this->distance(target) > radius)
-    {
-      executeAction(timestep);
-      scriptCalled = true;
-      return;
-    }
-  }
-}
-
-
-void ScriptTrigger::executeAction(float timestep)
-{
-  if(scriptIsOk)
-  {
-       //testScriptingFramework();
-    if(!(script->selectFunction(this->functionName,returnCount)) )
-      PRINT(1)("ERROR SCRTIPTTRIGGER : Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
-
-    script->pushParam( timestep, this->functionName);
-
-    if( !(script->executeFunction()) )
-      PRINT(1)("ERROR SCRTIPTTRIGGER : Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
-
-    scriptFinished = script->getReturnedBool();
-  }
-  else
-  printf("ERROR SCRTIPTTRIGGER : Script could not be executed !\n");
-
-
-}
-
-
-void ScriptTrigger::setScript(const std::string& file)
-{
-  ScriptManager* scriptManager = State::getScriptManager();
-  if (scriptManager != NULL)
-  {
-
-    script = scriptManager->getScriptByFile(file);
-    if(script != NULL)
-    {
-      scriptIsOk = true;
-    }
-    else
-    printf("ERROR SCRTIPTTRIGGER : Could not find the wrapperobject of %s , the script won't be executed ! \n", file.c_str());
-  }
-}
Index: anches/cleanup/src/world_entities/script_trigger.h
===================================================================
--- /branches/cleanup/src/world_entities/script_trigger.h	(revision 10590)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/*!
- * @file scrip_trigger.h
- *  triggeres a script
- */
-
-#ifndef _SCRIPT_TRIGGER_H
-#define _SCRIPT_TRIGGER_H
-
-#include <string>
-
-#include "world_entity.h"
-#include "loading/load_param.h"
-#include "vector.h"
-#include "script_manager.h"
-#include "script.h"
-#include "script_class.h"
-
-class ScriptTrigger : public WorldEntity
-{
-  ObjectListDeclaration(ScriptTrigger);
-  public:
-    ScriptTrigger(const TiXmlElement* root = NULL);
-    ~ScriptTrigger();
-
-    ///LOADING
-    virtual void loadParams(const TiXmlElement* root);
-
-
-    /// DO WORK
-    virtual void tick(float timestep);
-    virtual void executeAction(float timestep);
-
-    /// SET MEMBER
-    void setTarget(const std::string& targetName);
-    void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target; }
-    void setTriggerParent(const std::string& name);
-    void setTriggerRemains(const bool lasts) { this->triggerRemains = lasts; }
-    void setActiveOnCreation(const bool avtive) { this->activeOnCreation = avtive; }
-    void setInvert(const bool inv) { this->invert = invert; }
-    void setDelay(float delay) { this->delay = delay; };
-    void setRadius(const float radius) { if(radius>0) this->radius = radius; }
-    void setScript(const std::string& file);
-    void setFunction(const std::string& function){ this->functionName = function;}
-    void setDebugDraw(const bool draw) { this->doDebugDraw = draw; }
-    void setAddToScript(const bool add) { this->addToScript = add; }
-
-    ///DRAWING
-    void draw()const{if(doDebugDraw)this->debugDraw();};
-
-  private:
-
-    WorldEntity* target;
-    bool         triggerRemains;
-    bool         activeOnCreation;
-    bool         invert;
-    float        radius;
-    float        delay;
-    Script*      script;
-    std::string  functionName;
-    bool         doDebugDraw;
-    bool         addToScript;
-    //for internal use
-    bool         scriptCalled;
-    bool         scriptIsOk;
-    bool         scriptFinished;
-    int          returnCount;        //TODO: set return count correctly
-
-};
-
-
-#endif
Index: anches/cleanup/src/world_entities/scrolling_screen.cc
===================================================================
--- /branches/cleanup/src/world_entities/scrolling_screen.cc	(revision 10590)
+++ 	(revision )
@@ -1,288 +1,0 @@
-/*
-   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: Filip Gospodinov
-   co-programmer:
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-#include "scrolling_screen.h"
-
-#include "util/loading/factory.h"
-#include "util/loading/load_param.h"
-
-#include "debug.h"
-#include "material.h"
-#include "state.h"
-#include "cameraman.h"
-#include "camera.h"
-
-#include "script_class.h"
-
-
-ObjectListDefinition(ScrollingScreen);
-CREATE_FACTORY(ScrollingScreen);
-
-CREATE_SCRIPTABLE_CLASS(ScrollingScreen,
-                        addMethod("start", Executor0<ScrollingScreen, lua_State*>(&ScrollingScreen::start))
-                       );
-
-
-/**
- *
- */
-ScrollingScreen::ScrollingScreen()
-{
-  this->init();
-}
-
-
-/**
- *
- */
-ScrollingScreen::ScrollingScreen(const TiXmlElement* root)
-{
-  this->init();
-
-  if( root != NULL)
-    this->loadParams(root);
-}
-
-
-/**
- *
- */
-ScrollingScreen::~ScrollingScreen()
-{}
-
-void ScrollingScreen::start()
-{
-  this->bRun = true;
-}
-
-/**
- *
- */
-void ScrollingScreen::init()
-{
-  this->registerObject(this, ScrollingScreen::_objectList);
-  this->toList(OM_COMMON);
-
-  this->material = new Material();
-  this->material->setDiffuse(1,1,1);
-  this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
-  this->isTransparent = false;
-  this->transparency = 1.0;
-  this->offset = 0.0;
-
-  this->xSize = 0.;
-  this->ySize = 0.;
-  this->mode = SCSC_VIEW;
-  this->bRun = false;
-}
-
-
-/**
- * loads the Settings of a MD2Creature from an XML-element.
- * @param root the XML-element to load the MD2Creature's properties from
- */
-void ScrollingScreen::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-
-  LoadParam(root, "setSpeed", this, ScrollingScreen, setSpeed);
-
-  LoadParam(root, "setHeight", this, ScrollingScreen, setViewHeight);
-
-  LoadParam(root, "setSizeX", this, ScrollingScreen, setSizeX);
-  LoadParam(root, "setSizeY", this, ScrollingScreen, setSizeY);
-
-  LoadParam(root, "texture", this, ScrollingScreen, setTexture);
-}
-
-
-
-
-/**
- * sets the texture
- * @param texture name of tex
- */
-void ScrollingScreen::setTexture(const std::string& texture)
-{
-  this->material->setDiffuseMap(texture);
-
-  Texture t = this->material->diffuseTexture();
-  this->ratio = t.getWidth() / t.getHeight();
-}
-
-
-
-
-void ScrollingScreen::draw() const
-{
-
-  if( this->offset - this->ratio > 1.|| this->offset < -1. || !this->bRun)
-    return;
-
-  if( this->mode == SCSC_FULL)
-    this->drawFull();
-  else
-    this->drawView();
-}
-
-void ScrollingScreen::drawFull() const
-{
-  glPushAttrib(GL_ENABLE_BIT);
-  glDisable(GL_LIGHTING);
-  glDisable(GL_FOG);
-  glEnable(GL_BLEND);
-
-  glMatrixMode(GL_MODELVIEW);
-  glPushMatrix();
-  /* translate */
-  glTranslatef (this->getAbsCoor ().x,
-                this->getAbsCoor ().y,
-                this->getAbsCoor ().z);
-  Vector tmpRot = this->getAbsDir().getSpacialAxis();
-  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
-
-  this->material->select();
-
-
-  glBegin(GL_QUADS);
-
-  // unten links
-  glTexCoord2f(0., 1.);
-  glVertex3f(0., -this->xSize*0.5, -this->ySize*0.5);
-
-  // unten rechts
-  glTexCoord2f(1., 1.);
-  glVertex3f(0., -this->xSize*0.5, this->ySize*0.5);
-
-  // oben rechts
-  glTexCoord2f(1., 0.);
-  glVertex3f(0., this->xSize*0.5, this->ySize*0.5);
-
-  // oben links
-  glTexCoord2f(0., 0.);
-  glVertex3f(0., this->xSize*0.5, -this->ySize*0.5);
-
-  glEnd();
-
-  glPopAttrib();
-  glPopMatrix();
-}
-
-void ScrollingScreen::drawView() const
-{
-  glPushAttrib(GL_ENABLE_BIT);
-  glDisable(GL_LIGHTING);
-  glDisable(GL_FOG);
-  glEnable(GL_BLEND);
-
-  glMatrixMode(GL_MODELVIEW);
-  glPushMatrix();
-  /* translate */
-  glTranslatef (this->getAbsCoor ().x,
-                this->getAbsCoor ().y,
-                this->getAbsCoor ().z);
-  Vector tmpRot = this->getAbsDir().getSpacialAxis();
-  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
-
-  this->material->select();
-
-  float resize = (1. - (this->viewHeight + this->offset));
-
-  float x,y;
-  if( this->xSize != 0.)
-  {
-    x = this->xSize;
-    y = x * this->ratio;
-  }
-  else
-  {
-    y = this->ySize;
-    x = y * this->ratio;
-  }
-
-  float ratShift = 0.;
-  float borderTex = this->offset + ratio;
-  // we are above/below
-  if( 1 - (offset + ratio) < 0)
-  {
-    borderTex = 1.0;
-    ratShift = 1. - (1.-offset)/ratio;
-  }
-
-  glBegin(GL_QUADS);
-  // unten links
-  glTexCoord2f(0., borderTex);
-  glVertex3f(0., -(x*0.5 - x*ratShift), -y*0.5);
-
-  // unten rechts
-  glTexCoord2f(1., borderTex);
-  glVertex3f(0., -(x*0.5 - x*ratShift), y*0.5);
-
-  // oben rechts
-  glTexCoord2f(1., this->offset);
-  glVertex3f(0., x*0.5, y*0.5);
-
-  // oben links
-  glTexCoord2f(0., this->offset);
-  glVertex3f(0., x*0.5, -y*0.5);
-
-  glEnd();
-
-  glPopAttrib();
-  glPopMatrix();
-}
-
-
-/**
- *
- */
-void ScrollingScreen::tick (float time)
-{
-
-  if( !this->bRun)
-    return;
-
-  CameraMan* cm = State::getCameraman();
-  const Camera* cam = cm->getCurrentCam();
-  PNode* tar = cam->getTargetNode();
-
-  Vector dir = tar->getAbsCoor() - cam->getAbsCoor();
-  dir = dir.getNormalized();
-
-  float offset = 6.;
-
-  this->setAbsCoor( cam->getAbsCoor() + dir * offset);
-
-
-  Vector ddir = dir.cross( cam->getAbsDirV());
-  Quaternion q(ddir, cam->getAbsDirY());
-  this->setAbsDir( q);
-
-  // scroll the texture
-  this->offset += time * this->scrollingSpeed;
-  //     if( this->offset - this->ratio > 1.|| this->offset < -1.)
-  //       this->offset = 0.;
-
-}
-
-void ScrollingScreen::fadeIn(float speed)
-{
-}
-
-void ScrollingScreen::fadeOut(float speed)
-{
-}
Index: anches/cleanup/src/world_entities/scrolling_screen.h
===================================================================
--- /branches/cleanup/src/world_entities/scrolling_screen.h	(revision 10590)
+++ 	(revision )
@@ -1,68 +1,0 @@
-#ifndef _SCROLLING_SCREEN_H
-#define _SCROLLING_SCREEN_H
-
-#include "world_entity.h"
-
-
-class TiXmlElement;
-class Material;
-
-class ScrollingScreen : public WorldEntity
-{
-  ObjectListDeclaration(ScrollingScreen);
-
-
-
-public:
-  ScrollingScreen();
-  ScrollingScreen(const TiXmlElement* root);
-  virtual ~ScrollingScreen();
-
-  typedef enum ScScMode
-  {
-     SCSC_FULL  = 0,
-     SCSC_VIEW
-  };
-
-  void init();
-  virtual void loadParams(const TiXmlElement* root);
-
-  void start();
-
-  void fadeIn(float speed);
-  void fadeOut(float speed);
-
-  void setTexture(const std::string& texture);
-
-  void setSpeed(float speed) { this->scrollingSpeed = speed; }
-  void setViewHeight(float height) { this->viewHeight = height; }
-  void setSizeY(float ySize) { this->ySize = ySize; }
-  void setSizeX(float xSize) { this->xSize = xSize; }
-
-  virtual void tick (float time);
-
-  virtual void draw() const;
-  void drawFull() const;
-  void drawView() const;
-
-
-private:
-  Material*       material;
-  bool            isTransparent;
-  float           transparency;
-  float           fadeingSpeed;
-
-  float           scrollingSpeed;
-  float           viewHeight;
-  float           offset;
-  float           ratio;
-
-  float           xSize;
-  float           ySize;
-
-  int             mode;
-
-  bool            bRun;
-};
-
-#endif /* _SCROLLING_SCREEN_H */
Index: anches/cleanup/src/world_entities/skybox.cc
===================================================================
--- /branches/cleanup/src/world_entities/skybox.cc	(revision 10590)
+++ 	(revision )
@@ -1,313 +1,0 @@
-/*
-   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: Benjamin Grauer
-   co-programmer: ...
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-#include "skybox.h"
-
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-#include "static_model.h"
-
-#include "material.h"
-#include "texture.h"
-
-#include "network_game_manager.h"
-#include "converter.h"
-#include "resource_texture.h"
-
-#include "debug.h"
-
-
-ObjectListDefinition(SkyBox);
-CREATE_FACTORY(SkyBox);
-
-/**
- * Constructs a SkyBox and takes fileName as a map.
- * @param fileName the file to take as input for the SkyBox
-*/
-SkyBox::SkyBox(const std::string& fileName)
-{
-  this->preInit();
-  if (!fileName.empty())
-    this->setTextureAndType(fileName, ".jpg");
-  this->postInit();
-}
-
-/**
- *  initializes a skybox from a XmlElement
-*/
-SkyBox::SkyBox(const TiXmlElement* root)
-{
-  this->preInit();
-
-  if( root != NULL)
-    this->loadParams(root);
-
-  this->postInit();
-}
-
-void SkyBox::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-
-  LoadParam(root, "Materialset", this, SkyBox, setTexture)
-      .describe("Sets the material on the SkyBox. The string must be the path relative to the data-dir, and without a trailing .jpg");
-
-  LoadParam(root, "Size", this, SkyBox, setSize)
-      .describe("Sets the Size of the SkyBox (normally this should be 90% of the maximal viewing Distance).");
-}
-
-void SkyBox::preInit()
-{
-  this->registerObject(this, SkyBox::_objectList);
-  this->toList(OM_BACKGROUND);
-  this->toReflectionList();
-  //this->size = 100.0;
-  this->textureSize = 1024.0f;
-
-  for (int i = 0; i < 6; i++)
-    {
-      this->material[i] = new Material();
-      this->material[i]->setIllum(3);
-      this->material[i]->setDiffuse(0.0,0.0,0.0);
-      this->material[i]->setSpecular(0.0,0.0,0.0);
-      this->material[i]->setAmbient(2.0, 2.0, 2.0);
-
-      this->cubeTexture[i] = NULL;
-    }
-  this->setParentMode(PNODE_MOVEMENT);
-
-  this->textureName = "";
-}
-
-void SkyBox::postInit()
-{
-  this->rebuild();
-
-  textureName_handle = registerVarId( new SynchronizeableString( &textureName, &textureName, "textureName", PERMISSION_MASTER_SERVER) );
-  size_handle = registerVarId( new SynchronizeableFloat( &size, &size, "size", PERMISSION_MASTER_SERVER ) );
-}
-
-
-/**
- *  default destructor
-*/
-SkyBox::~SkyBox()
-{
-  PRINTF(5)("Deleting SkyBox\n");
-  for (int i = 0; i < 6; i++)
-  {
-    if (this->material[i])
-      delete this->material[i];
-  }
-}
-
-void SkyBox::setTexture(const std::string& name)
-{
-  this->textureName = name;
-  this->setTextureAndType (name, "jpg");
-};
-
-
-/**
- * @brief sets A set of textures when just giving a Name and an extension:
- * @param name the prefix of the Name
- * @param extension the file extension (jpg by default)
- * usage: give this function an argument like
- * setTexture("skybox", "jpg");
- * and it will convert this to
- * setTextures("skybox_negx.jpg", "skybox_posx.jpg", "skybox_negy.jpg",
- *             "skybox_posy.jpg", "skybox_negz.jpg", "skybox_posz.jpg");
- */
-void SkyBox::setTextureAndType(const std::string& name, const std::string& extension)
-{
-  std::string negX = name + "_negx." + extension;
-  std::string posX = name + "_posx." + extension;
-
-  std::string negY = name + "_negy." + extension;
-  std::string posY = name + "_posy." + extension;
-
-  std::string negZ = name + "_negz." + extension;
-  std::string posZ = name + "_posz." + extension;
-
-  this->setTextures(negX, posX, negY, posY, negZ, posZ);
-}
-
-/**
- * @brief Defines which textures should be loaded onto the SkyBox.
- * @param negX the top texture.
- * @param posX the bottom texture.
- * @param negY the left texture.
- * @param posY the right texture.
- * @param negZ the front texture.
- * @param posZ the back texture.
-*/
-void SkyBox::setTextures(const std::string& negX, const std::string& posX,
-                         const std::string& negY, const std::string& posY,
-                         const std::string& negZ, const std::string& posZ)
-{
-  this->material[0]->setDiffuseMap(negX);
-  this->material[1]->setDiffuseMap(posX);
-  this->material[2]->setDiffuseMap(negY);
-  this->material[3]->setDiffuseMap(posY);
-  this->material[4]->setDiffuseMap(negZ);
-  this->material[5]->setDiffuseMap(posZ);
-  if (GLEW_EXT_texture_cube_map)
-    this->loadCubeMapTextures(negX, posX, negY, posY, negZ, posZ);
-}
-
-void SkyBox::loadCubeMapTextures(const std::string& posY, const std::string& negY, const std::string& negZ,
-                                  const std::string& posZ, const std::string& posX, const std::string& negX)
-{
-  this->cubeTexture[0] = ResourceTexture(negX, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT);
-  this->cubeTexture[1] = ResourceTexture(posX, GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT);
-
-  this->cubeTexture[2] = ResourceTexture(negY, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT);
-  this->cubeTexture[3] = ResourceTexture(posY, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT);
-
-  this->cubeTexture[4] = ResourceTexture(negZ, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT);
-  this->cubeTexture[5] = ResourceTexture(posZ, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT);
-}
-
-void SkyBox::enableCubeMap()
-{
-  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
-  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
-  glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
-
-  glEnable(GL_TEXTURE_CUBE_MAP_EXT);
-
-  glEnable(GL_TEXTURE_GEN_S);
-  glEnable(GL_TEXTURE_GEN_T);
-  glEnable(GL_TEXTURE_GEN_R);
-
-}
-
-void SkyBox::disableCubeMap()
-{
-  glDisable(GL_TEXTURE_CUBE_MAP);
-  glDisable(GL_TEXTURE_2D);
-  glDisable(GL_TEXTURE_GEN_S);
-  glDisable(GL_TEXTURE_GEN_T);
-  glDisable(GL_TEXTURE_GEN_R);
-
-  glDisable(GL_TEXTURE_GEN_S);
-  glDisable(GL_TEXTURE_GEN_T);
-  glDisable(GL_TEXTURE_GEN_R);
-}
-
-
-
-/**
- * @param size The new size of the SkyBox
-
- * do not forget to rebuild the SkyBox after this.
-*/
-void SkyBox::setSize(float size)
-{
-  this->size = size;
-}
-
-
-
-void SkyBox::draw()
-{
-  glPushAttrib(GL_ENABLE_BIT);
-//   glPushAttrib(GL_LIGHTING_BIT);
-  glDisable(GL_LIGHTING);
-
-  glDisable(GL_FOG);
-
-  WorldEntity::draw();
-
-  glPopAttrib();
-
-}
-
-
-/**
- *  rebuilds the SkyBox
-
-   this must be done, when changing the Size of the Skybox (runtime-efficency)
-*/
-void SkyBox::rebuild()
-{
-  StaticModel* model = new StaticModel();
-
-  model->addVertex (-0.5*size, -0.5*size, 0.5*size);
-  model->addVertex (0.5*size, -0.5*size, 0.5*size);
-  model->addVertex (-0.5*size, 0.5*size, 0.5*size);
-  model->addVertex (0.5*size, 0.5*size, 0.5*size);
-  model->addVertex (-0.5*size, 0.5*size, -0.5*size);
-  model->addVertex (0.5*size, 0.5*size, -0.5*size);
-  model->addVertex (-0.5*size, -0.5*size, -0.5*size);
-  model->addVertex (0.5*size, -0.5*size, -0.5*size);
-
-//   model->addVertexTexture (0.0, 1.0);
-//   model->addVertexTexture (1.0, 1.0);
-//   model->addVertexTexture (1.0, 0.0);
-//   model->addVertexTexture (0.0, 0.0);
-
-  model->addVertexTexture (1.0/this->textureSize, (this->textureSize - 1.0)/this->textureSize);
-  model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, (this->textureSize - 1.0)/this->textureSize);
-  model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, 1.0/this->textureSize);
-  model->addVertexTexture (1.0/this->textureSize, 1.0/this->textureSize);
-
-
-  model->addVertexNormal (0.0, 0.0, 1.0);
-  model->addVertexNormal (0.0, 1.0, 0.0);
-  model->addVertexNormal (0.0, 0.0, -1.0);
-  model->addVertexNormal (0.0, -1.0, 0.0);
-  model->addVertexNormal (1.0, 0.0, 0.0);
-  model->addVertexNormal (-1.0, 0.0, 0.0);
-
-  model->setMaterial(material[0]);
-  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
-  model->setMaterial(material[1]);
-  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,5); // front
-  model->setMaterial(material[2]);
-  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,1, 7,1,1, 1,2,1, 0,3,1); // bottom
-  model->setMaterial(material[3]);
-  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,0,3, 3,1,3, 5,2,3, 4,3,3); // top
-  model->setMaterial(material[4]);
-  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,2, 5,3,2, 7,0,2, 6,1,2); // left
-  model->setMaterial(material[5]);
-  model->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,0, 3,2,0, 2,3,0); // right
-
-  model->finalize();
-
-  this->setModel(model);
-}
-
-void SkyBox::varChangeHandler( std::list< int > & id )
-{
-  bool somethinChanged = false;
-
-  if ( std::find( id.begin(), id.end(), textureName_handle ) != id.end() )
-  {
-    somethinChanged = true;
-    setTexture( textureName );
-  }
-
-  if ( std::find( id.begin(), id.end(), size_handle ) != id.end() )
-  {
-    somethinChanged = true;
-  }
-
-  rebuild();
-
-  WorldEntity::varChangeHandler( id );
-}
Index: anches/cleanup/src/world_entities/skybox.h
===================================================================
--- /branches/cleanup/src/world_entities/skybox.h	(revision 10590)
+++ 	(revision )
@@ -1,81 +1,0 @@
-/*!
- * @file skybox.h
- *  Definition of the SkyBox, that handles the Display of an atmosphere for orxonox.
- *
- * A SkyBox is always centered at the current working Camera, and will only obey the cameras
- * movment but not its rotation.
-*/
-
-#ifndef _SKYBOX_H
-#define _SKYBOX_H
-
-/* INCLUDES */
-#include "world_entity.h"
-#include "material.h"
-
-enum SKY_SIDE
-{
-  SKY_BACK = 0,
-  SKY_FRONT,
-  SKY_BOTTOM,
-  SKY_TOP,
-  SKY_LEFT,
-  SKY_RIGHT,
-};
-
-//! A Class to handle a SkyBox
-class SkyBox : public WorldEntity
-{
-  ObjectListDeclaration(SkyBox);
-public:
-  SkyBox(const std::string& fileName = "");
-  SkyBox(const TiXmlElement* root);
-
-  virtual ~SkyBox();
-
-  void init();
-  void preInit();
-
-  virtual void loadParams(const TiXmlElement* root);
-
-  void postInit();
-
-  virtual void draw();
-
-  void setSize(float size);
-  /** assumes jpg as input-format */
-  void setTexture(const std::string& name);
-
-  void setTextureAndType(const std::string& name, const std::string& extension);
-  void setTextures(const std::string& negX, const std::string& posX, const std::string& negY,
-                   const std::string& posY, const std::string& negZ, const std::string& posZ);
-
-  void loadCubeMapTextures(const std::string& negX, const std::string& posX, const std::string& negY,
-                           const std::string& posY, const std::string& negZ, const std::string& posZ);
-
-  GLuint getTexture(SKY_SIDE side) const { return (this->material[side]) ? this->material[side]->diffuseTextureID(): 0; };
-
-  static void enableCubeMap();
-  static void disableCubeMap();
-
-  virtual void varChangeHandler( std::list<int> & id );
-
- private:
-  void rebuild();
-
-  Material*       material[6];     //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
-  Texture         cubeTexture[6];  //!< Textures for the CubeMap.
-
-  float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
-  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
-  std::string     textureName;     //!< Name of the Texture
-
-  int textureName_handle;          //!< used to notify about changes of textureName
-  int size_handle;                 //!< used to notify about changes of size
-
-};
-
-#endif  /* _SKYBOX_H */
-
-
-
Index: anches/cleanup/src/world_entities/skydome.cc
===================================================================
--- /branches/cleanup/src/world_entities/skydome.cc	(revision 10590)
+++ 	(revision )
@@ -1,229 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2006 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: hdavid, amaechler
-   co-programmer: ...
-*/
-
-#include "skydome.h"
-
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-#include "static_model.h"
-#include "shader.h"
-
-#include "network_game_manager.h"
-#include "converter.h"
-
-#include "debug.h"
-
-#define DTOR (PI/180.0f)
-#define SQR(x) (x*x)
-
-
-
-ObjectListDefinition(Skydome);
-
-/**
- *  initializes a skybox from a XmlElement
- */
-Skydome::Skydome()
-{
-  this->init();
-}
-
-
-void Skydome::init()
-{
-  PRINTF(4)("Skydome init\n");
-
-  this->registerObject(this, Skydome::_objectList);
-  this->toList(OM_BACKGROUND);
-  this->toReflectionList();
-  this->indices = NULL;
-  this->vertices = NULL;
-  this->planeVertices = NULL;
-  this->shader = NULL;
-  activateDome = false;
-
-}
-
-
-/**
- *  default destructor
- */
-Skydome::~Skydome()
-{
-  PRINTF(4)("Deleting Skydome\n");
-
-  if (glIsTexture(texture))
-    glDeleteTextures(1, &texture);
-}
-
-
-void Skydome::setShader(Shader* shader)
-{
-  this->shader = shader;
-}
-
-void Skydome::setTexture(GLuint texture)
-{
-  this->texture = texture;
-}
-
-
-void Skydome::activate()
-{
-  this->activateDome = true;
-}
-
-void Skydome::deactivate()
-{
-  this->activateDome = false;
-}
-
-
-void Skydome::draw() const
-{
-  if(!activateDome)
-    return;
-
-  glPushAttrib(GL_ENABLE_BIT);
-
-  glDisable(GL_LIGHTING);
-  glDisable(GL_BLEND);
-  glDisable(GL_FOG);
-
-  glEnable(GL_TEXTURE_3D);
-  glBindTexture(GL_TEXTURE_3D, texture);
-
-  if ( this->shader && Shader::isSupported() )
-  {
-    this->shader->activateShader();
-  
-    glPushMatrix();
-    glTranslatef(0.0f,pRadius,0.0f);
-  
-    glBegin(GL_TRIANGLES);
-    for (int i=0; i < numIndices; i++)
-    {
-      glColor3f(1.0f, 1.0f, 1.0f);
-  
-      glTexCoord2f(planeVertices[indices[i]].u, planeVertices[indices[i]].v);
-      glVertex3f(planeVertices[indices[i]].x, planeVertices[indices[i]].y, planeVertices[indices[i]].z);
-    }
-    glEnd();
-  
-    WorldEntity::draw();
-  
-    glPopMatrix();
-  
-    this->shader->deactivateShader();
-  }
-  glPopAttrib();
-}
-
-
-void Skydome::generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius, float hTile, float vTile)
-{
-  PRINTF(0)("Generating a sky plane\n");
-
-  // Make sure our vertex array is clear
-  if (planeVertices)
-  {
-    delete planeVertices;
-    planeVertices = NULL;
-  }
-
-  // Make sure our index array is clear
-  if (indices)
-  {
-    delete indices;
-    indices = NULL;
-  }
-
-  // Set the number of divisions into a valid range
-  int divs = divisions;
-  if (divisions < 1)
-    divs = 1;
-
-  if (divisions > 256)
-    divs = 256;
-
-  pRadius = planetRadius;
-
-  // Initialize the Vertex and indices arrays
-  numPlaneVertices = (divs + 1) * (divs + 1);   // 1 division would give 4 verts
-  numIndices  = divs * divs * 2 * 3;       // 1 division would give 6 indices for 2 tris
-
-  planeVertices = new VertexInfo[numPlaneVertices];
-  memset(planeVertices, 0, sizeof(VertexInfo));
-
-  indices = new int[numIndices];
-  memset(indices, 0, sizeof(int)*numIndices);
-
-  // Calculate some values we will need
-  float plane_size = 2.0f * (float)sqrt((SQR(atmosphereRadius)-SQR(planetRadius)));
-  float delta = plane_size/(float)divs;
-  float tex_delta = 2.0f/(float)divs;
-
-  // Variables we'll use during the dome's generation
-  float x_dist   = 0.0f;
-  float z_dist   = 0.0f;
-  float x_height = 0.0f;
-  float z_height = 0.0f;
-  float height = 0.0f;
-
-  VertexInfo SV; // temporary vertex
-
-  for (int i=0;i <= divs;i++)
-  {
-    for (int j=0; j <= divs; j++)
-    {
-      x_dist = (-0.5f * plane_size) + ((float)j*delta);
-      z_dist = (-0.5f * plane_size) + ((float)i*delta);
-
-      x_height = (x_dist*x_dist) / atmosphereRadius;
-      z_height = (z_dist*z_dist) / atmosphereRadius;
-      height = x_height + z_height;
-
-      SV.x = x_dist;
-      SV.y = 0.0f - height;
-      SV.z = z_dist;
-
-      // Calculate the texture coordinates
-      SV.u = hTile*((float)j * tex_delta*0.5f);
-      SV.v = vTile*(1.0f - (float)i * tex_delta*0.5f);
-
-      planeVertices[i*(divs+1)+j] = SV;
-    }
-  }
-
-  // Calculate the indices
-  int index = 0;
-  for (int i=0; i < divs;i++)
-  {
-    for (int j=0; j < divs; j++)
-    {
-      int startvert = (i*(divs+1) + j);
-
-      // tri 1
-      indices[index++] = startvert;
-      indices[index++] = startvert+1;
-      indices[index++] = startvert+divs+1;
-
-      // tri 2
-      indices[index++] = startvert+1;
-      indices[index++] = startvert+divs+2;
-      indices[index++] = startvert+divs+1;
-    }
-  }
-}
Index: anches/cleanup/src/world_entities/skydome.h
===================================================================
--- /branches/cleanup/src/world_entities/skydome.h	(revision 10590)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/*!
- * @file skydome.h
- */
-
-#ifndef _SKYDOME_H
-#define _SKYDOME_H
-
-/* INCLUDES */
-#include "world_entity.h"
-#include "shader.h"
-
-//   typedef struct VERTEX
-// {
-//   float x,y,z;
-//   unsigned int color;
-//   float u, v;
-// }  ;
-
-
-//! A Class to handle a SkyDome
-class Skydome : public WorldEntity
-{
-  ObjectListDeclaration(Skydome);
-public:
-  Skydome();
-
-  virtual ~Skydome();
-
-  void init();
-  virtual void draw() const;
-
-  void generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius,
-                        float hTile, float vTile);
-
-  void setShader(Shader* shader);
-  void setTexture(GLuint texture);
-
-  void activate();
-  void deactivate();
-
-private:
-
-  typedef struct VertexInfo
-  {
-    float x,y,z;
-    unsigned int color;
-    float u, v;
-  };
-
-  bool activateDome;
-
-  VertexInfo *planeVertices;
-  int numPlaneVertices;
-
-  int *indices;
-  int numIndices;
-
-  float pRadius;
-
-  VertexInfo *vertices;
-  int numVertices;
-
-  GLuint texture;
-  Shader* shader;
-};
-
-#endif  /* _SKYDOME_H */
Index: anches/cleanup/src/world_entities/skysphere.cc
===================================================================
--- /branches/cleanup/src/world_entities/skysphere.cc	(revision 10590)
+++ 	(revision )
@@ -1,121 +1,0 @@
-/*
-   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: David Gruetter
-   co-programmer: Benjamin Grauer
-
-   Created by Dave: this file is actually quite similar to player.cc and so is
-   skybox.h similar to player.h
-   With that said, things should be clear:)
-
-   Edited:
-   Bensch: more constructors, changeability, comments...
-   Patrick: giving it the common orxonox style, not much to do... good work Dave!
-
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "skysphere.h"
-
-#include "material.h"
-#include "debug.h"
-
-
-ObjectListDefinition(Skysphere);
-
-/**
- *  Constructs a SkySphere and takes fileName as a map.
- * @param fileName the file to take as input for the skysphere
-*/
-Skysphere::Skysphere(char* fileName)
-{
-  this->registerObject(this, Skysphere::_objectList);
-  this->toList(OM_BACKGROUND);
-  if (fileName == NULL)
-    this->initialize("textures/sky-replace.jpg");
-  else
-    this->initialize(fileName);
-}
-
-
-/**
- *  default destructor
-*/
-Skysphere::~Skysphere()
-{
-  PRINTF(3)("Deleting the SkySphere\n");
-  delete this->skyMaterial;
-  gluDeleteQuadric(this->sphereObj);
-}
-
-/**
- *  initializes the Skysphere.
- * @param fileName the file to take as input for the skysphere
-*/
-void Skysphere::initialize(char* fileName)
-{
-  PRINTF(1)("initializing the Skysphere with Material %s.\n", fileName);
-  this->sphereObj = gluNewQuadric();
-  this->setParentMode(PNODE_MOVEMENT);
-
-  gluQuadricTexture(this->sphereObj, GL_TRUE);
-  this->setRadius(1900.0);
-
-  this->skyMaterial = new Material("Sky");
-  this->setTexture(fileName);
-  this->skyMaterial->setIllum(3);
-  this->skyMaterial->setAmbient(1.0, 1.0, 1.0);
-}
-
-
-/**
- *  Defines which texture should be loaded onto the skysphere.
- * @param fileName The filename of the Texture
-*/
-void Skysphere::setTexture(char* fileName)
-{
-  this->skyMaterial->setDiffuseMap(fileName);
-}
-
-
-/**
- *  draws the Skysphere
-
-   This part is normally precessed in the "Painting Phase".
-*/
-void Skysphere::draw() const
-{
-  glMatrixMode(GL_MODELVIEW);
-  glPushMatrix();
-
-  Vector r = this->getAbsCoor();
-  glTranslatef(r.x, r.y, r.z);
-
-  //glRotatef(-30, 1, 0, 0);
-  //glRotatef(95.0f, 0.0f, 0.0f, 1.0f);
-  //glRotatef(-250.0f, 0.0, 1.0f, 0.0f);
-
-  skyMaterial->select();
-  gluSphere(this->sphereObj, this->sphereRadius, 20, 20);
-  glPopMatrix();
-}
-
-
-/**
- *  sets the Radius of the Sphere.
- * @param radius The Radius of The Sphere
-*/
-void Skysphere::setRadius(float radius)
-{
-  this->sphereRadius = radius;
-}
Index: anches/cleanup/src/world_entities/skysphere.h
===================================================================
--- /branches/cleanup/src/world_entities/skysphere.h	(revision 10590)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*!
- * @file skysphere.h
-  *  Definition of the Skysphere, that handles the Display of an atmosphere of orxonox.
-
-    A SkySphere is always centered at the current working Camera, and will only obey the cameras
-    movment but not its rotation.
-
-    @todo self-rotation
-    @todo handle reference to parent-object
-*/
-
-#ifndef _SKYSPHERE_H
-#define _SKYSPHERE_H
-
-/* INCLUDES */
-#include "world_entity.h"
-#include "glincl.h"
-
-/* FORWARD DECLARATION */
-class Material;
-class Vector;
-
-//! A Class to handle a SkySphere
-class Skysphere : public WorldEntity
-{
-  ObjectListDeclaration(Skysphere);
-
- public:
-  Skysphere(char* fileName = NULL);
-  virtual ~Skysphere();
-
-  void setRadius(float radius);
-  void setTexture(char* fileName);
-
-  virtual void draw() const;
-
-  private:
-    void initialize(char* fileName);
-
- private:
-  GLUquadricObj*    sphereObj;           //!< A Placeholder for the SkySphere.
-  Material*         skyMaterial;         //!< A Material for the SkySphere.
-  float             sphereRadius;        //!< Radius of the SkySphere. This should match the frustum maximum range.
-};
-
-#endif  /* _SKYSPHERE_H */
-
-
-
Index: anches/cleanup/src/world_entities/sound_entity.cc
===================================================================
--- /branches/cleanup/src/world_entities/sound_entity.cc	(revision 10590)
+++ 	(revision )
@@ -1,106 +1,0 @@
-/*
-   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
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
-
-
-#include "sound_entity.h"
-
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-#include "material.h"
-
-#include "sound/resource_sound_buffer.h"
-
-
-
-
-
-
-ObjectListDefinition(SoundEntity);
-CREATE_FACTORY(SoundEntity);
-
-/**
- *  standard constructor
-*/
-SoundEntity::SoundEntity (const TiXmlElement* root)
-{
-  this->registerObject(this, SoundEntity::_objectList);
-
-  this->toList(OM_COMMON);
-
-  this->soundSource.setSourceNode(this);
-
-  this->bInit = false;
-
-  if( root != NULL)
-    this->loadParams(root);
-
-}
-
-
-/**
- *  standard deconstructor
-*/
-SoundEntity::~SoundEntity ()
-{
-}
-
-/**
- * loading stuff
- * @param root xml element
- */
-void SoundEntity::loadParams(const TiXmlElement* root)
-{
-  LoadParam(root, "soundfile", this, SoundEntity, setSoundFile)
-      .describe("Sets the file of the sound source");
-
-  LoadParam(root, "frequency", this, SoundEntity, setSoundFile)
-      .describe("Sets the file of the sound source");
-}
-
-
-/**
- * sets the sound file
- * @param fileName name of the sound source
- */
-void SoundEntity::setSoundFile(const std::string& fileName)
-{
-  this->soundBuffer = OrxSound::ResourceSoundBuffer(fileName);
-  this->bInit = true;
-}
-
-
-void SoundEntity::activate()
-{
-  this->soundSource.play();
-}
-
-
-void SoundEntity::deactivate()
-{
-
-}
-
-
-/**
- *  signal tick, time dependent things will be handled here
- * @param time since last tick
-*/
-void SoundEntity::tick (float dt)
-{
-
-}
-
-
-
Index: anches/cleanup/src/world_entities/sound_entity.h
===================================================================
--- /branches/cleanup/src/world_entities/sound_entity.h	(revision 10590)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*!
- * @file lightning_bolt.h
- * @brief a SoundEntity Projectile
- *  Der Effekt soll folgenderma�n funktionieren:
- * -> Ein Partikel mit einer Blitz-Textur soll sehr schnell erscheinen,
- * -> w�rend er an Intensit� zunimmt soll die Beleuchtung der gerenderten Szene entsprechend zunehmen.
- * -> Je mehr Blitze zum gleichen Zeitpunkt sichtbar sind, desto heller soll die Beleuchtung werden, das hei� die Helligkeitszunahme pro Blitz soll Additiv sein.
- * -> Ein Partikel soll ebenfalls sehr schnell wieder verblassen, dabei soll die Beleuchtung entsprechend der vorhergehenden Zunahme wieder abnehmen (Additiv)
- */
-
-#ifndef _SOUND_ENTITY_H
-#define _SOUND_ENTITY_H
-
-#include "world_entity.h"
-
-#include "sound_buffer.h"
-#include "sound_source.h"
-
-class Material;
-
-class SoundEntity : public WorldEntity
-{
-  ObjectListDeclaration(SoundEntity);
-  public:
-    SoundEntity(const TiXmlElement* root = NULL);
-    virtual ~SoundEntity ();
-
-    virtual void loadParams(const TiXmlElement* root);
-
-    void setSoundFile(const std::string& fileName);
-
-    virtual void activate();
-    virtual void deactivate();
-
-    virtual void tick(float time);
-
-  private:
-
-    bool                     bInit;
-    OrxSound::SoundSource    soundSource;
-    OrxSound::SoundBuffer    soundBuffer;
-};
-
-#endif /* _SOUND_ENTITY_H */
Index: /branches/cleanup/src/world_entities/space_ships/space_ship.cc
===================================================================
--- /branches/cleanup/src/world_entities/space_ships/space_ship.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/space_ships/space_ship.cc	(revision 10591)
@@ -49,6 +49,6 @@
 #include "shared_network_data.h"
 
-#include "power_ups/weapon_power_up.h"
-#include "power_ups/param_power_up.h"
+#include "items/power_ups/weapon_power_up.h"
+#include "items/power_ups/param_power_up.h"
 
 #include "graphics_engine.h"
@@ -58,6 +58,6 @@
 #include "state.h"
 #include "player.h"
-#include "camera.h"
-#include "cameraman.h"
+#include "tools/camera.h"
+#include "tools/cameraman.h"
 
 
@@ -66,5 +66,4 @@
 
 #include "track/track.h"
-#include "math.h"
 
 
Index: anches/cleanup/src/world_entities/spawning_point.cc
===================================================================
--- /branches/cleanup/src/world_entities/spawning_point.cc	(revision 10590)
+++ 	(revision )
@@ -1,276 +1,0 @@
-
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer:
-*/
-
-#include "spawning_point.h"
-
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-
-#include "world_entity.h"
-
-#include "compiler.h"
-
-#include "state.h"
-#include "game_rules.h"
-
-#include "shared_network_data.h"
-
-
-/// TODO REMOVE converter.h
-#include "converter.h"
-
-
-ObjectListDefinition(SpawningPoint);
-CREATE_FACTORY( SpawningPoint);
-/**
- *  constructor
- */
-SpawningPoint::SpawningPoint( const TiXmlElement * root )
-{
-  this->setAbsCoor( 0, 0, 0 );
-
-  this->init();
-
-  if (root != NULL)
-    this->loadParams(root);
-}
-
-void SpawningPoint::init()
-{
-  this->registerObject(this, SpawningPoint::_objectList);
-  PRINTF(0)("Created SpawningPoint\n");
-
-  this->teamId = -1;
-  this->localTimer = 0.0f;
-
-  this->toList( OM_DEAD_TICK );
-
-  MessageManager::getInstance()->registerMessageHandler( MSGID_RESPAWN, respawnMessageHandler, NULL );
-
-  this->setSynchronized( true );
-}
-
-
-/**
- *  deconstructor
- */
-SpawningPoint::~SpawningPoint ()
-{}
-
-
-/**
- * loads the WorldEntity Specific Parameters.
- * @param root: the XML-Element to load the Data From
- */
-void SpawningPoint::loadParams(const TiXmlElement* root)
-{
-  /* let the world entity its stuff first */
-  WorldEntity::loadParams(root);
-
-  /* load teamId */
-  LoadParam(root, "teamId", this, SpawningPoint, setTeamId)
-  .describe("sets teamId");
-}
-
-
-
-/**
- * pushes a world entity to the spawning queue
- *  @param entity WorldEntity to be added
- */
-void SpawningPoint::pushEntity(Playable* entity, float delay)
-{
-  QueueEntry qe;
-  qe.entity = entity;
-  qe.respawnTime = this->localTimer + delay;
-
-  queue.push_back( qe );
-}
-
-
-/**
- *  spawn the entity
- */
-void SpawningPoint::spawn(Playable* entity)
-{
-  bool found = false;
-
-  for (ObjectList<Playable>::const_iterator it = Playable::objectList().begin();
-       it != Playable::objectList().end();
-       ++it)
-  {
-    if ( *it == entity )
-    {
-      found = true;
-      break;
-    }
-  }
-
-  if ( !found )
-    return;
-
-  PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClassCName());
-
-
-  entity->setAbsCoor( this->getAbsCoor() );
-  entity->setAbsDir( this->getAbsDir() );
-
-  //TODO set camera (not smooth)
-
-  if ( State::getGameRules() )
-  {
-    (State::getGameRules())->registerSpawn( entity );
-  }
-
-  entity->respawn();
-}
-
-
-/**
- *  this method is called every frame
- * @param time: the time in seconds that has passed since the last tick
- *
- * Handle all stuff that should update with time inside this method (movement, animation, etc.)
- */
-void SpawningPoint::tick(float dt)
-{
-  this->localTimer += dt;
-  std::list<QueueEntry>::iterator it = this->queue.begin();
-  for( ; it != this->queue.end(); )
-  {
-    //PRINTF(0)("%f <= %f\n", it->respawnTime, this->localTimer);
-    if( it->respawnTime <= this->localTimer)
-    {
-      //spawn the player
-      this->spawn(it->entity);
-
-      bool found = false;
-
-      for (ObjectList<Playable>::const_iterator it2 = Playable::objectList().begin();
-           it2 != Playable::objectList().end();
-           ++it2)
-      {
-        if ( *it2 == it->entity )
-        {
-          found = true;
-          break;
-        }
-      }
-
-      if ( found && SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)
-        this->sendRespawnMessage( it->entity->getUniqueID() );
-
-      std::list<QueueEntry>::iterator delit = it;
-      it++;
-
-      queue.erase( delit );
-
-      continue;
-    }
-
-    it++;
-  }
-
-}
-
-
-/**
- *  the entity is drawn onto the screen with this function
- *
- * This is a central function of an entity: call it to let the entity painted to the screen.
- * Just override this function with whatever you want to be drawn.
- */
-void SpawningPoint::draw() const
-{}
-
-void SpawningPoint::sendRespawnMessage( int uniqueId )
-{
-  byte buf[2*INTSIZE];
-
-  assert( Converter::intToByteArray( this->getUniqueID(), buf, INTSIZE ) == INTSIZE );
-  assert( Converter::intToByteArray( uniqueId, buf + INTSIZE, INTSIZE ) == INTSIZE );
-
-  MessageManager::getInstance()->sendMessage( MSGID_RESPAWN, buf, 2*INTSIZE, RT_ALL_BUT_ME, NET_UNASSIGNED, MP_HIGHBANDWIDTH );
-}
-
-/**
- * message handler for respawn message
- */
-bool SpawningPoint::respawnMessageHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  )
-{
-  if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)
-  {
-    PRINTF(2)("server received spawn message!\n");
-    return true;
-  }
-
-  int spUniqueId;
-  int uniqueId;
-
-  if ( dataLength != 2*INTSIZE )
-  {
-    PRINTF(2)("spawn message has wrong size: %d\n", dataLength );
-    return true;
-  }
-
-  assert( Converter::byteArrayToInt( data, &spUniqueId ) == INTSIZE );
-  assert( Converter::byteArrayToInt( data+INTSIZE, &uniqueId ) == INTSIZE );
-
-  PRINTF(0)("SPAWNMESSAGE %d\n", uniqueId);
-
-  SpawningPoint * sp = NULL;
-  Playable      * playable = NULL;
-
-  for (ObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin();
-       it != SpawningPoint::objectList().end();
-       ++it)
-  {
-    PRINTF(0)("%d:%d\n", (*it)->getUniqueID(), spUniqueId);
-    if ( (*it)->getUniqueID() == spUniqueId )
-    {
-      sp = (*it);
-      break;
-    }
-  }
-
-  if ( !sp )
-  {
-    PRINTF(0)("could not find spawning point\n");
-    return false;
-  }
-
-  for (ObjectList<Playable>::const_iterator it = Playable::objectList().begin();
-       it != Playable::objectList().end();
-       ++it)
-  {
-    if ( (*it)->getUniqueID() == uniqueId )
-    {
-      playable = (*it);
-      break;
-    }
-  }
-
-  if ( !playable )
-  {
-    PRINTF(0)("could not find playable\n");
-    return false;
-  }
-
-  sp->spawn( playable );
-
-  return true;
-}
-
Index: anches/cleanup/src/world_entities/spawning_point.h
===================================================================
--- /branches/cleanup/src/world_entities/spawning_point.h	(revision 10590)
+++ 	(revision )
@@ -1,82 +1,0 @@
-/*!
- * @file spawning_point.h
- *  Definition of a spawning point within the game, used for network game
- */
-
-
-#ifndef _SPAWNING_POINT
-#define _SPAWNING_POINT
-
-#include "playable.h"
-
-#include "message_manager.h"
-
-#include <list>
-
-class World;
-class TiXmlElement;
-
-struct QueueEntry
-{
-  float respawnTime;
-  Playable * entity;
-};
-
-//!< used to indicate what type of objects are spawned by this spawning point
-typedef enum SpawningPointMode
-{
-  SPT_ALL_AT_ONCE = 0,                               //!< at this spawning points there will be players spawned (typicaly in MP games)
-  SPT_ONE_AFTER_OTHER,                               //!< at this spawning points there will be NPS spawnded
-
-  SPT_NUMBER
-};
-
-
-/**
- * The spawning point for WorldEntities (and only WorldEntities)
- *
- * There are commonly two different spawning modes:
- *
- *  1) Just spawn whatever is in the queue with a given frequency (if delay = 0 => immediate spawn)
- *  2) Spawn everything in the queue together with the given frequency
- */
-class SpawningPoint : public WorldEntity {
-  ObjectListDeclaration(SpawningPoint);
-  public:
-    SpawningPoint(const TiXmlElement* root = NULL);
-    virtual ~SpawningPoint ();
-    void init();
-
-    virtual void loadParams(const TiXmlElement* root);
-
-    inline int getTeamId() const { return this->teamId; }
-    inline void setTeamId( int teamId ) { this->teamId = teamId; }
-
-    void pushEntity(Playable* entity, float delay = 0);
-
-    /** activates the spawning point */
-    inline void activate() { this->bSpawning = true; }
-    /** deactivates the spawning point */
-    inline void deactivate() { this->bSpawning = false; }
-    inline bool isActive() const { return this->bSpawning; }
-
-
-    virtual void tick(float dt);
-    virtual void draw() const;
-
-
-  private:
-    void spawn(Playable* entity);
-
-    void sendRespawnMessage( int uniqueId );
-    static bool respawnMessageHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
-
-
-  private:
-    float                           localTimer;                     //!< the local timer
-    int                             teamId;                         //!< only spawn players of this team
-    std::list<QueueEntry>           queue;                          //!< queue of waiting WorldEntities to be spawned
-    bool                            bSpawning;                      //!< flag to indicate if this spawning point is active or not
-};
-
-#endif /* _SPAWNING_POINT */
Index: anches/cleanup/src/world_entities/terrain.cc
===================================================================
--- /branches/cleanup/src/world_entities/terrain.cc	(revision 10590)
+++ 	(revision )
@@ -1,429 +1,0 @@
-/*
-   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: Benjamin Grauer
-   co-programmer: ...
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "terrain.h"
-
-#include "util/loading/resource_manager.h"
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-#include "spatial_separation.h"
-
-#include "model.h"
-#include "network_game_manager.h"
-
-#include "height_map.h"
-#include "material.h"
-
-#include "glincl.h"
-
-#include "state.h"
-#include "debug.h"
-
-
-ObjectListDefinition(Terrain);
-CREATE_FACTORY(Terrain);
-
-/**
- *  standard constructor
- */
-Terrain::Terrain (const TiXmlElement* root)
-{
-  this->init();
-
-
-  if( root != NULL)
-    this->loadParams(root);
-
-  //  if (this->model != NULL)
-  //this->ssp = new SpatialSeparation((Model*)this->model, 10.0f);
-}
-
-
-/**
- *  Constructor for loading a Terrain out of a file
- * @param fileName The file to load data from.
-
-   this either loads out of an OBJ-file, or loads a heightmap if no .obj-extension is found.
-*/
-Terrain::Terrain(const std::string& fileName)
-{
-  this->init();
-
-  if (fileName.rfind(".obj" ) != std::string::npos || fileName.rfind(".OBJ") != std::string::npos )
-  {
-    this->loadModel(fileName);
-  }
-  else
-  {
-    // load the hightMap here.
-  }
-}
-
-/**
- *  a Constructor for the Debug-Worlds
- */
-Terrain::Terrain(DebugTerrain debugTerrain)
-{
-  this->init();
-  this->buildDebugTerrain(debugTerrain);
-}
-
-/**
- *  standard deconstructor
-
-*/
-Terrain::~Terrain ()
-{
-  if (modelList)
-    glDeleteLists(this->modelList, 1);
-  if( this->ssp)
-    delete ssp;
-
-  if(this->heightMap)
-    delete heightMap;
-}
-
-
-void Terrain::init()
-{
-  this->registerObject(this, Terrain::_objectList);
-  this->toList(OM_ENVIRON_NOTICK);
-  this->toReflectionList();
-
-  this->modelList = 0;
-  this->ssp = NULL;
-  this->vegetation = NULL;
-
-  this->heightMap = NULL;
-
-  this->heightMapMaterial = new Material();
-}
-
-
-void Terrain::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-
-  LoadParam(root, "scale", this, Terrain, setScale)
-  .describe("The scale in x,y,z direction");
-
-  LoadParam(root, "texture", this, Terrain, loadTexture)
-  .describe("The name of the Texture for this heightMap");
-
-  LoadParam(root, "vegetation", this, Terrain, loadVegetation)
-  .describe("the fileName of the vegetation, that should be loaded onto this terrain. (must be relative to the data-dir)") ;
-
-  LoadParam(root, "height-map", this, Terrain, loadHeightMap)
-  .describe("The HeightMap, splitted into two strings seperated by ','. 1: HeighMap, 2: ColorMap");
-
-}
-
-void Terrain::setScale(float x, float y, float z)
-{
-  this->terrainScale = Vector(x, y, z);
-}
-
-void Terrain::loadHeightMap(const std::string& heightMapFile, const std::string& colorMap)
-{
-  if (this->heightMap != NULL)
-    delete this->heightMap;
-  this->heightMap = NULL;
-
-  std::string hmName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(heightMapFile);
-  std::string hmColorName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(colorMap);
-
-
-  this->heightMap = new HeightMap(hmName, hmColorName);
-  //   heightMap->scale(Vector(43.0f,4.7f,43.0f));
-  heightMap->scale(this->terrainScale);
-  heightMap->setAbsCoor(this->getAbsCoor());
-  heightMap->load();
-}
-
-
-void Terrain::loadTexture(const std::string& textureName)
-{
-  PRINTF(4)("Load texture: %s\n", textureName.c_str());
-
-  heightMapMaterial->setDiffuse(1.0,1.0,1.0);
-  heightMapMaterial->setAmbient(1.0,1.0,1.0 );
-  heightMapMaterial->setSpecular(1.0,1.0,1.0);
-  heightMapMaterial->setShininess(.5);
-  heightMapMaterial->setTransparency(1.0);
-
-  heightMapMaterial->setDiffuseMap(textureName);
-  //   heightMapMaterial->setAmbientMap(textureName);
-  //   heightMapMaterial->setSpecularMap(textureName);
-}
-
-
-
-void Terrain::loadVegetation(const std::string& vegetationFile)
-{
-  PRINTF(4)("loadVegetation: %s\n", vegetationFile.c_str());
-  if (this->vegetation)
-    this->vegetation = 0;
-  if (!vegetationFile.empty())
-  {
-    PRINTF(4)("fetching %s\n", vegetationFile.c_str());
-    this->loadModel(vegetationFile, 1.0, 2);
-    this->vegetation = this->getModel(2);
-  }
-  else
-    this->vegetation = NULL;
-}
-
-
-
-
-
-void Terrain::draw () const
-{
-  glPushMatrix();
-
-  /* translate */
-  glTranslatef (this->getAbsCoor ().x,
-                this->getAbsCoor ().y,
-                this->getAbsCoor ().z);
-  /* rotate */
-  // Vector tmpRot = this->getAbsDir().getSpacialAxis();
-  //glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
-
-  if (this->modelList)
-    glCallList(this->modelList);
-  else if (this->getModel())
-    this->getModel()->draw();
-
-  if (this->vegetation)
-    this->vegetation->draw();
-
-  if( this->heightMap)
-  {
-    this->heightMapMaterial->select();
-
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
-    this->heightMap->draw();
-  }
-  glPopMatrix();
-
-
-  /*
-    glMatrixMode(GL_MODELVIEW);
-    glPushMatrix();
-    glLoadIdentity();
-    Vector camera =   State::getCameraNode()->getAbsCoor(); // Go on here ..........!!!
-
-    float height =    heightMap->getHeight(camera.x, camera.z);
-
-    glEnable (GL_COLOR_MATERIAL) ;
-    glBegin(GL_QUADS);            // Draw The Cube Using quads
-    glColor3f(0.0f,1.0f,0.0f);  // Color Blue
-    glVertex3f(camera.x + 63.0f,Terrain->getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Right Of The Quad (Top)
-    glVertex3f(camera.x-63.0f, getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Left Of The Quad (Top)
-    glVertex3f(camera.x-63.0f, getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Left Of The Quad (Top)
-    glVertex3f(camera.x+ 63.0f, getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Right Of The Quad (Top)
-    glEnd();                      // End Drawing The Plan
-
-    glPopMatrix();*/
-
-
-  /* THIS IS ONLY FOR DEBUGGING INFORMATION */
-  //  if (this->ssp != NULL)
-  //    this->ssp->drawQuadtree();
-}
-
-
-void Terrain::buildDebugTerrain(DebugTerrain debugTerrain)
-{
-  // if the terrain is the Terrain of Dave
-  if (debugTerrain == TERRAIN_DAVE)
-  {
-    modelList = glGenLists(1);
-    glNewList (modelList, GL_COMPILE);
-
-    glColor3f(1.0,0,0);
-
-    int sizeX = 100;
-    int sizeZ = 80;
-    float length = 1000;
-    float width = 200;
-    float widthX = float (length /sizeX);
-    float widthZ = float (width /sizeZ);
-
-    float height [sizeX][sizeZ];
-    Vector normal_vectors[sizeX][sizeZ];
-
-
-    for ( int i = 0; i<sizeX-1; i+=1)
-      for (int j = 0; j<sizeZ-1;j+=1)
-        //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
-#ifdef __WIN32__
-        height[i][j]=(sin((float)j/3)*rand()*i/182400)*.5;
-#else
-        height[i][j]=(sin((float)j/3)*rand()*(long)i/6282450500.0)*.5;
-#endif
-
-    //Die Huegel ein wenig glaetten
-    for (int h=1; h<2;h++)
-      for (int i=1;i<sizeX-2 ;i+=1 )
-        for(int j=1;j<sizeZ-2;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<sizeX-2;i+=1)
-      for(int j=1;j<sizeZ-2 ;j+=1)
-      {
-        Vector v1 = Vector (widthX*(1),      height[i][j],      widthZ*(j) );
-        Vector v2 = Vector (widthX*(i-1),    height[i-1][j],    widthZ*(j));
-        Vector v3 = Vector (widthX*(i),      height[i][j+1],    widthZ*(j+1));
-        Vector v4 = Vector (widthX*(i+1),    height[i+1][j],    widthZ*(j));
-        Vector v5 = Vector (widthX*(i),      height[i][j-1],    widthZ*(j-1));
-
-        Vector c1 = v2 - v1;
-        Vector c2 = v3 - v1;
-        Vector c3=  v4 - v1;
-        Vector c4 = v5 - v1;
-        Vector zero = Vector (0,0,0);
-        normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4);
-        normal_vectors[i][j].normalize();
-      }
-
-    glBegin(GL_QUADS);
-    int snowheight=3;
-    for ( int i = 0; i<sizeX; i+=1)
-      for (int j = 0; j<sizeZ;j+=1)
-      {
-        Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
-        Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
-        Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
-        Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
-        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();
-    glEndList();
-  }
-
-  if (debugTerrain == TERRAIN_BENSCH)
-  {
-    /*
-      this->model = (OBJModel*) new Model();
-    this->model->setName("CUBE");
-    this->model->addVertex (-0.5, -0.5, 0.5);
-    this->model->addVertex (0.5, -0.5, 0.5);
-    this->model->addVertex (-0.5, 0.5, 0.5);
-    this->model->addVertex (0.5, 0.5, 0.5);
-    this->model->addVertex (-0.5, 0.5, -0.5);
-    this->model->addVertex (0.5, 0.5, -0.5);
-    this->model->addVertex (-0.5, -0.5, -0.5);
-    this->model->addVertex (0.5, -0.5, -0.5);
-
-    this->model->addVertexTexture (0.0, 0.0);
-    this->model->addVertexTexture (1.0, 0.0);
-    this->model->addVertexTexture (0.0, 1.0);
-    this->model->addVertexTexture (1.0, 1.0);
-    this->model->addVertexTexture (0.0, 2.0);
-    this->model->addVertexTexture (1.0, 2.0);
-    this->model->addVertexTexture (0.0, 3.0);
-    this->model->addVertexTexture (1.0, 3.0);
-    this->model->addVertexTexture (0.0, 4.0);
-    this->model->addVertexTexture (1.0, 4.0);
-    this->model->addVertexTexture (2.0, 0.0);
-    this->model->addVertexTexture (2.0, 1.0);
-    this->model->addVertexTexture (-1.0, 0.0);
-    this->model->addVertexTexture (-1.0, 1.0);
-
-    this->model->finalize();
-    */
-  }
-}
-
-float Terrain::getHeight(float x, float y)
-{
-  if(this->heightMap != NULL)
-    return (this->heightMap->getHeight(x, y));
-  return 0;
-}
Index: anches/cleanup/src/world_entities/terrain.h
===================================================================
--- /branches/cleanup/src/world_entities/terrain.h	(revision 10590)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*!
- * @file terrain.h
-  *  Defines and handles the terrain of the World
-
-    @todo implement it
-
-    The terrain should either be build from a Model a OBJModel or from a HeightMap.
-*/
-
-#ifndef _TERRAIN_H
-#define _TERRAIN_H
-
-#include "world_entity.h"
-
-// FORWARD DECLARATION
-class SpatialSeparation;
-class HeightMap;
-class Material;
-
-//! A simple method to call a desired debug world.
-enum DebugTerrain {TERRAIN_DAVE, TERRAIN_BENSCH};
-
-
-//! A Class to handle Terrain of orxonox
-class Terrain : public WorldEntity
-{
-  ObjectListDeclaration(Terrain);
-
- public:
-  Terrain(const TiXmlElement* root = NULL);
-  Terrain(const std::string& fileName);
-  Terrain(DebugTerrain debugTerrain);
-  virtual ~Terrain();
-
-  void init();
-  virtual void loadParams(const TiXmlElement* root);
-
-  void loadVegetation(const std::string& vegetationFile);
-
-  void loadHeightMap(const std::string& heightMapFile, const std::string& colorMap);
-  void loadTexture(const std::string& textureName);
-  void setScale(float x, float y, float z);
-
-  void buildDebugTerrain(DebugTerrain debugTerrain);
-
-  float getHeight(float x, float y);
-  virtual void draw() const;
-
-  public:
-    SpatialSeparation* ssp;
-
- private:
-   Model*              vegetation;
-   int                 modelList;
-
-   HeightMap*          heightMap;
-   Material*           heightMapMaterial;
-   Vector              terrainScale;
-};
-
-#endif /* _TERRAIN_H */
Index: anches/cleanup/src/world_entities/test_entity.cc
===================================================================
--- /branches/cleanup/src/world_entities/test_entity.cc	(revision 10590)
+++ 	(revision )
@@ -1,160 +1,0 @@
-
-
-/*
-   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:
-   co-programmer:
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "executor/executor.h"
-#include "util/loading/factory.h"
-#include "util/loading/load_param.h"
-
-
-#include "test_entity.h"
-#include "debug.h"
-
-#include "track/track.h"
-
-
-
-
-#include "state.h"
-
-
-
-
-ObjectListDefinition(TestEntity);
-CREATE_FACTORY(TestEntity);
-
-#include "script_class.h"
-CREATE_SCRIPTABLE_CLASS(TestEntity,
-                        addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
-                        ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
-                        ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
-                        ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
-                        ->addMethod("setAbsDir", Executor4<PNode, lua_State*,float,float,float,float>(&PNode::setAbsDir))
-                       );
-
-
-/**
- *
- */
-TestEntity::TestEntity ()
-{
-  this->init();
-}
-
-
-/**
- *
- */
-TestEntity::TestEntity(const TiXmlElement* root)
-{
-  if( root != NULL)
-    this->loadParams(root);
-
-  this->init();
-}
-
-
-/**
- *
- */
-TestEntity::~TestEntity ()
-{}
-
-
-/**
- *
- */
-void TestEntity::init()
-{
-  this->registerObject(this, TestEntity::_objectList);
-  this->toList(OM_GROUP_00);
-
- //add to track
-  if(this->entityTrack)
-    this->setParent(this->entityTrack->getTrackNode());
-
-}
-
-
-/**
- * loads the Settings of a MD2Creature from an XML-element.
- * @param root the XML-element to load the MD2Creature's properties from
- */
-void TestEntity::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-}
-
-void TestEntity::draw() const
-{
-//   if(!mediaLoaded)
-//     false;
-
-  glPushAttrib(GL_ENABLE_BIT);
-  glDisable(GL_LIGHTING);
-//   glDisable(GL_BLEND);
-// 
-//   glEnable(GL_TEXTURE_2D);
-//   glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
-
-  glPushMatrix();
- /* glTranslatef (this->getAbsCoor ().x,
-                this->getAbsCoor ().y,
-                this->getAbsCoor ().z);
-  glRotatef(axis, 0.0f, 1.0f, 0.0f);*/
-//PRINTF(0)("axis: %f\n", axis);
-
-  glColor3f(1.0, 0, 0);
-
-  glBegin(GL_QUADS);
-    glVertex3f( 0.0f, -100.0f, 0.0f);
-//     glTexCoord2f(1.0f, 1.0f);
-    glVertex3f( 0.0f,  -100.0f , 2000.0f);
-//     glTexCoord2f(0.0f, 1.0f);
-    glVertex3f( 10000.0f,  -100.0f , 2000.0f );
-//     glTexCoord2f(0.0f, 0.0f);
-    glVertex3f( 10000.0f, -100.0f, 0.0f );
-//     glTexCoord2f(1.0f, 0.0f);
-    
-  glEnd();
-
-  glPopMatrix();
-  glPopAttrib();
-
-
-if( this->entityTrack != NULL)
-    this->entityTrack->drawGraph();
-
-}
-
-/**
- *
- */
-void TestEntity::tick (float time)
-{
- if(this->entityTrack)
-    this->entityTrack->tick(time);
-
-
-}
-
-
-
-
-
-
Index: anches/cleanup/src/world_entities/test_entity2.cc
===================================================================
--- /branches/cleanup/src/world_entities/test_entity2.cc	(revision 10590)
+++ 	(revision )
@@ -1,270 +1,0 @@
-
-
-/*
-   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:
-   co-programmer:
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "executor/executor.h"
-#include "util/loading/factory.h"
-#include "util/loading/load_param.h"
-
-
-#include "test_entity2.h"
-#include "debug.h"
-
-#include "state.h"
-#include "player.h"
-#include "playable.h"
-#include "material.h"
-
-
-#include "state.h"
-
-
-
-
-ObjectListDefinition(TestEntity2);
-CREATE_FACTORY(TestEntity2);
-
-
-
-/**
- *
- */
-TestEntity2::TestEntity2()
-{
-  this->init();
-}
-
-
-/**
- *
- */
-TestEntity2::TestEntity2(const TiXmlElement* root)
-{
-  this->init();
-
-  if( root != NULL)
-    this->loadParams(root);
-}
-
-
-/**
- *
- */
-TestEntity2::~TestEntity2 ()
-{}
-
-
-/**
- *
- */
-void TestEntity2::init()
-{
-  this->registerObject(this, TestEntity2::_objectList);
-  this->toList(OM_GROUP_00);
-
-  this->material = new Material();
-  this->material->setIllum(3);
-  this->material->setDiffuse(1.0,1.0,1.0);
-  this->material->setSpecular(0.0,0.0,0.0);
-  this->material->setAmbient(1.0, 1.0, 1.0);
-
-  this->angle = 0;
-  this->rotationSpeed = 3;
-
-  this->material->setDiffuseMap("textures/TE2.tga");
-
-}
-
-
-/**
- * loads the Settings of a MD2Creature from an XML-element.
- * @param root the XML-element to load the MD2Creature's properties from
- */
-void TestEntity2::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-}
-
-
-void TestEntity2::updateAngle()
-{
-  this->angle = this->angle + this->rotationSpeed;
-}
-
-void TestEntity2::draw() const
-{
-
-  glPushAttrib(GL_ENABLE_BIT);
-  glDisable(GL_LIGHTING);
-
-  glPushMatrix();
-  glMatrixMode(GL_MODELVIEW);
-
-
-    /* translate */
-  glTranslatef (this->getAbsCoor ().x,
-                  this->getAbsCoor ().y,
-                  this->getAbsCoor ().z);
-  Vector tmpRot = this->getAbsDir().getSpacialAxis();
-  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
-  glRotatef(this->angle, 1.0, 1.0, 1.0);
-//PRINTF(0)("axis: %f\n", axis);
-
-
-  glEnable(GL_BLEND);
-  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-  glShadeModel(GL_FLAT);
-  glClearColor(0.0, 0.0, 0.0, 0.0);
-
-  glEnable(GL_TEXTURE_2D);
-  this->material->select();
-
-  glColor3f(1.0, 1.0, 1.0);
-
-  glBegin(GL_QUADS); // +X
-    glTexCoord2f (0.0, 0.0);
-    glVertex3f( 0.0f, -0.5f, -0.5f);
-//     glNormal3f(1.0, 0.0, 0.0);
-
-    glTexCoord2f (1.0, 0.0);
-    glVertex3f( 0.0f, -0.5f , 0.5f);
-//     glNormal3f(1.0, 0.0, 0.0);
-
-    glTexCoord2f (1.0, 1.0);
-    glVertex3f( 0.0, 0.5f , 0.5f );
-//     glNormal3f(1.0, 0.0, 0.0);
-
-
-    glTexCoord2f (0.0, 1.0);
-    glVertex3f( 0.0, 0.5f, -0.5f );
-//     glNormal3f(1.0, 0.0, 0.0);
-  glEnd();
-
-  glBegin(GL_QUADS); // +Y
-    glTexCoord2f (0.0, 0.0);
-    glVertex3f(-0.5f, 0.0f, -0.5f);
-//     glNormal3f(0.0, 1.0, 0.0);
-
-    glTexCoord2f (1.0, 0.0);
-    glVertex3f(-0.5f, 0.0f , 0.5f);
-//     glNormal3f(0.0, 1.0, 0.0);
-
-    glTexCoord2f (1.0, 1.0);
-    glVertex3f( 0.5f, 0.0f , 0.5f );
-//     glNormal3f(0.0, 1.0, 0.0);
-
-    glTexCoord2f (0.0, 1.0);
-    glVertex3f( 0.5f, 0.0f, -0.5f );
-//     glNormal3f(0.0, 1.0, 0.0);
-  glEnd();
-
-  glBegin(GL_QUADS);// +Z
-    glTexCoord2f (0.0, 0.0);
-    glVertex3f(-0.5f, -0.5f, 0.0f);
-//     glNormal3f(0.0, 0.0, 1.0);
-
-    glTexCoord2f (1.0, 0.0);
-    glVertex3f(-0.5f, 0.5f , 0.0f);
-//     glNormal3f(0.0, 0.0, 1.0);
-
-    glTexCoord2f (1.0, 1.0);
-    glVertex3f( 0.5f, 0.5f , 0.0f );
-//     glNormal3f(0.0, 0.0, 1.0);
-
-    glTexCoord2f (0.0, 1.0);
-    glVertex3f( 0.5f, -0.5f, 0.0f );
-//     glNormal3f(0.0, 0.0, 1.0);
-  glEnd();
-
-/*
-  glBegin(GL_QUADS);// -X
-    glTexCoord2f (0.0, 0.0);
-    glVertex3f( 0.0f, -0.5f, -0.5f);
-//     glNormal3f(-1.0, 0.0, 0.0);
-
-    glTexCoord2f (1.0, 0.0);
-    glVertex3f( 0.0f, 0.5f , -0.5f);
-//     glNormal3f(-1.0, 0.0, 0.0);
-
-    glTexCoord2f (1.0, 1.0);
-    glVertex3f( 0.0, 0.5f , 0.5f );
-//     glNormal3f(-1.0, 0.0, 0.0);
-
-    glTexCoord2f (0.0, 1.0);
-    glVertex3f( 0.0, -0.5f, 0.5f );
-//     glNormal3f(-1.0, 0.0, 0.0);
-  glEnd();
-
-  glBegin(GL_QUADS);// -Y
-    glTexCoord2f (0.0, 0.0);
-    glVertex3f(-0.5f, 0.0f, -0.5f);
-//     glNormal3f(0.0, -1.0, 0.0);
-
-    glTexCoord2f (1.0, 0.0);
-    glVertex3f(0.5f, 0.0f , -0.5f);
-//     glNormal3f(0.0, -1.0, 0.0);
-
-    glTexCoord2f (1.0, 1.0);
-    glVertex3f( 0.5f, 0.0f , 0.5f );
-//     glNormal3f(0.0, -1.0, 0.0);
-
-    glTexCoord2f (0.0, 1.0);
-    glVertex3f( -0.5f, 0.0f, 0.5f );
-//     glNormal3f(0.0, -1.0, 0.0);
-  glEnd();
-
-  glBegin(GL_QUADS);// -Z
-    glTexCoord2f (0.0, 0.0);
-    glVertex3f(-0.5f, -0.5f, 0.0f);
-//     glNormal3f(0.0, 0.0, -1.0);
-
-    glTexCoord2f (1.0, 0.0);
-    glVertex3f(0.5f, -0.5f , 0.0f);
-//     glNormal3f(0.0, 0.0, -1.0);
-
-    glTexCoord2f (1.0, 1.0);
-    glVertex3f( 0.5f, 0.5f , 0.0f );
-//     glNormal3f(0.0, 0.0, -1.0);
-
-    glTexCoord2f (0.0, 1.0);
-    glVertex3f( -0.5f, 0.5f, 0.0f );
-//     glNormal3f(0.0, 0.0, -1.0);
-  glEnd();*/
-
-  glPopMatrix();
-  glPopAttrib();
-}
-
-/**
- *
- */
-void TestEntity2::tick (float time)
-{
-  Player* p = State::getPlayer();
-  Playable* pl = p->getPlayable();
-
-  this->setParent(pl);
-
-  this->updateAngle();
-}
-
-
-
-
-
-
Index: anches/cleanup/src/world_entities/test_entity2.h
===================================================================
--- /branches/cleanup/src/world_entities/test_entity2.h	(revision 10590)
+++ 	(revision )
@@ -1,33 +1,0 @@
-#ifndef _TEST_ENTITY_H
-#define _TEST_ENTITY_H
-
-#include "world_entity.h"
-
-class TiXmlElement;
-class Material;
-
-class TestEntity2 : public WorldEntity
-{
-    ObjectListDeclaration(TestEntity2);
-
-  public:
-    TestEntity2 ();
-    TestEntity2(const TiXmlElement* root);
-    virtual ~TestEntity2 ();
-
-    void init();
-    virtual void loadParams(const TiXmlElement* root);
-
-
-    virtual void tick (float time);
-    virtual void draw() const;
-
-  private:
-    virtual void updateAngle();
-
-    Material*       material;
-    float           angle;
-    float           rotationSpeed;
-};
-
-#endif /* _TEST_ENTITY_H */
Index: /branches/cleanup/src/world_entities/tools/blackscreen.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/blackscreen.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/blackscreen.cc	(revision 10591)
@@ -0,0 +1,199 @@
+/*
+   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: Filip Gospodinov
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "executor/executor.h"
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+#include "blackscreen.h"
+#include "debug.h"
+#include "material.h"
+#include "state.h"
+// #include "camera.h"
+#include "primitive_model.h"
+
+ObjectListDefinition(BlackScreen);
+CREATE_FACTORY(BlackScreen);
+
+
+
+/**
+ *
+ */
+BlackScreen::BlackScreen()
+{
+  this->init();
+
+
+}
+
+
+/**
+ *
+ */
+BlackScreen::BlackScreen(const TiXmlElement* root)
+{
+  this->init();
+
+  if( root != NULL)
+    this->loadParams(root);
+
+}
+
+
+/**
+ *
+ */
+BlackScreen::~BlackScreen()
+{}
+
+
+/**
+ *
+ */
+void BlackScreen::init()
+{
+  this->registerObject(this, BlackScreen::_objectList);
+  this->toList(OM_COMMON);
+
+  this->material = new Material();
+  this->material->setDiffuse(0,0,0);
+  this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+  PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, 6., 10);
+  this->setModel(model);
+
+  i=0;
+  state=0;
+  fadeSpeed=1;
+
+}
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void BlackScreen::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+}
+
+
+
+
+void BlackScreen::draw() const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+  glEnable(GL_BLEND);   // Turn Blending On
+
+//   glMatrixMode(GL_MODELVIEW);
+//   glPushMatrix();
+//   /* translate */
+//   glTranslatef (this->getAbsCoor ().x,
+//                 this->getAbsCoor ().y,
+//                 this->getAbsCoor ().z);
+//   Vector tmpRot = this->getAbsDir().getSpacialAxis();
+//   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+  this->material->select();
+
+
+  WorldEntity::draw(this->getModel( ));
+
+//   glBegin(GL_QUADS);
+
+//   glVertex3f(0.,-100.0f,-100.0f);
+//   glVertex3f(0., -100.0f,100.0f);
+//   glVertex3f(0., 100.0f,100.0f);
+//   glVertex3f(0., 100.0f,-100.0f);
+
+//   glEnd();
+
+  glPopMatrix();
+  glPopAttrib();
+}
+
+/**
+ *
+ */
+void BlackScreen::tick (float time)
+{
+if (state == true)
+  fadeOut();
+else
+  fadeIn();
+
+  this->material->setTransparency(i);
+//   Camera* cam = State::getCamera();
+//   if( cam != NULL)
+//     this->setParent(cam);
+}
+
+void BlackScreen::fadeIn()
+{
+  if (i>0)
+    i=i-0.005*fadeSpeed;
+  else
+    this->toList(OM_DEAD);
+}
+
+void BlackScreen::fadeOut()
+{
+  if (i<=1)
+    i=i+0.005*fadeSpeed;
+}
+
+void  BlackScreen::toggleFade ()
+{
+    this->state= !this->state;
+
+    if(state)
+    {
+      this->toList(OM_COMMON);
+    }
+}
+
+
+void BlackScreen::initFadeBlack()
+{
+  this->i = 1.;
+  this->state = true;
+  this->toList(OM_COMMON);
+}
+
+
+void BlackScreen::changeFadeSpeed(float newSpeed)
+{
+  fadeSpeed=newSpeed;
+}
+
+bool BlackScreen::isBlack()
+{
+if (i==1)
+  return 1;
+else
+  return 0;
+}
+
+bool BlackScreen::isTrans()
+{
+  if (i==0)
+    return 1;
+  else
+    return 0;
+}
Index: /branches/cleanup/src/world_entities/tools/blackscreen.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/blackscreen.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/blackscreen.h	(revision 10591)
@@ -0,0 +1,42 @@
+#ifndef _BLACKSCREEN_H
+#define _BLACKSCREEN_H
+
+#include "world_entity.h"
+
+
+class TiXmlElement;
+class Material;
+
+class BlackScreen : public WorldEntity
+{
+    ObjectListDeclaration(BlackScreen);
+
+  private:
+    float i;
+    bool state;
+    Material*       material;
+    void fadeIn();
+    void fadeOut();
+    float fadeSpeed;
+
+  public:
+    BlackScreen();
+    BlackScreen(const TiXmlElement* root);
+    virtual ~BlackScreen();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    void toggleFade();
+    void initFadeBlack();
+    void changeFadeSpeed(float newSpeed);
+    bool isBlack();
+    bool isTrans();
+    virtual void tick (float time);
+
+    virtual void draw() const;
+
+
+};
+
+#endif /* _BLACKSCREEN_H */
Index: /branches/cleanup/src/world_entities/tools/camera.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/camera.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/camera.cc	(revision 10591)
@@ -0,0 +1,560 @@
+/*
+   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: Benjamin Grauer
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "camera.h"
+#include "key_mapper.h"
+#include "glincl.h"
+#include "util/loading/load_param.h"
+#include "world_entity.h"
+#include "vector.h"
+#include "targets.h"
+#include "track/track.h"
+#include "script_class.h"
+#include "state.h"
+
+#include "debug.h"
+
+
+ObjectListDefinition(Camera);
+
+CREATE_SCRIPTABLE_CLASS(Camera,
+                        addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
+                        ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
+                        ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
+                        ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
+                       );
+
+/**
+ *  creates a Camera
+*/
+Camera::Camera()
+{
+  this->registerObject(this, Camera::_objectList);
+
+  this->init();
+}
+
+
+Camera::Camera(const TiXmlElement* root)
+{
+  this->registerObject(this, Camera::_objectList);
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  this->init();
+
+}
+
+
+/**
+ *  default destructor
+*/
+Camera::~Camera()
+{}
+
+void Camera::init()
+{
+  this->toList( OM_ENVIRON_NOTICK);
+  //this->setName("camera");
+  this->target = new CameraTarget();
+  this->target->masta=this;
+  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW0);
+  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW1);
+  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW2);
+  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW3);
+  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW4);
+  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW5);
+
+  //this->setFovy(90);
+  this->setAspectRatio(1.33f);
+  this->setClipRegion(.1, 10000);
+
+  this->viewTopFovy = 60;
+  this->viewNormalFovy = 90;
+  this->viewFrontFovy = 120;
+  this->viewRightFovy = 90;
+  this->viewLeftFovy = 90;
+
+  this->viewTopDistance = 70;
+  this->viewNormalDistance = 10;
+  this->viewFrontDistance = 4;
+  this->viewRightDistance = 10;
+  this->viewLeftDistance = 10;
+
+  this->setViewMode(Camera::ViewNormal);
+
+  this->setParentMode(PNODE_ALL);
+  this->eventHandling = true;
+
+  //add to track
+  if(this->entityTrack)
+   {
+    this->setParent(this->entityTrack->getTrackNode());
+    //this->setRelCoor(0,0,0);
+   }
+}
+
+/**
+ *  focuses the Camera onto a Target
+ * @param target the new PNode the Camera should look at.
+*/
+void Camera::lookAt(PNode* target)
+{
+  this->target->setParentSoft(target,0.2);
+}
+
+/**
+ * @returns The PNode of the Target (from there you can get position and so on
+*/
+PNode* Camera::getTargetNode() const
+{
+  return (PNode*)this->target;
+}
+
+void Camera::setTargetNode(PNode* target)
+{
+  this->target->setParent(target);
+}
+
+/**
+ *  sets a new AspectRatio
+ * @param aspectRatio the new aspect ratio to set (width / height)
+*/
+void Camera::setAspectRatio(float aspectRatio)
+{
+  this->aspectRatio = aspectRatio;
+}
+
+/**
+ * Sets a new clipping region
+ * @param nearClip The near clip plane
+ * @param farClip The far clip plane
+*/
+void Camera::setClipRegion(float nearClip, float farClip)
+{
+  this->nearClip = nearClip;
+  this->farClip = farClip;
+}
+
+/**
+ *  sets the new VideoMode and initializes iteration to it.
+ * @param mode the mode to change to.
+*/
+void Camera::setViewMode(ViewMode mode)
+{
+  currentMode = mode;
+  switch (mode)
+  {
+    default:
+    case Camera::ViewNormal:
+    {
+      this->fovy = viewNormalFovy;
+      this->toFovy = viewNormalFovy;
+      //this->fovy = 60;
+      //this->toFovy = 60;
+      this->setRelCoorSoft(-2.0/3.0 * this->viewNormalDistance, 1.0/3.0 * this->viewNormalDistance, 0);
+      this->target->setRelCoorSoft(0,0,0);
+      break;
+    }
+    case Camera::ViewBehind:
+      break;
+    case Camera::ViewFront:
+    {
+      this->fovy = viewFrontFovy;
+      this->toFovy = viewFrontFovy;
+      this->setRelCoorSoft(this->viewFrontDistance, 0, 0, 5);
+      this->target->setRelCoorSoft(Vector(10,0,0), 5);
+      break;
+    }
+    case Camera::ViewLeft:
+    {
+      this->fovy = viewLeftFovy;
+      this->toFovy = viewLeftFovy;
+      this->setRelCoorSoft(0, 1, -viewLeftDistance, .5);
+      this->target->setRelCoorSoft(0,0,0);
+      break;
+    }
+    case Camera::ViewRight:
+    {
+      this->fovy = viewRightFovy;
+      this->toFovy = viewRightFovy;
+      this->setRelCoorSoft(Vector(0, 1, viewRightDistance), 0.5);
+      this->target->setRelCoorSoft(0,0,0);
+      break;
+    }
+    case Camera::ViewTop:
+    {
+      this->fovy= viewTopFovy;
+      this->toFovy = viewTopFovy;
+      this->setRelCoor(Vector(-0.05, this->viewTopDistance , 0));
+      this->target->setRelCoor(0,0,0);
+    }
+  }
+}
+
+
+/**
+ *  Updates the position of the camera.
+ * @param dt: The time that elapsed.
+*/
+void Camera::tick(float dt)
+{
+  //update frustum plane
+  this->viewVector = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized();
+  this->frustumPlane = Plane(this->viewVector, this->getAbsCoor() + this->viewVector * 0.1);
+  this->upVector = this->getAbsDirV();
+
+  // iteration for fovy
+  float tmpFovy = (this->toFovy - this->fovy);
+  if (fabsf(tmpFovy) > 0.01)
+    this->fovy += tmpFovy * fabsf(dt);
+
+  if(this->entityTrack)
+  {
+    //PRINTF(0)("tickytackytucky\n");
+    this->entityTrack->tick(dt);
+    //this->setAbsCoor(this->entityTrack->getTrackNode()->getAbsCoor());
+  } 
+
+
+
+  //iterate(float dt, translate, target)
+  target->translate(dt);
+}
+
+
+void Camera::draw() const
+{
+  if( this->entityTrack != NULL && this->isDrawTrack())
+    this->entityTrack->drawGraph();
+}
+
+
+/**
+ *  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 ()
+{
+  // switching to Projection Matrix
+  glMatrixMode (GL_PROJECTION);
+  glLoadIdentity ();
+
+  gluPerspective(this->fovy,
+                 this->aspectRatio,
+                 this->nearClip,
+                 this->farClip);
+
+
+    // setting up the perspective
+  // speed-up feature
+  glMatrixMode (GL_MODELVIEW);
+  glLoadIdentity();
+
+
+}
+
+void Camera::project()
+{
+  Vector cameraPosition = this->getAbsCoor();
+  Vector targetPosition = this->target->getAbsCoor();
+
+
+        //Setting the Camera Eye, lookAt and up Vectors
+  gluLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z,
+            targetPosition.x, targetPosition.y, targetPosition.z,
+            this->upVector.x, this->upVector.y, this->upVector.z);
+}
+
+
+/**
+ *  processes an event
+ * @param event: the event to process
+*/
+void Camera::process(const Event &event)
+{
+  if (eventHandling == true)
+  {
+    if( event.type == KeyMapper::PEV_VIEW0)
+    {
+      this->setViewMode(Camera::ViewNormal);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW1)
+    {
+      this->setViewMode(Camera::ViewBehind);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW2)
+    {
+      this->setViewMode(Camera::ViewFront);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW3)
+    {
+      this->setViewMode(Camera::ViewLeft);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW4)
+    {
+      this->setViewMode(Camera::ViewRight);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW5)
+    {
+      this->setViewMode(Camera::ViewTop);
+    }
+  }
+}
+
+
+void Camera::loadParams(const TiXmlElement* root)
+{
+  // Do the PNode loading stuff
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "viewTopFovy", this, Camera, setViewTopFovy);
+  LoadParam(root, "viewFrontFovy", this, Camera, setViewFrontFovy);
+  LoadParam(root, "viewLeftFovy", this, Camera, setViewLeftFovy);
+  LoadParam(root, "viewRightFovy", this, Camera, setViewRightFovy);
+  LoadParam(root, "viewBehindFovy", this, Camera, setViewBehindFovy);
+  LoadParam(root, "viewNormalFovy", this, Camera, setViewNormalFovy);
+
+  LoadParam(root, "viewTopDistance", this, Camera, setViewTopDistance);
+  LoadParam(root, "viewFrontDistance", this, Camera, setViewFrontDistance);
+  LoadParam(root, "viewLeftDistance", this, Camera, setViewLeftDistance);
+  LoadParam(root, "viewRightDistance", this, Camera, setViewRightDistance);
+  LoadParam(root, "viewBehindDistance", this, Camera, setViewBehindDistance);
+  LoadParam(root, "viewNormalDistance", this, Camera, setViewNormalDistance);
+}
+
+
+void Camera::setViewTopFovy(float fovy)
+{
+  this->viewTopFovy = fovy;
+}
+
+void Camera::setViewFrontFovy(float fovy)
+{
+  this->viewFrontFovy = fovy;
+}
+
+void Camera::setViewLeftFovy(float fovy)
+{
+  this->viewLeftFovy = fovy;
+}
+
+void Camera::setViewRightFovy(float fovy)
+{
+  this->viewRightFovy = fovy;
+}
+
+void Camera::setViewBehindFovy(float fovy)
+{
+  this->viewBehindFovy = fovy;
+}
+
+void Camera::setViewNormalFovy(float fovy)
+{
+  this->viewNormalFovy = fovy;
+}
+
+void Camera::setViewTopDistance(float Distance)
+{
+  this->viewTopDistance = Distance;
+}
+
+void Camera::setViewFrontDistance(float Distance)
+{
+  this->viewFrontDistance = Distance;
+}
+
+void Camera::setViewLeftDistance(float Distance)
+{
+  this->viewLeftDistance = Distance;
+}
+
+void Camera::setViewRightDistance(float Distance)
+{
+  this->viewRightDistance = Distance;
+}
+
+void Camera::setViewBehindDistance(float Distance)
+{
+  this->viewBehindDistance = Distance;
+}
+
+void Camera::setViewNormalDistance(float Distance)
+{
+  this->viewNormalDistance = Distance;
+}
+
+
+
+
+void Camera::glLookAt(float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz)
+{
+  //Vector* eye=new Vector(eyex, eyey, eyez);
+  Vector* center=new Vector (centerx, centery, centerz);
+  Vector* up=new Vector(upx, upy, upz);
+
+  center->x-=eyex;
+  center->y-=eyey;
+  center->z-=eyez;
+
+  center->normalize();
+  up->normalize();
+  Vector* s = VectorProd(center, up);
+  Vector* u = VectorProd(s, center);
+  GLfloat Matrix[]={s->x, s->y, s->z, 0, u->x, u->y, u->z, 0, -center->x, -center->y, -center->z, 0, 0, 0, 0, 1};
+
+  glMultMatrixf(Matrix);
+  glTranslated(-eyex, -eyey, -eyez);
+  delete center;
+  delete up;
+  delete s;
+  delete u;
+
+}
+
+
+
+
+Vector* Camera::VectorProd(Vector* v1, Vector* v2)
+{
+Vector* temp= new Vector();
+temp->x=v1->y * v2->z - v1->z * v2->y;
+temp->y=v1->z * v2->x - v1->x * v2->z;
+temp->z=v1->x * v2->y - v1->y * v2->x;
+return temp;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+///////////////////
+// CAMERA-TARGET //
+///////////////////
+//REATE_FACTORY(CameraTarget);
+
+
+ObjectListDefinition(CameraTarget);
+
+
+CameraTarget::CameraTarget()
+{
+  this->registerObject(this, CameraTarget::_objectList);
+  //  this->setParentMode(PNODE_MOVEMENT);
+  this->speed=1;
+  translateTo.x=0;
+  translateTo.y=0;
+  translateTo.z=0;
+  rotateBy.x=0;
+  rotateBy.y=0;
+  rotateBy.z=0;
+  target=createStick();
+}
+
+
+void CameraTarget::detach()
+{
+  masta->setParentSoft(target);
+  masta->getTargetNode()->setParentSoft(target);
+}
+
+PNode* CameraTarget::createStick()
+{
+  return new Targets();
+}
+
+
+void CameraTarget::atach(PNode* object)
+{
+  masta->setParentSoft(object);
+  masta->getTargetNode()->setParentSoft(object);
+}
+
+
+
+
+Vector CameraTarget::iterate(float dt, const Vector* Target, const Vector* cam)
+{
+
+
+  Vector tmpVec;
+  tmpVec= (*Target - *cam);
+  tmpVec.normalize();
+  return  tmpVec;
+
+}
+
+
+void CameraTarget::translate(float dt)
+{
+  if (fabs(translateTo.len()  - (target->getAbsCoor()).len()) >= 11 )
+ {
+   Vector tmpVec= iterate(dt,  &translateTo,  &(masta->getAbsCoor()));
+   target->shiftCoor(speed*tmpVec.x, speed*tmpVec.y, speed*tmpVec.z);
+  }
+}
+
+Vector * CameraTarget::rotate(Vector* newPos, float speed)
+{
+
+}
+
+void CameraTarget::jump(float x, float y, float z)
+{
+target->setAbsCoor(x,y,z);
+}
+
+
+void CameraTarget::trans(float x, float y, float z)
+{
+  Vector tmpVec=Vector(x,y,z);
+  if( this->getParent())
+    this->getParent()->setRelCoor(this->getParent()->getRelCoor());
+  translateNow(&tmpVec);
+}
+
+void CameraTarget::translateNow(Vector* vec)
+{
+translateTo=*vec;
+}
+
+void CameraTarget::changeSpeed(float speed)
+{
+  if (speed!=0)
+this->speed=speed;
+  return;
+}
+
+
+bool CameraTarget::isDone()
+{
+  if (fabs(translateTo.len()  - (target->getAbsCoor()).len()) >= 11 )
+    return 0;
+  else
+    return 1;
+}
Index: /branches/cleanup/src/world_entities/tools/camera.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/camera.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/camera.h	(revision 10591)
@@ -0,0 +1,174 @@
+/*!
+ * @file camera.h
+ * Viewpoint controlling class definitions
+*/
+
+#ifndef _CAMERA_H
+#define _CAMERA_H
+
+#include "world_entity.h"
+#include "event_listener.h"
+#include "plane.h"
+
+
+class World;
+class CameraTarget;
+class Event;
+
+//! Camera
+/**
+ * This class controls the viewpoint from which the World is rendered.
+*/
+class Camera : public WorldEntity, public EventListener
+{
+  friend class CameraTarget;
+  friend class CameraMan;
+  ObjectListDeclaration(Camera);
+public:
+  //! an enumerator for different types of view
+  typedef enum ViewMode
+  {
+    ViewNormal,
+    ViewBehind,
+    ViewFront,
+    ViewLeft,
+    ViewRight,
+    ViewTop
+  };
+  public:
+  Camera();
+  Camera(const TiXmlElement* root);
+  virtual ~Camera();
+
+  void lookAt(PNode* target);
+  CameraTarget* getTarget() const { return this->target; };
+  PNode* getTargetNode() const;
+  void setTargetNode(PNode* target);
+  void setAspectRatio(float aspectRatio);
+  inline float getAspectRatio() {return this->aspectRatio;};
+
+  void setClipRegion(float nearClip, float farClip);
+
+  /** @param fovy new field of view factor (in degrees) */
+  inline void setFovy(float fovy)
+  {
+    this->fovy = fovy;
+    this->toFovy = fovy;
+  };
+
+  inline float getFovy() {return this->fovy;};
+  /** @param fovy new field of view factor (in degrees) to iterate to */
+  void setToFovy(float toFovy) { this->toFovy = toFovy; };
+
+  void setViewMode(Camera::ViewMode mode);
+  inline const Vector& getViewVector() const { return this->viewVector; }
+  inline const Vector& getUpVector() const { return this->upVector; }
+  inline const Plane& getViewFrustum() const { return this->frustumPlane; }
+
+  inline float distance(const Vector& distance) const { return this->frustumPlane.distancePoint(distance); }
+  inline float distance(const PNode* node) const { return distance(node->getAbsCoor()); }
+
+  inline void setEventHandling(bool b) {this->eventHandling = b;}
+  inline bool getEventHandling() {return this->eventHandling;}
+
+  void glLookAt(float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz);
+  Vector* VectorProd(Vector* v1, Vector* v2);
+  void Rotate();
+  void draw() const;
+  void tick(float dt);
+  void apply ();
+  void project();
+
+  void process(const Event &event);
+  //CameraTarget*     target;          //!< The Target of the Camera (where this Camera Looks at)
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  void              setViewTopFovy(float fovy);
+  void              setViewLeftFovy(float fovy);
+  void              setViewRightFovy(float fovy);
+  void              setViewBehindFovy(float fovy);
+  void              setViewFrontFovy(float fovy);
+  void              setViewNormalFovy(float fovy);
+
+  void              setViewTopDistance(float Distance);
+  void              setViewLeftDistance(float Distance);
+  void              setViewRightDistance(float Distance);
+  void              setViewBehindDistance(float Distance);
+  void              setViewFrontDistance(float Distance);
+  void              setViewNormalDistance(float Distance);
+
+private:
+
+  void              init();
+
+  CameraTarget*     target;          //!< The Target of the Camera (where this Camera Looks at)
+
+  bool              eventHandling;    //!< True, if the Camera handles the processing of events itself. Set false to overwrite the standard handling.
+
+  float             fovy;            //!< The field of view Angle (in degrees).
+  float             aspectRatio;     //!< The aspect ratio (width / height).
+  float             nearClip;        //!< The near clipping plane.
+  float             farClip;         //!< The far clipping plane.
+
+  float             toFovy;          //!< The fovy-mode to iterate to.
+  Camera::ViewMode  currentMode;     //!< The ViewMode the camera is in
+
+  Vector            delay;
+  Plane             frustumPlane;    //!< plane that marks the view frustum
+  Vector            viewVector;      //!< the direction of the camera view
+  Vector            upVector;        //!< direction of the up vector
+
+  float             viewTopFovy;
+  float             viewLeftFovy;
+  float             viewRightFovy;
+  float             viewBehindFovy;
+  float             viewFrontFovy;
+  float             viewNormalFovy;
+
+  float             viewTopDistance;
+  float             viewLeftDistance;
+  float             viewRightDistance;
+  float             viewBehindDistance;
+  float             viewFrontDistance;
+  float             viewNormalDistance;
+
+};
+
+//! A CameraTarget is where the Camera is looking at.
+class CameraTarget : public PNode
+{
+  friend class Camera;        //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it.
+  ObjectListDeclaration(CameraTarget);
+
+private:
+  CameraTarget();
+  virtual ~CameraTarget() {}
+  float speed;
+  PNode* target;
+  PNode* freeTarget;
+  Camera* masta;
+  Vector translateTo;
+  Vector rotateBy;
+
+
+public:
+
+  void detach();
+  void atach(PNode* object);
+  Vector iterate(float dt, const Vector* target, const Vector* cam);
+  void translate(float dt);
+  void changeSpeed(float speed);
+  Vector* rotate(Vector* newPos, float speed);
+  void jump(float x, float y, float z);
+  void translateNow(Vector* vec);
+  PNode* createStick();
+  void trans(float x, float y, float z);
+  bool isDone();
+};
+
+
+
+
+#endif /* _CAMERA_H */
+
Index: /branches/cleanup/src/world_entities/tools/cameraman.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/cameraman.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/cameraman.cc	(revision 10591)
@@ -0,0 +1,384 @@
+  /*
+   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: Filip Gospodinov
+   co-programmer: Silvan Nellen
+*/
+
+#include "shell_command.h"
+#include "cameraman.h"
+#include "game_world_data.h"
+#include "state.h"
+#include "sound_engine.h"
+#include <string>
+#include "script_class.h"
+#include "loading/load_param_xml.h"
+#include "blackscreen.h"
+#include "p_node.h"
+#include "camera.h"
+
+ObjectListDefinition(CameraMan);
+
+SHELL_COMMAND(camerainfo, CameraMan, cameraInfo);
+
+
+CREATE_SCRIPTABLE_CLASS(CameraMan,
+                        addMethod("changeCurrTarget", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::changeCurrTarget))
+                        ->addMethod("atachCurrCameraToWorldEntity", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::atachCurrCameraToWorldEntity))
+                        ->addMethod("changeTarget", Executor3<CameraMan, lua_State*, const std::string&, const std::string&,const std::string&>(&CameraMan::changeTarget))
+                        ->addMethod("atachCameraToWorldEntity", Executor3<CameraMan, lua_State*,const std::string&,const std::string&,const std::string&>(&CameraMan::atachCameraToWorldEntity))
+                        ->addMethod("detachCurrCamera", Executor0<CameraMan, lua_State*>(&CameraMan::detachCurrCamera))
+                        ->addMethod("setCam", Executor1<CameraMan, lua_State*, const std::string&>(&CameraMan::setCam))
+                        ->addMethod("toggleFade", Executor0<CameraMan, lua_State*>(&CameraMan::togglFade))
+                        ->addMethod("initFadeBlack", Executor0<CameraMan, lua_State*>(&CameraMan::initFadeBlack))
+                        ->addMethod("getCurrCameraCoorX", Executor0ret<CameraMan, lua_State*,float>(&CameraMan::getCurrCameraCoorX))
+                        ->addMethod("getCurrCameraCoorY", Executor0ret<CameraMan, lua_State*,float>(&CameraMan::getCurrCameraCoorY))
+                        ->addMethod("getCurrCameraCoorZ", Executor0ret<CameraMan, lua_State*,float>(&CameraMan::getCurrCameraCoorZ))
+                        ->addMethod("jumpCurrCam", Executor3<CameraMan, lua_State*,float,float,float>(&CameraMan::jumpCurrCam))
+                        ->addMethod("jumpCam", Executor4<CameraMan, lua_State*,const std::string&,float,float,float>(&CameraMan::jumpCam))
+                        //->addMethod("setViewMode", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::setViewMode))
+                        ->addMethod("setRelCoor", Executor4<CameraMan, lua_State*,const std::string&,float,float,float>(&CameraMan::setRelCameraCoor))
+                        ->addMethod("setRelCoorSoft", Executor5<CameraMan, lua_State*,const std::string&,float,float,float,float>(&CameraMan::setRelCameraCoorSoft))
+                        ->addMethod("pauseCamera", Executor2<CameraMan, lua_State*, const std::string&, bool>(&CameraMan::pauseCamera))
+                       );
+
+
+CameraMan::CameraMan(const TiXmlElement* root)
+{
+  this->registerObject(this, CameraMan::_objectList);
+
+  this->nearClip = 1.0;
+  this->farClip = 1000.0;
+
+  this->fadeToBlack=new BlackScreen();
+
+  this->setCam( State::getCamera());
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+void CameraMan::loadParams(const TiXmlElement* root)
+{
+  BaseObject::loadParams(root);
+  LoadParamXML(root, "Cameras", this, CameraMan, createCameras);
+}
+
+
+void CameraMan::createCameras(const TiXmlElement* camerasTag)
+{
+
+    LOAD_PARAM_START_CYCLE(camerasTag, object);
+    {
+      this->createCam(object);
+    }
+    LOAD_PARAM_END_CYCLE(object);
+
+}
+
+
+void CameraMan::createCam(const TiXmlElement* root)
+{
+  this->cameras.push_back(new Camera(root));
+  cameras[cameras.size()-1]->setClipRegion(nearClip, farClip);
+}
+
+/*void CameraMan::setViewMode(const std::string& cameraName, const std::string& viewMode)
+{
+     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", cameraName);
+     
+     if (!strcmp(viewMode, "ViewNormal"))
+     {
+         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewNormal);
+     }
+     else if (!strcmp(viewMode, "ViewTop"))
+     {
+         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewTop);
+     }
+     else if (!strcmp(viewMode, "ViewBehind"))
+     {
+         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewBehind);
+     }
+     else if (!strcmp(viewMode, "ViewFront"))
+     {
+         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewFront);
+     }
+     else if (!strcmp(viewMode, "ViewLeft"))
+     {
+         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewLeft);
+     }
+     else if (!strcmp(viewMode, "ViewRight"))
+     {
+         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewRight);
+     }
+}*/
+
+void CameraMan::setRelCameraCoor(const std::string& camName, float x, float y, float z)
+{
+     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
+     dynamic_cast<Camera*>(newCam)->setRelCoor(x,y,z);
+     dynamic_cast<Camera*>(newCam)->target->setRelCoor(0,0,0);
+}
+
+void CameraMan::setRelCameraCoorSoft(const std::string& camName, float x, float y, float z, float bias)
+{
+     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
+     dynamic_cast<Camera*>(newCam)->setRelCoorSoft(x,y,z,bias);
+     dynamic_cast<Camera*>(newCam)->target->setRelCoorSoft(0,0,0,bias);
+}
+
+void CameraMan::pauseCamera(const std::string& camName, bool stop)
+{
+     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
+     dynamic_cast<Camera*>(newCam)->pauseTrack(stop);
+}
+
+void CameraMan::setCam(unsigned int cameraNo)
+{
+  if (cameraNo<cameras.size())
+  {
+    this->setCam( cameras[cameraNo]);
+  }
+}
+
+void CameraMan::setCam(const std::string& camName)
+{
+  BaseObject* object = ObjectListBase::getBaseObject("Camera", camName);
+
+  if(object != NULL)
+  {
+    this->setCam(dynamic_cast<Camera*>(object));
+    return;
+  }
+  printf("ERROR CAMERAMANAGER: Couldn't set camera : %s \n", camName.c_str());
+}
+
+
+void CameraMan::setCam(Camera* camera)
+{
+  if( camera == NULL)
+  {
+    PRINTF(0)("trying to add a zero camera! uiuiui!\n");
+    return;
+  }
+  
+  this->currentCam = camera;
+
+  State::setCamera(currentCam, currentCam->getTarget());
+  OrxSound::SoundEngine::getInstance()->setListener(currentCam);
+
+  // check if it is already added
+  if( ! this->cameraIsInVector(currentCam) )
+    this->cameras.push_back(currentCam);
+
+  this->fadeToBlack->setRelCoor(0., 0., 0.);
+  this->fadeToBlack->setParent(this->currentCam);
+}
+
+
+void CameraMan::moveCurrCam(int x, int y, int z)
+{
+  currentCam->target->trans(x,y,z);
+}
+
+
+void CameraMan::changeCurrTarget(const std::string& className, const std::string& objectName)
+{
+  BaseObject* object = ObjectListBase::getBaseObject(className, objectName);
+  if( object != NULL && object->isA(PNode::staticClassID()))
+  {
+    currentCam->lookAt(dynamic_cast<PNode*>(object));
+    State::setCamera(this->currentCam,  dynamic_cast<CameraTarget*>(object));
+  }
+}
+
+
+void CameraMan::atachCurrCameraToWorldEntity(const std::string& className, const std::string& targetEntity)
+{
+  BaseObject* object = ObjectListBase::getBaseObject(className, targetEntity);
+
+  if(object != NULL && object->isA(PNode::staticClassID()))
+  {
+   this->atachTarget(this->currentCam, dynamic_cast<PNode*>(object));
+   return;
+  }
+
+printf("ERROR CAMERAMANAGER: Couldn't set camera to: %s %s \n", className.c_str(),targetEntity.c_str() );
+}
+
+
+
+void CameraMan::detachCurrCamera()
+{
+  currentCam->target->detach();
+}
+
+
+
+void CameraMan::jumpCurrCam(float x, float y, float z)
+{
+  currentCam->target->jump(x, y, z);
+}
+
+void CameraMan::togglFade()
+{
+  if( this->fadeToBlack)
+    fadeToBlack->toggleFade();
+}
+
+
+void CameraMan::initFadeBlack()
+{
+  if( this->fadeToBlack)
+    fadeToBlack->initFadeBlack();
+}
+
+
+void CameraMan::moveCam(int x, int y, int z, int camNo)
+{
+  cameras[camNo]->target->trans(x,y,z);
+}
+
+
+void CameraMan::changeTarget(int camNo,const std::string& className, const std::string& objectName)
+{
+  BaseObject* object = ObjectListBase::getBaseObject(className, objectName);
+  if( object != NULL && object->isA(PNode::staticClassID()))
+  {
+    cameras[camNo]->lookAt(dynamic_cast<PNode*>(object));
+  }
+}
+
+
+void CameraMan::changeTarget(const std::string& camName,const std::string& className, const std::string& objectName)
+{
+  BaseObject* object = ObjectListBase::getBaseObject(className, objectName);
+  BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
+  if( object != NULL && newCam != NULL && object->isA(PNode::staticClassID()))
+  {
+    dynamic_cast<Camera*>(newCam)->lookAt(dynamic_cast<PNode*>(object));
+    State::setCamera( dynamic_cast<Camera*>(newCam),  dynamic_cast<CameraTarget*>(object));
+  }
+}
+
+
+void CameraMan::atachCameraToWorldEntity(const std::string& cameraName, const std::string& className, const std::string& targetEntity)
+{
+  BaseObject* object = ObjectListBase::getBaseObject(className, targetEntity);
+  BaseObject* targetCam = ObjectListBase::getBaseObject("Camera", cameraName);
+
+  if( object != NULL && targetCam != NULL && object->isA(PNode::staticClassID()) )
+  {
+    this->atachTarget(dynamic_cast<Camera*>(targetCam), dynamic_cast<PNode*>( object ));
+    return;
+  }
+
+  printf("ERROR CAMERAMANAGER: Couldn't set camera %s to: %s %s \n", cameraName.c_str(), className.c_str(),targetEntity.c_str() );
+}
+
+
+
+void CameraMan::jumpCam(int x, int y, int z, int camNo)
+{
+  cameras[camNo]->target->jump(x, y, z);
+}
+
+
+void CameraMan::jumpCam(const std::string& cameraName, float x, float y, float z)
+{
+  BaseObject* targetCam = ObjectListBase::getBaseObject("Camera", cameraName);
+  if( targetCam != NULL )
+  {
+    dynamic_cast<Camera*>(targetCam)->target->jump( x, y, z );
+  }
+
+}
+
+
+void CameraMan::setClipRegion(float nearCli, float farCli)
+{
+  this->nearClip=nearCli;
+  this->farClip=farCli;
+
+  for(unsigned int i = 0; i < this->cameras.size(); i++)
+    cameras[i]->setClipRegion(nearCli, farCli);
+}
+
+
+
+bool CameraMan::cameraIsInVector(Camera* camera)
+{
+
+  for(std::vector<Camera*>::const_iterator it = cameras.begin(); it != cameras.end(); it++ )
+  {
+    if( (*it) == camera)
+    {
+      return true;
+    }
+  }
+  return false;
+
+
+}
+
+
+void CameraMan::cameraInfo()
+{
+  bool sameCam = (this->currentCam == State::getCamera());
+
+
+  PRINT(0)("==== CameraMan::cameraInfo ===\n");
+  PRINT(0)("=  Camera Name: %s\n", this->currentCam->getName().c_str());
+  PRINT(0)("=  Tests:\n");
+  PRINT(0)("==  State::Cam == this::Cam  %i\n", sameCam);
+  PRINT(0)("==  Parenting Informations:\n");
+  this->currentCam->debugNode(10);
+  PRINT(0)("==============================\n");
+}
+
+
+float CameraMan::getCurrCameraCoorX()
+{ return this->currentCam->getAbsCoorX(); }
+
+float CameraMan::getCurrCameraCoorY()
+{ return this->currentCam->getAbsCoorY(); }
+
+float CameraMan::getCurrCameraCoorZ()
+{ return this->currentCam->getAbsCoorZ(); }
+
+
+
+void CameraMan::atachTarget(Camera* cam ,PNode* target)
+{
+  cam->target->atach(target);
+  cam->setViewMode(Camera::ViewNormal);
+  State::setCamera( cam,  dynamic_cast<CameraTarget*>(target));
+
+}
+
+//how to get a class fkt pointer
+
+//BaseObject* object = ObjectListBase::getBaseObject(className, objectName);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /branches/cleanup/src/world_entities/tools/cameraman.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/cameraman.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/cameraman.h	(revision 10591)
@@ -0,0 +1,73 @@
+#ifndef _CAMERAMAN_H
+#define _CAMERAMAN_H
+
+
+#include <vector>
+#include "base_object.h"
+
+class BlackScreen;
+class Camera;
+class PNode;
+
+class CameraMan : public BaseObject {
+  ObjectListDeclaration(CameraMan);
+
+  private:
+    Camera* currentCam;
+    float nearClip;
+    float farClip;
+    BlackScreen* fadeToBlack;
+
+  public:
+    std::vector<Camera*> cameras;
+    CameraMan(const TiXmlElement* root = NULL);
+    void setCam(unsigned int CameraNo);
+    void setCam(const std::string& camName);
+    void setCam(Camera* camera);
+
+    /// LOADING
+    virtual void loadParams(const TiXmlElement* root);
+    void createCameras(const TiXmlElement* camerasTag);
+    void createCam(const TiXmlElement* root);
+
+    /// POLLING
+    float getCurrCameraCoorX();
+    float getCurrCameraCoorY();
+    float getCurrCameraCoorZ();
+    const Camera* getCurrentCam() const { return this->currentCam; }
+    Camera* getCurrentCam() { return this->currentCam; }
+
+    
+    /// Current camera
+    void moveCurrCam(int x, int y, int z);
+    void changeCurrTarget(const std::string& className, const std::string& objectName);
+    void atachCurrCameraToWorldEntity(const std::string& className, const std::string& targetEntity);
+    void detachCurrCamera();
+    void jumpCurrCam(float x, float y, float z);
+    void togglFade();
+    void initFadeBlack();
+    
+    /// Camera
+    void moveCam(int x, int y, int z,  int camNo);
+    void changeTarget(int camNo, const std::string& className,const std::string& objectName);
+    void changeTarget(const std::string& camName,const std::string& className, const std::string& objectName);
+    void atachCameraToWorldEntity(const std::string& cameraName, const std::string& className, const std::string& targetEntity);
+    void jumpCam(int x, int y, int z, int camNo);
+    void jumpCam(const std::string& cameraName, float x, float y, float z);
+    void setRelCameraCoor(const std::string& cameraName, float x, float y, float z);
+    void setRelCameraCoorSoft(const std::string& cameraName, float x, float y, float z, float bias);
+    //void setViewMode(const std::string& camName, const std::string& viewMode);
+    void pauseCamera(const std::string& camName, bool stop);
+    
+    void changeSpeed(float speed);
+    void setClipRegion(float nearClip, float farClip);
+    void cameraInfo();
+    
+  private:
+    bool cameraIsInVector(Camera* camera);
+    void atachTarget(Camera* cam, PNode* pnode);
+    
+
+};
+
+#endif /* _CAMERAMAN_H */
Index: /branches/cleanup/src/world_entities/tools/mount_point.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/mount_point.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/mount_point.cc	(revision 10591)
@@ -0,0 +1,262 @@
+/*
+   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, patrick@orxonox.net
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "executor/executor.h"
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/load_param_xml.h"
+
+#include "weapons/weapon_slot.h"
+
+#include "particles/particle_system.h"
+
+#include "mount_point.h"
+#include "debug.h"
+#include "state.h"
+
+
+ObjectListDefinition(MountPoint);
+
+
+/**
+ * construct
+ */
+MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name)
+{
+//   PRINTF(0)("Created mount point %s\n", name.c_str());
+  this->registerObject(this, MountPoint::_objectList);
+
+  this->_name = name;
+  this->setRelCoor( center);
+  this->setRelDir( Quaternion(forward, up));
+
+  this->_center = center;
+  this->_up = up;
+  this->_forward = forward;
+
+  this->init();
+}
+
+
+
+/**
+ * deconstructor
+ */
+MountPoint::~MountPoint ()
+{}
+
+
+/**
+ * initializing function
+ */
+void MountPoint::init()
+{
+  this->registerObject(this, MountPoint::_objectList);
+  this->toList(OM_GROUP_00);
+
+  this->_mount = NULL;
+}
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void MountPoint::initMountPoint(const TiXmlElement* root)
+{
+  if( root == NULL)
+  {
+    PRINTF(1)("MountPoint - initialization failed, since I got no valid xml element\n");
+    return;
+  }
+  // now get the first element
+  const TiXmlElement* element = root->FirstChildElement("MountPoints");
+  if( element == NULL)
+  {
+    PRINTF(1)("I am in section: %s, Object Information file is missing a proper 'MountPoints' section\n", root->Value());
+//     element = root->FirstChildElement( );
+//     PRINTF(0)("first child: %s\n", element->Value());
+  }
+  else
+  {
+    element = element->FirstChildElement();
+    // parse the information for this mount point
+
+    PRINTF(4)("Loading WorldEntities\n");
+    while( element != NULL)
+    {
+      std::string name = element->Value();
+
+      PRINTF(5)("checking %s against local %s\n", name.c_str(), this->_name.c_str());
+      // check if we got the right mount point
+      if( this->_name.find(name, 0) != std::string::npos)
+      {
+        PRINTF(5)("found mount point %s\n", this->_name.c_str());
+        // load it
+        this->loadParam(element);
+      }
+
+      element = element->NextSiblingElement();
+    }
+  }
+}
+
+
+
+/**
+ * load the parameters from the xml section
+ * @param root the root element of this xml branche
+ */
+void MountPoint::loadParam(const TiXmlElement* root)
+{
+  // first check for the description
+  LoadParam(root, "Description", this, MountPoint, setDescription)
+  .describe("Sets this mount point a description");
+
+  // now check for the orx class to create
+  LoadParam(root, "OrxClass", this, MountPoint, setOrxClass)
+  .describe("Sets the class this mount points should host");
+
+  LoadParamXML(root, "Details", this, MountPoint, loadDetails);
+}
+
+
+/**
+ * load the parameters from the world entity
+ * @param root the root element of this xml branche
+ */
+void MountPoint::loadDetails(const TiXmlElement* root)
+{
+  if( this->_mount != NULL)
+  {
+//     PRINTF(0)("Got detailed informations\n");
+    this->_mount->loadParams( root);
+
+    if( this->_mount->isA(ParticleSystem::staticClassID()))
+    {
+//       PRINTF(0)("got particle system. attaching it to mp\n");
+      dynamic_cast<ParticleSystem*>(this->_mount)->attachEmmittersTo(this, Vector(0,0,0),
+                                    this->getRelDir()*Quaternion(M_PI, Vector(0,1,0)));
+    }
+  }
+}
+
+
+/**
+ * setst the description (optional) via xml tag
+ * @param description string containing the description
+ */
+void MountPoint::setDescription(const std::string& description)
+{
+  this->_description = description;
+}
+
+
+
+/**
+ * sets the class of this mount point
+ * @param orxClass class
+ */
+void MountPoint::setOrxClass(const std::string& orxClass)
+{
+  // create the object for this mount point
+  BaseObject* obj = Factory::fabricate(orxClass);
+  // check if the object is created correctly
+  if( obj != NULL)
+  {
+    if( obj->isA( WorldEntity::staticClassID()))
+    {
+//       PRINTF(0)("Mount Point created a %s\n", obj->getCName());
+      // cast down the object to WE
+      this->_mount = dynamic_cast<WorldEntity*>(obj);
+
+      // now set the position, direction and reparent it to this node
+      this->_mount->setAbsCoor( this->getAbsCoor());
+      this->_mount->setAbsDir( this->getAbsDir());
+      this->_mount->setParent( this);
+
+      dynamic_cast<WorldEntity*>(this->_mount)->toList((OM_LIST)(this->getOMListNumber()));
+    }
+    else if( obj->isA( WeaponSlot::staticClassID()))
+    {
+//       PRINTF(0)("=========+>we got a weapon slot at\n");
+//       this->getAbsCoor().debug();
+// //       this->_center.debug();
+
+
+      // cast down the object to WE
+      this->_mount = dynamic_cast<WeaponSlot*>(obj);
+
+      // now set the position, direction and reparent it to this node
+      this->_mount->setAbsCoor( this->_center);
+      this->_mount->setAbsDir( Quaternion(_forward, _up));
+      this->_mount->setParent( this);
+    }
+  }
+  else
+    PRINTF(1)("Couldn't create %s for this mount point (%s)\n", orxClass.c_str(), this->_name.c_str());
+}
+
+
+
+/**
+ * tick
+ * @param time  time passed since the last tick
+ */
+void MountPoint::tick (float time)
+{
+
+}
+
+
+/**
+ * draw this entity
+ */
+void MountPoint::draw() const
+{
+}
+
+
+
+/**
+ *  function called to draw the mount point itself for debug purposes only
+ */
+void MountPoint::debugDraw() const
+{
+  // invoke the underlying pnode debug draw
+  this->debugDraw();
+}
+
+
+/**
+ * adds an entity to this mount point
+ * @param entity entity to be added
+ */
+void MountPoint::mount(PNode* entity)
+{
+  this->_mount = entity;
+}
+
+
+/**
+ * removes an entity from this mount point
+ */
+void MountPoint::unmount()
+{
+  this->_mount = NULL;
+}
+
Index: /branches/cleanup/src/world_entities/tools/mount_point.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/mount_point.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/mount_point.h	(revision 10591)
@@ -0,0 +1,48 @@
+#ifndef _MOUNT_POINT_H
+#define _MOUNT_POINT_H
+
+#include "world_entity.h"
+
+class TiXmlElement;
+
+
+class MountPoint : public WorldEntity
+{
+    ObjectListDeclaration(MountPoint);
+
+  public:
+    MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name);
+    virtual ~MountPoint ();
+
+    void init();
+    void initMountPoint(const TiXmlElement* root);
+    void loadParam(const TiXmlElement* root);
+    void loadDetails(const TiXmlElement* root);
+
+    void setDescription(const std::string& description);
+    void setOrxClass(const std::string& orxClass);
+
+    virtual void tick (float time);
+    virtual void draw() const;
+
+    void debugDraw() const;
+
+    inline const Vector& getCenter() { return this->_center; }
+
+    void mount(PNode* entity);
+    void unmount();
+    PNode* getMount() { return this->_mount; }
+
+  private:
+    PNode*               _mount;       //!< the entity mounted at this mount point
+    std::string          _name;        //!< the name of the mount point
+
+    std::string          _description; //!< string containing an optional description
+
+    Vector               _center;
+    Vector               _up;
+    Vector               _forward;
+
+};
+
+#endif /* _MOUNT_POINT_H */
Index: /branches/cleanup/src/world_entities/tools/movie_entity.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/movie_entity.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/movie_entity.cc	(revision 10591)
@@ -0,0 +1,169 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2005 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: David Hasenfratz, Stefan Lienhard
+   co-programmer:
+*/
+
+#include "movie_entity.h"
+
+#include "media_container.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+
+
+
+ObjectListDefinition(MovieEntity);
+CREATE_FACTORY(MovieEntity);
+
+/**
+ *  standard constructor
+ */
+MovieEntity::MovieEntity (const TiXmlElement* root)
+{
+  this->registerObject(this, MovieEntity::_objectList);
+
+  media_container = new MediaContainer();
+
+  axis = 0;
+  rotation = 0;
+  height = 20;
+  width = 20;
+  mediaLoaded = false;
+
+  this->toList(OM_COMMON);
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  counter = 0;
+  timer = 0;
+}
+
+/**
+ *  standard destructor
+ */
+MovieEntity::~MovieEntity ()
+{
+  if( this->media_container)
+    delete this->media_container;
+}
+
+void MovieEntity::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "name", this, MovieEntity, loadMovie);
+  LoadParam(root, "axis", this, MovieEntity, setAxis);
+  LoadParam(root, "rotation", this, MovieEntity, setRotation);
+  LoadParam(root, "size", this, MovieEntity, setSize);
+  LoadParam(root, "fps", this, MovieEntity, setFPS);
+}
+
+void MovieEntity::setFPS(float fps)
+{
+  this->fps = fps;
+//PRINTF(0)("fps: %f\n", fps);
+}
+
+void MovieEntity::loadMovie(const std::string& filename)
+{
+  if(media_container->loadMedia(filename))
+  {
+    mediaLoaded = true;
+    fps = media_container->getFPS();
+  }
+  else
+    mediaLoaded = false;
+}
+
+void MovieEntity::setAxis(float axis)
+{
+//PRINTF(0)("fps: %f\n", fps);
+  this->axis = axis;
+}
+
+// Seconds for one loop
+void MovieEntity::setRotation(float rotation)
+{
+  this->rotation = rotation;
+}
+
+void MovieEntity::setSize(float width, float height)
+{
+  this->width = width;
+  this->height = height;
+}
+
+/**
+ *  this method is called every frame
+ * @param time: the time in seconds that has passed since the last tick
+
+   Handle all stuff that should update with time inside this method (movement, animation, etc.)
+ */
+void MovieEntity::tick(float time)
+{
+  if(!mediaLoaded)
+    return;
+
+  timer += time;
+
+  if(counter != fps * timer)
+  {
+    counter = (int)(fps * timer);
+
+    if ((unsigned int)counter >= media_container->getFrameCount())
+    {
+      timer = 0;
+      counter = 0;
+    }
+  }
+
+  axis += (time * rotation/360.0);
+}
+
+
+/**
+ *  the entity is drawn onto the screen with this function
+
+   This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
+ */
+void MovieEntity::draw() const
+{
+//   if(!mediaLoaded)
+//     false;
+
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+  glDisable(GL_BLEND);
+
+  glEnable(GL_TEXTURE_2D);
+  glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
+
+  glPushMatrix();
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  glRotatef(axis, 0.0f, 1.0f, 0.0f);
+//PRINTF(0)("axis: %f\n", axis);
+
+  glColor3f(1.0, 1.0, 1.0);
+
+  glBegin(GL_QUADS);
+    glTexCoord2f(1.0f, 1.0f); glVertex3f(-width/2, -height/2,  0.0f);
+    glTexCoord2f(0.0f, 1.0f); glVertex3f( width/2, -height/2,  0.0f);
+    glTexCoord2f(0.0f, 0.0f); glVertex3f( width/2,  height/2,  0.0f);
+    glTexCoord2f(1.0f, 0.0f); glVertex3f(-width/2,  height/2,  0.0f);
+  glEnd();
+
+  glPopMatrix();
+  glPopAttrib();
+}
Index: /branches/cleanup/src/world_entities/tools/movie_entity.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/movie_entity.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/movie_entity.h	(revision 10591)
@@ -0,0 +1,48 @@
+/*!
+ * @file movie_entity.h
+ *  Definition of a Movie Screen
+ */
+
+#ifndef _MOVIE_ENTITY_H
+#define _MOVIE_ENTITY_H
+
+#include "world_entity.h"
+
+
+class MediaContainer;
+
+class MovieEntity : public WorldEntity
+{
+  ObjectListDeclaration(MovieEntity);
+  private:
+    MediaContainer* media_container;
+
+    int counter;
+    float timer;
+    float fps;
+
+    float axis;
+    float rotation;
+    float height;
+    float width;
+
+    bool mediaLoaded;
+
+  public:
+    MovieEntity (const TiXmlElement* root = NULL);
+    virtual ~MovieEntity ();
+
+    virtual void draw () const;
+    virtual void tick (float time);
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    void loadMovie(const std::string& filename);
+    void setAxis(float axis);
+    void setRotation(float rotation);
+    void setSize(float width, float height);
+    void setFPS(float fps);
+
+};
+
+#endif /* _MOVIE_ENTITY_H */
Index: /branches/cleanup/src/world_entities/tools/recorder.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/recorder.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/recorder.cc	(revision 10591)
@@ -0,0 +1,370 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2006 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: David Hasenfratz
+   co-programmer:
+*/
+
+#include "recorder.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "state.h"
+#include "debug.h"
+
+
+ObjectListDefinition(Recorder);
+CREATE_FACTORY(Recorder);
+
+
+Recorder::Recorder (const TiXmlElement* root)
+{
+  this->registerObject(this, Recorder::_objectList);
+
+  // initialize libavcodec, and register all codecs and formats
+  av_register_all();
+
+  // Default values
+  stream_duration = 10;
+  stream_frame_rate = 20;
+
+  this->loadParams(root);
+
+  this->toList(OM_COMMON);
+}
+
+
+Recorder::~Recorder ()
+{
+
+}
+
+
+void Recorder::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "duration", this, Recorder, setStreamDuration);
+
+  LoadParam(root, "fps", this, Recorder, setFPS);
+
+  LoadParam(root, "name", this, Recorder, initVideo);
+}
+
+
+void Recorder::setStreamDuration(float duration)
+{
+  this->stream_duration = duration;
+}
+
+
+void Recorder::setFPS(float fps)
+{
+  this->stream_frame_rate = fps;
+}
+
+
+void Recorder::initVideo(const std::string& filename)
+{
+  frame_count = 0;
+  time = 0;
+  stream_nb_frames = (int)(stream_duration * stream_frame_rate);
+
+  // auto detect the output format from the name, default is mpeg
+  output_format = guess_format(NULL, filename.c_str(), NULL);
+  if (!output_format)
+  {
+      PRINTF(0)("Could not deduce output format from file extension: using MPEG.\n");
+      output_format = guess_format("mpeg", NULL, NULL);
+  }
+  if (!output_format)
+    PRINTF(1)("Could not find suitable output format\n");
+
+  // allocate the output media context
+  format_context = av_alloc_format_context();
+  if (!format_context)
+    PRINTF(1)("Memory error\n");
+
+  format_context->oformat = output_format;
+  snprintf(format_context->filename, sizeof(format_context->filename), "%s", filename.c_str());
+
+  // add video stream using the default format codec and initialize the codec
+  if (output_format->video_codec != CODEC_ID_NONE)
+      this->addVideoStream();
+
+  // set the output parameters (must be done even if no parameters)
+  if (av_set_parameters(format_context, NULL) < 0)
+    PRINTF(1)("Invalid output format parameters\n");
+
+  // print some information
+  dump_format(format_context, 0, filename.c_str(), 1);
+
+  // now that all the parameters are set, we can open the
+  // video codec and allocate the necessary encode buffer
+  if(video_stream)
+    this->openVideo();
+
+  // open the output file, if needed
+  if(!(output_format->flags & AVFMT_NOFILE))
+  {
+    if(url_fopen(&format_context->pb, filename.c_str(), URL_WRONLY) < 0)
+      PRINTF(1)("Could not open %s\n", filename.c_str());
+  }
+
+  // write the stream header, if any
+  av_write_header(format_context);
+}
+
+void Recorder::closeVideo()
+{
+  avcodec_close(video_stream->codec);
+  av_free(picture->data[0]);
+  av_free(picture);
+  av_free(buffer);
+
+  // write the trailer, if any
+  av_write_trailer(format_context);
+
+  // free the streams
+  for(int i = 0; i < format_context->nb_streams; i++)
+    av_freep(&format_context->streams[i]);
+
+  // close the output file
+  if (!(output_format->flags & AVFMT_NOFILE))
+    url_fclose(&format_context->pb);
+
+  // free the stream
+  av_free(format_context);
+}
+
+
+void Recorder::openVideo()
+{
+  codec_context = video_stream->codec;
+
+  // find the video encoder
+  codec = avcodec_find_encoder(codec_context->codec_id);
+  if(!codec)
+    PRINTF(1)("codec not found\n");
+
+  // open the codec
+  if(avcodec_open(codec_context, codec) < 0)
+    PRINTF(1)("could not open codec\n");
+
+  buffer = NULL;
+  if(!(format_context->oformat->flags & AVFMT_RAWPICTURE))
+  {
+      // allocate output buffer
+      // XXX: API change will be done
+      buffer_size = 200000;
+      buffer = new uint8_t[buffer_size];
+  }
+
+  // allocate the encoded raw picture
+  this->allocPicture();
+  if(!picture)
+    PRINTF(0)("Could not allocate picture\n");
+}
+
+
+void Recorder::allocPicture()
+{
+  picture = avcodec_alloc_frame();
+  if(!picture)
+  {
+    picture = NULL;
+    return;
+  }
+  size = avpicture_get_size(codec_context->pix_fmt, width, height);
+  picture_buf = new uint8_t[size];
+  if(!picture_buf)
+  {
+      av_free(picture);
+      return;
+  }
+  avpicture_fill((AVPicture *)picture, picture_buf,
+                  codec_context->pix_fmt, width, height);
+
+
+
+  RGB_frame = avcodec_alloc_frame();
+
+  // Determine required buffer size and allocate buffer
+  size = avpicture_get_size(PIX_FMT_RGB24, width, height);
+  picture_buf = new uint8_t[size];
+
+  // Assign appropriate parts of buffer to image planes in RGB_frame
+  avpicture_fill((AVPicture *)RGB_frame, picture_buf, PIX_FMT_RGB24, width, height);
+}
+
+
+// add a video output stream
+void Recorder::addVideoStream()
+{
+  video_stream = av_new_stream(format_context, 0);
+  if (!video_stream)
+    PRINTF(1)("Could not alloc stream\n");
+
+  codec_context = video_stream->codec;
+  codec_context->codec_id = output_format->video_codec;
+  codec_context->codec_type = CODEC_TYPE_VIDEO;
+
+  // put sample parameters
+  codec_context->bit_rate = 400000;
+  // resolution must be a multiple of two
+  codec_context->width = State::getResX();
+  codec_context->height = State::getResY();
+
+  this->width = codec_context->width;
+  this->height = codec_context->height;
+
+  // time base: this is the fundamental unit of time (in seconds) in terms
+  // of which frame timestamps are represented. for fixed-fps content,
+  // timebase should be 1/framerate and timestamp increments should be
+  // identically 1
+  codec_context->time_base.den = (int)stream_frame_rate;
+  codec_context->time_base.num = 1;
+  codec_context->gop_size = 12;  // emit one intra frame every twelve frames at most
+  codec_context->pix_fmt = PIX_FMT_YUV420P;
+
+  if (codec_context->codec_id == CODEC_ID_MPEG1VIDEO)
+      // needed to avoid using macroblocks in which some coeffs overflow
+      // this doesnt happen with normal video, it just happens here as the
+      // motion of the chroma plane doesnt match the luma plane
+      codec_context->mb_decision=2;
+
+  // some formats want stream headers to be seperate
+  if(!strcmp(format_context->oformat->name, "mp4") ||
+     !strcmp(format_context->oformat->name, "mov") ||
+     !strcmp(format_context->oformat->name, "3gp"))
+    format_context->flags |= CODEC_FLAG_GLOBAL_HEADER;
+}
+
+
+void Recorder::tick(float dt)
+{
+  time += dt;
+  if(time < 1/stream_frame_rate)
+    return;
+  else
+    time = 0;
+
+  // compute current video time
+  if (video_stream)
+      video_pts = (double)video_stream->pts.val * video_stream->time_base.num / video_stream->time_base.den;
+  else
+      video_pts = 0.0;
+
+  if (!video_stream || video_pts >= stream_duration)
+  {
+    this->toList(OM_DEAD);
+    this->closeVideo();
+  }
+  else
+    // write video frame
+    this->writeVideoFrame();
+}
+
+void Recorder::writeVideoFrame()
+{
+  int out_size, err;
+
+  codec_context = video_stream->codec;
+
+  if(frame_count >= stream_nb_frames)
+  {
+    /* no more frame to compress. The codec has a latency of a few
+        frames if using B frames, so we get the last frames by
+        passing the same picture again */
+  }
+  else
+    this->fillYuvImage();
+
+
+  if(format_context->oformat->flags & AVFMT_RAWPICTURE)
+  {
+    // raw video case. The API will change slightly in the near
+    // futur for that
+    av_init_packet(&packet);
+
+    packet.flags |= PKT_FLAG_KEY;
+    packet.stream_index= video_stream->index;
+    packet.data= (uint8_t *)picture;
+    packet.size= sizeof(AVPicture);
+
+    err = av_write_frame(format_context, &packet);
+  }
+  else
+  {
+    // encode the image
+    out_size = avcodec_encode_video(codec_context, buffer, buffer_size, picture);
+    // if zero size, it means the image was buffered
+    if (out_size > 0)
+    {
+      av_init_packet(&packet);
+
+      packet.pts= av_rescale_q(codec_context->coded_frame->pts, codec_context->time_base, video_stream->time_base);
+      if(codec_context->coded_frame->key_frame)
+        packet.flags |= PKT_FLAG_KEY;
+      packet.stream_index = video_stream->index;
+      packet.data= buffer;
+      packet.size= out_size;
+
+      // write the compressed frame in the media file
+      err = av_write_frame(format_context, &packet);
+    }
+    else
+      err = 0;
+  }
+
+  if(err != 0)
+    PRINTF(1)("Error while writing video frame\n");
+
+  frame_count++;
+}
+
+
+void Recorder::fillYuvImage()
+{
+  unsigned char *outputImage = 0;
+
+  // Allocate the neccessary memory.
+  outputImage = (unsigned char*)malloc(width * height * 3);
+
+  // Clear the variable.
+  memset(outputImage, 0, width * height * 3);
+
+  // You use the glReadPixels() to read every pixel on the screen
+  // that you specify.  You must use one less than each size.
+  glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, outputImage);
+
+  int i = 0;
+  for(int y=height-1;y>=0;y--)
+  {
+    for(int x=0;x<width*3;x++)
+    {
+      RGB_frame->data[0][y*width*3+x] = outputImage[i];
+      i++;
+    }
+  }
+
+
+  img_convert((AVPicture*)picture, PIX_FMT_YUV420P, (AVPicture*)RGB_frame,
+              PIX_FMT_RGB24, width, height);
+
+  // Clear the allocated memory.
+  free(outputImage);
+}
+
+
+void Recorder::draw() const
+{
+}
Index: /branches/cleanup/src/world_entities/tools/recorder.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/recorder.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/recorder.h	(revision 10591)
@@ -0,0 +1,73 @@
+/*!
+ * @file recorder.h
+ *
+ */
+
+#ifndef _RECORDER_H
+#define _RECORDER_H
+
+#include "sdlincl.h"
+
+#ifdef HAVE_AVFORMAT_H
+  #include <avformat.h>
+#else
+  #include <ffmpeg/avformat.h>
+#endif
+
+#include "glincl.h"
+#include "world_entity.h"
+
+class Recorder : public WorldEntity
+{
+  ObjectListDeclaration(Recorder);
+  public:
+    Recorder (const TiXmlElement* root = NULL);
+    virtual ~Recorder ();
+
+    virtual void draw () const;
+    virtual void tick (float dt);
+
+    virtual void loadParams(const TiXmlElement* root);
+
+  private:
+    void initVideo(const std::string& filename);
+    void addVideoStream();
+    void openVideo();
+    void closeVideo();
+    void allocPicture();
+    void writeVideoFrame();
+    void fillYuvImage();
+
+    void setStreamDuration(float duration);
+    void setFPS(float fps);
+
+
+  private:
+    AVFrame*            picture;
+    uint8_t*            buffer;
+    int                 frame_count;
+    int                 buffer_size;
+
+    AVOutputFormat*     output_format;
+    AVFormatContext*    format_context;
+    AVCodecContext*     codec_context;
+    AVCodec*            codec;
+    AVStream*           video_stream;
+    AVPacket            packet;
+    double              video_pts;
+
+    uint8_t*            picture_buf;
+    int                 size;
+
+    int                 height;
+    int                 width;
+    float               time;
+
+    float               stream_duration;
+    float               stream_frame_rate;
+    int                 stream_nb_frames;
+
+    AVFrame*            RGB_frame;
+};
+
+#endif /* _RECORDER_H */
Index: /branches/cleanup/src/world_entities/tools/script_trigger.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/script_trigger.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/script_trigger.cc	(revision 10591)
@@ -0,0 +1,245 @@
+/*
+   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: Silvan Nellen
+   co-programmer: ...
+*/
+
+
+#include "script_trigger.h"
+#include "script.h"
+
+#include "state.h"
+#include "debug.h"
+ObjectListDefinition(ScriptTrigger);
+
+CREATE_SCRIPTABLE_CLASS(ScriptTrigger,
+            // Coordinates
+			addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
+			    ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
+			    ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
+			    ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
+            //Properties
+			    ->addMethod("setName", Executor1<BaseObject, lua_State*, const std::string&>(&BaseObject::setName))
+			    ->addMethod("setTarget", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setTarget))
+			    ->addMethod("setTriggerParent", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setTriggerParent))
+			    ->addMethod("setTriggerRemains", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setTriggerRemains))
+			    ->addMethod("setActiveOnCreation", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setActiveOnCreation))
+			    ->addMethod("setInvert", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setInvert))
+			    ->addMethod("setRadius", Executor1<ScriptTrigger, lua_State*, float>(&ScriptTrigger::setRadius))
+			    ->addMethod("setScript", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setScript))
+			    ->addMethod("setFunction", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setFunction))
+			    ->addMethod("setDebugDraw", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setDebugDraw))
+			    ->addMethod("setAddToScript", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setAddToScript))
+             );
+
+
+/**
+ * Constructs a new ScriptTrigger.
+ * @param root the xml element to load the parameters from.
+ *
+ */
+ScriptTrigger::ScriptTrigger(const TiXmlElement* root)
+{
+  this->registerObject(this, ScriptTrigger::_objectList);
+  this->toList(OM_COMMON);
+
+  radius = 10;
+  returnCount = 1;
+  scriptFinished = false;
+  doDebugDraw = false;
+  invert = false;
+  scriptCalled = false;
+  scriptIsOk = false;
+  triggerRemains = true;
+  addToScript = false;
+  this->activeOnCreation = false;
+  target = NULL;
+
+  if(root != NULL)
+  {
+
+    loadParams(root);
+
+    if(addToScript && scriptIsOk)
+    {
+      script->addObject( "ScriptTrigger", this->getName());
+    }
+
+  }
+
+}
+
+/**
+ * Deletes the ScriptTrigger.
+ *
+ */
+ScriptTrigger::~ScriptTrigger()
+{
+
+}
+
+/**
+ * Reads the values from the tml element and sets them.
+ * @param root the xml element to load the parameters from.
+ *
+ */
+void ScriptTrigger::loadParams(const TiXmlElement* root)
+{
+
+  WorldEntity ::loadParams(root);
+
+  LoadParam(root, "file", this, ScriptTrigger, setScript)
+      .describe("the fileName of the script, that should be triggered by this script trigger")
+      .defaultValues("");
+  LoadParam(root, "function", this, ScriptTrigger, setFunction)
+      .describe("the function of the script, that should be triggered by this script trigger")
+      .defaultValues("");
+  LoadParam(root, "abs-coor", this, ScriptTrigger, setAbsCoor)
+      .describe("where this script trigger should be located")
+      .defaultValues("");
+  LoadParam(root, "radius", this, ScriptTrigger, setRadius)
+      .describe("the fileName of the script, that should be triggered by this script trigger")
+      .defaultValues(0);
+  LoadParam(root, "delay", this, ScriptTrigger, setDelay)
+      .describe("the delay after which the funtion sould be triggered")
+      .defaultValues(0);
+  LoadParam(root, "worldentity", this, ScriptTrigger, setTarget)
+      .describe("The name of the target as it is in the *.oxw file")
+      .defaultValues("");
+  LoadParam(root, "triggerparent", this, ScriptTrigger, setTriggerParent)
+      .describe("The name of the parent as it is in the *.oxw file")
+      .defaultValues("");
+  LoadParam(root, "invert", this, ScriptTrigger, setInvert)
+      .describe("")
+      .defaultValues(false);
+  LoadParam(root, "triggerRemains", this, ScriptTrigger, setTriggerRemains)
+      .describe("")
+      .defaultValues(true);
+  LoadParam(root, "debugdraw", this, ScriptTrigger, setDebugDraw)
+      .describe("")
+      .defaultValues(false);
+  LoadParam(root, "addtoscript", this, ScriptTrigger, setAddToScript)
+      .describe("True if this scripttrigger should be aviable in the script")
+      .defaultValues(false);
+}
+
+
+/**
+ * Sets the target(a world entity) of the ScriptTrigger. If the distance between the target and this trigger is smaller than the radius, the script gets triggered.
+ * @param target The worldentity that the script supervises.
+ */
+void ScriptTrigger::setTarget(const std::string& target)
+{
+
+  WorldEntity* targetEntity = WorldEntity::objectList().getObject(target);
+  if (targetEntity != NULL)
+  {
+    this->setTarget(targetEntity);
+  }
+  else
+  {
+    PRINTF(2)("ERROR SCRTIPTTRIGGER : Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassCName(), this->getCName());
+  }
+}
+
+/**
+ * Sets the parent of the trigger.
+ * @param parent The parrent.
+ */
+void ScriptTrigger::setTriggerParent(const std::string& parent)
+{
+  WorldEntity* parentEntity = WorldEntity::objectList().getObject(parent);
+
+  if (parentEntity != NULL)
+  {
+    this->setParent(parentEntity);
+    this->setParentMode(PNODE_MOVEMENT);
+  }
+  else
+  {
+    PRINTF(2)("ERROR SCRTIPTTRIGGER : Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassCName(), this->getCName());
+  }
+}
+
+void ScriptTrigger::tick(float timestep)
+{
+  if(scriptFinished) return;
+
+  if(activeOnCreation)
+   {
+     executeAction(timestep);
+     return;
+   }
+
+ if(triggerRemains && scriptCalled)
+  {
+    executeAction(timestep);
+    return;
+  }
+
+  if( this->target != NULL)
+  {
+    if( !invert && this->distance(target) < radius)
+    {
+    //printf("Distance is %f \n", this->distance(target));
+    executeAction(timestep);
+    scriptCalled = true;
+    return;
+
+    }
+    else if( invert && this->distance(target) > radius)
+    {
+      executeAction(timestep);
+      scriptCalled = true;
+      return;
+    }
+  }
+}
+
+
+void ScriptTrigger::executeAction(float timestep)
+{
+  if(scriptIsOk)
+  {
+       //testScriptingFramework();
+    if(!(script->selectFunction(this->functionName,returnCount)) )
+      PRINT(1)("ERROR SCRTIPTTRIGGER : Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
+
+    script->pushParam( timestep, this->functionName);
+
+    if( !(script->executeFunction()) )
+      PRINT(1)("ERROR SCRTIPTTRIGGER : Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
+
+    scriptFinished = script->getReturnedBool();
+  }
+  else
+  printf("ERROR SCRTIPTTRIGGER : Script could not be executed !\n");
+
+
+}
+
+
+void ScriptTrigger::setScript(const std::string& file)
+{
+  ScriptManager* scriptManager = State::getScriptManager();
+  if (scriptManager != NULL)
+  {
+
+    script = scriptManager->getScriptByFile(file);
+    if(script != NULL)
+    {
+      scriptIsOk = true;
+    }
+    else
+    printf("ERROR SCRTIPTTRIGGER : Could not find the wrapperobject of %s , the script won't be executed ! \n", file.c_str());
+  }
+}
Index: /branches/cleanup/src/world_entities/tools/script_trigger.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/script_trigger.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/script_trigger.h	(revision 10591)
@@ -0,0 +1,71 @@
+/*!
+ * @file scrip_trigger.h
+ *  triggeres a script
+ */
+
+#ifndef _SCRIPT_TRIGGER_H
+#define _SCRIPT_TRIGGER_H
+
+#include <string>
+
+#include "world_entity.h"
+#include "loading/load_param.h"
+#include "vector.h"
+#include "script_manager.h"
+#include "script.h"
+#include "script_class.h"
+
+class ScriptTrigger : public WorldEntity
+{
+  ObjectListDeclaration(ScriptTrigger);
+  public:
+    ScriptTrigger(const TiXmlElement* root = NULL);
+    ~ScriptTrigger();
+
+    ///LOADING
+    virtual void loadParams(const TiXmlElement* root);
+
+
+    /// DO WORK
+    virtual void tick(float timestep);
+    virtual void executeAction(float timestep);
+
+    /// SET MEMBER
+    void setTarget(const std::string& targetName);
+    void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target; }
+    void setTriggerParent(const std::string& name);
+    void setTriggerRemains(const bool lasts) { this->triggerRemains = lasts; }
+    void setActiveOnCreation(const bool avtive) { this->activeOnCreation = avtive; }
+    void setInvert(const bool inv) { this->invert = invert; }
+    void setDelay(float delay) { this->delay = delay; };
+    void setRadius(const float radius) { if(radius>0) this->radius = radius; }
+    void setScript(const std::string& file);
+    void setFunction(const std::string& function){ this->functionName = function;}
+    void setDebugDraw(const bool draw) { this->doDebugDraw = draw; }
+    void setAddToScript(const bool add) { this->addToScript = add; }
+
+    ///DRAWING
+    void draw()const{if(doDebugDraw)this->debugDraw();};
+
+  private:
+
+    WorldEntity* target;
+    bool         triggerRemains;
+    bool         activeOnCreation;
+    bool         invert;
+    float        radius;
+    float        delay;
+    Script*      script;
+    std::string  functionName;
+    bool         doDebugDraw;
+    bool         addToScript;
+    //for internal use
+    bool         scriptCalled;
+    bool         scriptIsOk;
+    bool         scriptFinished;
+    int          returnCount;        //TODO: set return count correctly
+
+};
+
+
+#endif
Index: /branches/cleanup/src/world_entities/tools/scrolling_screen.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/scrolling_screen.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/scrolling_screen.cc	(revision 10591)
@@ -0,0 +1,288 @@
+/*
+   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: Filip Gospodinov
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "scrolling_screen.h"
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+#include "debug.h"
+#include "material.h"
+#include "state.h"
+#include "cameraman.h"
+#include "camera.h"
+
+#include "script_class.h"
+
+
+ObjectListDefinition(ScrollingScreen);
+CREATE_FACTORY(ScrollingScreen);
+
+CREATE_SCRIPTABLE_CLASS(ScrollingScreen,
+                        addMethod("start", Executor0<ScrollingScreen, lua_State*>(&ScrollingScreen::start))
+                       );
+
+
+/**
+ *
+ */
+ScrollingScreen::ScrollingScreen()
+{
+  this->init();
+}
+
+
+/**
+ *
+ */
+ScrollingScreen::ScrollingScreen(const TiXmlElement* root)
+{
+  this->init();
+
+  if( root != NULL)
+    this->loadParams(root);
+}
+
+
+/**
+ *
+ */
+ScrollingScreen::~ScrollingScreen()
+{}
+
+void ScrollingScreen::start()
+{
+  this->bRun = true;
+}
+
+/**
+ *
+ */
+void ScrollingScreen::init()
+{
+  this->registerObject(this, ScrollingScreen::_objectList);
+  this->toList(OM_COMMON);
+
+  this->material = new Material();
+  this->material->setDiffuse(1,1,1);
+  this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+  this->isTransparent = false;
+  this->transparency = 1.0;
+  this->offset = 0.0;
+
+  this->xSize = 0.;
+  this->ySize = 0.;
+  this->mode = SCSC_VIEW;
+  this->bRun = false;
+}
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void ScrollingScreen::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "setSpeed", this, ScrollingScreen, setSpeed);
+
+  LoadParam(root, "setHeight", this, ScrollingScreen, setViewHeight);
+
+  LoadParam(root, "setSizeX", this, ScrollingScreen, setSizeX);
+  LoadParam(root, "setSizeY", this, ScrollingScreen, setSizeY);
+
+  LoadParam(root, "texture", this, ScrollingScreen, setTexture);
+}
+
+
+
+
+/**
+ * sets the texture
+ * @param texture name of tex
+ */
+void ScrollingScreen::setTexture(const std::string& texture)
+{
+  this->material->setDiffuseMap(texture);
+
+  Texture t = this->material->diffuseTexture();
+  this->ratio = t.getWidth() / t.getHeight();
+}
+
+
+
+
+void ScrollingScreen::draw() const
+{
+
+  if( this->offset - this->ratio > 1.|| this->offset < -1. || !this->bRun)
+    return;
+
+  if( this->mode == SCSC_FULL)
+    this->drawFull();
+  else
+    this->drawView();
+}
+
+void ScrollingScreen::drawFull() const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+  glDisable(GL_FOG);
+  glEnable(GL_BLEND);
+
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+  this->material->select();
+
+
+  glBegin(GL_QUADS);
+
+  // unten links
+  glTexCoord2f(0., 1.);
+  glVertex3f(0., -this->xSize*0.5, -this->ySize*0.5);
+
+  // unten rechts
+  glTexCoord2f(1., 1.);
+  glVertex3f(0., -this->xSize*0.5, this->ySize*0.5);
+
+  // oben rechts
+  glTexCoord2f(1., 0.);
+  glVertex3f(0., this->xSize*0.5, this->ySize*0.5);
+
+  // oben links
+  glTexCoord2f(0., 0.);
+  glVertex3f(0., this->xSize*0.5, -this->ySize*0.5);
+
+  glEnd();
+
+  glPopAttrib();
+  glPopMatrix();
+}
+
+void ScrollingScreen::drawView() const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+  glDisable(GL_FOG);
+  glEnable(GL_BLEND);
+
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+  this->material->select();
+
+  float resize = (1. - (this->viewHeight + this->offset));
+
+  float x,y;
+  if( this->xSize != 0.)
+  {
+    x = this->xSize;
+    y = x * this->ratio;
+  }
+  else
+  {
+    y = this->ySize;
+    x = y * this->ratio;
+  }
+
+  float ratShift = 0.;
+  float borderTex = this->offset + ratio;
+  // we are above/below
+  if( 1 - (offset + ratio) < 0)
+  {
+    borderTex = 1.0;
+    ratShift = 1. - (1.-offset)/ratio;
+  }
+
+  glBegin(GL_QUADS);
+  // unten links
+  glTexCoord2f(0., borderTex);
+  glVertex3f(0., -(x*0.5 - x*ratShift), -y*0.5);
+
+  // unten rechts
+  glTexCoord2f(1., borderTex);
+  glVertex3f(0., -(x*0.5 - x*ratShift), y*0.5);
+
+  // oben rechts
+  glTexCoord2f(1., this->offset);
+  glVertex3f(0., x*0.5, y*0.5);
+
+  // oben links
+  glTexCoord2f(0., this->offset);
+  glVertex3f(0., x*0.5, -y*0.5);
+
+  glEnd();
+
+  glPopAttrib();
+  glPopMatrix();
+}
+
+
+/**
+ *
+ */
+void ScrollingScreen::tick (float time)
+{
+
+  if( !this->bRun)
+    return;
+
+  CameraMan* cm = State::getCameraman();
+  const Camera* cam = cm->getCurrentCam();
+  PNode* tar = cam->getTargetNode();
+
+  Vector dir = tar->getAbsCoor() - cam->getAbsCoor();
+  dir = dir.getNormalized();
+
+  float offset = 6.;
+
+  this->setAbsCoor( cam->getAbsCoor() + dir * offset);
+
+
+  Vector ddir = dir.cross( cam->getAbsDirV());
+  Quaternion q(ddir, cam->getAbsDirY());
+  this->setAbsDir( q);
+
+  // scroll the texture
+  this->offset += time * this->scrollingSpeed;
+  //     if( this->offset - this->ratio > 1.|| this->offset < -1.)
+  //       this->offset = 0.;
+
+}
+
+void ScrollingScreen::fadeIn(float speed)
+{
+}
+
+void ScrollingScreen::fadeOut(float speed)
+{
+}
Index: /branches/cleanup/src/world_entities/tools/scrolling_screen.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/scrolling_screen.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/scrolling_screen.h	(revision 10591)
@@ -0,0 +1,68 @@
+#ifndef _SCROLLING_SCREEN_H
+#define _SCROLLING_SCREEN_H
+
+#include "world_entity.h"
+
+
+class TiXmlElement;
+class Material;
+
+class ScrollingScreen : public WorldEntity
+{
+  ObjectListDeclaration(ScrollingScreen);
+
+
+
+public:
+  ScrollingScreen();
+  ScrollingScreen(const TiXmlElement* root);
+  virtual ~ScrollingScreen();
+
+  typedef enum ScScMode
+  {
+     SCSC_FULL  = 0,
+     SCSC_VIEW
+  };
+
+  void init();
+  virtual void loadParams(const TiXmlElement* root);
+
+  void start();
+
+  void fadeIn(float speed);
+  void fadeOut(float speed);
+
+  void setTexture(const std::string& texture);
+
+  void setSpeed(float speed) { this->scrollingSpeed = speed; }
+  void setViewHeight(float height) { this->viewHeight = height; }
+  void setSizeY(float ySize) { this->ySize = ySize; }
+  void setSizeX(float xSize) { this->xSize = xSize; }
+
+  virtual void tick (float time);
+
+  virtual void draw() const;
+  void drawFull() const;
+  void drawView() const;
+
+
+private:
+  Material*       material;
+  bool            isTransparent;
+  float           transparency;
+  float           fadeingSpeed;
+
+  float           scrollingSpeed;
+  float           viewHeight;
+  float           offset;
+  float           ratio;
+
+  float           xSize;
+  float           ySize;
+
+  int             mode;
+
+  bool            bRun;
+};
+
+#endif /* _SCROLLING_SCREEN_H */
Index: /branches/cleanup/src/world_entities/tools/sound_entity.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/sound_entity.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/sound_entity.cc	(revision 10591)
@@ -0,0 +1,106 @@
+/*
+   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
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+
+#include "sound_entity.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "material.h"
+
+#include "sound/resource_sound_buffer.h"
+
+
+
+
+
+
+ObjectListDefinition(SoundEntity);
+CREATE_FACTORY(SoundEntity);
+
+/**
+ *  standard constructor
+*/
+SoundEntity::SoundEntity (const TiXmlElement* root)
+{
+  this->registerObject(this, SoundEntity::_objectList);
+
+  this->toList(OM_COMMON);
+
+  this->soundSource.setSourceNode(this);
+
+  this->bInit = false;
+
+  if( root != NULL)
+    this->loadParams(root);
+
+}
+
+
+/**
+ *  standard deconstructor
+*/
+SoundEntity::~SoundEntity ()
+{
+}
+
+/**
+ * loading stuff
+ * @param root xml element
+ */
+void SoundEntity::loadParams(const TiXmlElement* root)
+{
+  LoadParam(root, "soundfile", this, SoundEntity, setSoundFile)
+      .describe("Sets the file of the sound source");
+
+  LoadParam(root, "frequency", this, SoundEntity, setSoundFile)
+      .describe("Sets the file of the sound source");
+}
+
+
+/**
+ * sets the sound file
+ * @param fileName name of the sound source
+ */
+void SoundEntity::setSoundFile(const std::string& fileName)
+{
+  this->soundBuffer = OrxSound::ResourceSoundBuffer(fileName);
+  this->bInit = true;
+}
+
+
+void SoundEntity::activate()
+{
+  this->soundSource.play();
+}
+
+
+void SoundEntity::deactivate()
+{
+
+}
+
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param time since last tick
+*/
+void SoundEntity::tick (float dt)
+{
+
+}
+
+
+
Index: /branches/cleanup/src/world_entities/tools/sound_entity.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/sound_entity.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/sound_entity.h	(revision 10591)
@@ -0,0 +1,44 @@
+/*!
+ * @file lightning_bolt.h
+ * @brief a SoundEntity Projectile
+ *  Der Effekt soll folgenderma�n funktionieren:
+ * -> Ein Partikel mit einer Blitz-Textur soll sehr schnell erscheinen,
+ * -> w�rend er an Intensit� zunimmt soll die Beleuchtung der gerenderten Szene entsprechend zunehmen.
+ * -> Je mehr Blitze zum gleichen Zeitpunkt sichtbar sind, desto heller soll die Beleuchtung werden, das hei� die Helligkeitszunahme pro Blitz soll Additiv sein.
+ * -> Ein Partikel soll ebenfalls sehr schnell wieder verblassen, dabei soll die Beleuchtung entsprechend der vorhergehenden Zunahme wieder abnehmen (Additiv)
+ */
+
+#ifndef _SOUND_ENTITY_H
+#define _SOUND_ENTITY_H
+
+#include "world_entity.h"
+
+#include "sound_buffer.h"
+#include "sound_source.h"
+
+class Material;
+
+class SoundEntity : public WorldEntity
+{
+  ObjectListDeclaration(SoundEntity);
+  public:
+    SoundEntity(const TiXmlElement* root = NULL);
+    virtual ~SoundEntity ();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    void setSoundFile(const std::string& fileName);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float time);
+
+  private:
+
+    bool                     bInit;
+    OrxSound::SoundSource    soundSource;
+    OrxSound::SoundBuffer    soundBuffer;
+};
+
+#endif /* _SOUND_ENTITY_H */
Index: /branches/cleanup/src/world_entities/tools/spawning_point.cc
===================================================================
--- /branches/cleanup/src/world_entities/tools/spawning_point.cc	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/spawning_point.cc	(revision 10591)
@@ -0,0 +1,276 @@
+
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer:
+*/
+
+#include "spawning_point.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+
+#include "world_entity.h"
+
+#include "compiler.h"
+
+#include "state.h"
+#include "game_rules.h"
+
+#include "shared_network_data.h"
+
+
+/// TODO REMOVE converter.h
+#include "converter.h"
+
+
+ObjectListDefinition(SpawningPoint);
+CREATE_FACTORY( SpawningPoint);
+/**
+ *  constructor
+ */
+SpawningPoint::SpawningPoint( const TiXmlElement * root )
+{
+  this->setAbsCoor( 0, 0, 0 );
+
+  this->init();
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+void SpawningPoint::init()
+{
+  this->registerObject(this, SpawningPoint::_objectList);
+  PRINTF(0)("Created SpawningPoint\n");
+
+  this->teamId = -1;
+  this->localTimer = 0.0f;
+
+  this->toList( OM_DEAD_TICK );
+
+  MessageManager::getInstance()->registerMessageHandler( MSGID_RESPAWN, respawnMessageHandler, NULL );
+
+  this->setSynchronized( true );
+}
+
+
+/**
+ *  deconstructor
+ */
+SpawningPoint::~SpawningPoint ()
+{}
+
+
+/**
+ * loads the WorldEntity Specific Parameters.
+ * @param root: the XML-Element to load the Data From
+ */
+void SpawningPoint::loadParams(const TiXmlElement* root)
+{
+  /* let the world entity its stuff first */
+  WorldEntity::loadParams(root);
+
+  /* load teamId */
+  LoadParam(root, "teamId", this, SpawningPoint, setTeamId)
+  .describe("sets teamId");
+}
+
+
+
+/**
+ * pushes a world entity to the spawning queue
+ *  @param entity WorldEntity to be added
+ */
+void SpawningPoint::pushEntity(Playable* entity, float delay)
+{
+  QueueEntry qe;
+  qe.entity = entity;
+  qe.respawnTime = this->localTimer + delay;
+
+  queue.push_back( qe );
+}
+
+
+/**
+ *  spawn the entity
+ */
+void SpawningPoint::spawn(Playable* entity)
+{
+  bool found = false;
+
+  for (ObjectList<Playable>::const_iterator it = Playable::objectList().begin();
+       it != Playable::objectList().end();
+       ++it)
+  {
+    if ( *it == entity )
+    {
+      found = true;
+      break;
+    }
+  }
+
+  if ( !found )
+    return;
+
+  PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClassCName());
+
+
+  entity->setAbsCoor( this->getAbsCoor() );
+  entity->setAbsDir( this->getAbsDir() );
+
+  //TODO set camera (not smooth)
+
+  if ( State::getGameRules() )
+  {
+    (State::getGameRules())->registerSpawn( entity );
+  }
+
+  entity->respawn();
+}
+
+
+/**
+ *  this method is called every frame
+ * @param time: the time in seconds that has passed since the last tick
+ *
+ * Handle all stuff that should update with time inside this method (movement, animation, etc.)
+ */
+void SpawningPoint::tick(float dt)
+{
+  this->localTimer += dt;
+  std::list<QueueEntry>::iterator it = this->queue.begin();
+  for( ; it != this->queue.end(); )
+  {
+    //PRINTF(0)("%f <= %f\n", it->respawnTime, this->localTimer);
+    if( it->respawnTime <= this->localTimer)
+    {
+      //spawn the player
+      this->spawn(it->entity);
+
+      bool found = false;
+
+      for (ObjectList<Playable>::const_iterator it2 = Playable::objectList().begin();
+           it2 != Playable::objectList().end();
+           ++it2)
+      {
+        if ( *it2 == it->entity )
+        {
+          found = true;
+          break;
+        }
+      }
+
+      if ( found && SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)
+        this->sendRespawnMessage( it->entity->getUniqueID() );
+
+      std::list<QueueEntry>::iterator delit = it;
+      it++;
+
+      queue.erase( delit );
+
+      continue;
+    }
+
+    it++;
+  }
+
+}
+
+
+/**
+ *  the entity is drawn onto the screen with this function
+ *
+ * This is a central function of an entity: call it to let the entity painted to the screen.
+ * Just override this function with whatever you want to be drawn.
+ */
+void SpawningPoint::draw() const
+{}
+
+void SpawningPoint::sendRespawnMessage( int uniqueId )
+{
+  byte buf[2*INTSIZE];
+
+  assert( Converter::intToByteArray( this->getUniqueID(), buf, INTSIZE ) == INTSIZE );
+  assert( Converter::intToByteArray( uniqueId, buf + INTSIZE, INTSIZE ) == INTSIZE );
+
+  MessageManager::getInstance()->sendMessage( MSGID_RESPAWN, buf, 2*INTSIZE, RT_ALL_BUT_ME, NET_UNASSIGNED, MP_HIGHBANDWIDTH );
+}
+
+/**
+ * message handler for respawn message
+ */
+bool SpawningPoint::respawnMessageHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  )
+{
+  if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)
+  {
+    PRINTF(2)("server received spawn message!\n");
+    return true;
+  }
+
+  int spUniqueId;
+  int uniqueId;
+
+  if ( dataLength != 2*INTSIZE )
+  {
+    PRINTF(2)("spawn message has wrong size: %d\n", dataLength );
+    return true;
+  }
+
+  assert( Converter::byteArrayToInt( data, &spUniqueId ) == INTSIZE );
+  assert( Converter::byteArrayToInt( data+INTSIZE, &uniqueId ) == INTSIZE );
+
+  PRINTF(0)("SPAWNMESSAGE %d\n", uniqueId);
+
+  SpawningPoint * sp = NULL;
+  Playable      * playable = NULL;
+
+  for (ObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin();
+       it != SpawningPoint::objectList().end();
+       ++it)
+  {
+    PRINTF(0)("%d:%d\n", (*it)->getUniqueID(), spUniqueId);
+    if ( (*it)->getUniqueID() == spUniqueId )
+    {
+      sp = (*it);
+      break;
+    }
+  }
+
+  if ( !sp )
+  {
+    PRINTF(0)("could not find spawning point\n");
+    return false;
+  }
+
+  for (ObjectList<Playable>::const_iterator it = Playable::objectList().begin();
+       it != Playable::objectList().end();
+       ++it)
+  {
+    if ( (*it)->getUniqueID() == uniqueId )
+    {
+      playable = (*it);
+      break;
+    }
+  }
+
+  if ( !playable )
+  {
+    PRINTF(0)("could not find playable\n");
+    return false;
+  }
+
+  sp->spawn( playable );
+
+  return true;
+}
+
Index: /branches/cleanup/src/world_entities/tools/spawning_point.h
===================================================================
--- /branches/cleanup/src/world_entities/tools/spawning_point.h	(revision 10591)
+++ /branches/cleanup/src/world_entities/tools/spawning_point.h	(revision 10591)
@@ -0,0 +1,82 @@
+/*!
+ * @file spawning_point.h
+ *  Definition of a spawning point within the game, used for network game
+ */
+
+
+#ifndef _SPAWNING_POINT
+#define _SPAWNING_POINT
+
+#include "playable.h"
+
+#include "message_manager.h"
+
+#include <list>
+
+class World;
+class TiXmlElement;
+
+struct QueueEntry
+{
+  float respawnTime;
+  Playable * entity;
+};
+
+//!< used to indicate what type of objects are spawned by this spawning point
+typedef enum SpawningPointMode
+{
+  SPT_ALL_AT_ONCE = 0,                               //!< at this spawning points there will be players spawned (typicaly in MP games)
+  SPT_ONE_AFTER_OTHER,                               //!< at this spawning points there will be NPS spawnded
+
+  SPT_NUMBER
+};
+
+
+/**
+ * The spawning point for WorldEntities (and only WorldEntities)
+ *
+ * There are commonly two different spawning modes:
+ *
+ *  1) Just spawn whatever is in the queue with a given frequency (if delay = 0 => immediate spawn)
+ *  2) Spawn everything in the queue together with the given frequency
+ */
+class SpawningPoint : public WorldEntity {
+  ObjectListDeclaration(SpawningPoint);
+  public:
+    SpawningPoint(const TiXmlElement* root = NULL);
+    virtual ~SpawningPoint ();
+    void init();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    inline int getTeamId() const { return this->teamId; }
+    inline void setTeamId( int teamId ) { this->teamId = teamId; }
+
+    void pushEntity(Playable* entity, float delay = 0);
+
+    /** activates the spawning point */
+    inline void activate() { this->bSpawning = true; }
+    /** deactivates the spawning point */
+    inline void deactivate() { this->bSpawning = false; }
+    inline bool isActive() const { return this->bSpawning; }
+
+
+    virtual void tick(float dt);
+    virtual void draw() const;
+
+
+  private:
+    void spawn(Playable* entity);
+
+    void sendRespawnMessage( int uniqueId );
+    static bool respawnMessageHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
+
+
+  private:
+    float                           localTimer;                     //!< the local timer
+    int                             teamId;                         //!< only spawn players of this team
+    std::list<QueueEntry>           queue;                          //!< queue of waiting WorldEntities to be spawned
+    bool                            bSpawning;                      //!< flag to indicate if this spawning point is active or not
+};
+
+#endif /* _SPAWNING_POINT */
Index: /branches/cleanup/src/world_entities/weather_effects/cloud_effect.h
===================================================================
--- /branches/cleanup/src/world_entities/weather_effects/cloud_effect.h	(revision 10590)
+++ /branches/cleanup/src/world_entities/weather_effects/cloud_effect.h	(revision 10591)
@@ -12,5 +12,5 @@
 #include "sound_source.h"
 
-#include "skydome.h"
+#include "environments/skydome.h"
 #include "material.h"
 #include "shader.h"
Index: /branches/cleanup/src/world_entities/weather_effects/lense_flare.cc
===================================================================
--- /branches/cleanup/src/world_entities/weather_effects/lense_flare.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/weather_effects/lense_flare.cc	(revision 10591)
@@ -32,5 +32,5 @@
 
 #include "light.h"
-#include "camera.h"
+#include "tools/camera.h"
 
 
Index: /branches/cleanup/src/world_entities/world_entity.cc
===================================================================
--- /branches/cleanup/src/world_entities/world_entity.cc	(revision 10590)
+++ /branches/cleanup/src/world_entities/world_entity.cc	(revision 10591)
@@ -27,5 +27,5 @@
 
 #include "oif/object_information_file.h"
-#include "mount_point.h"
+#include "tools/mount_point.h"
 
 #include "aabb_tree_node.h"
@@ -41,5 +41,5 @@
 
 #include "state.h"
-#include "camera.h"
+#include "tools/camera.h"
 
 #include "collision_filter.h"
