Index: code/branches/input/CMakeLists.txt
===================================================================
--- code/branches/input/CMakeLists.txt	(revision 1623)
+++ code/branches/input/CMakeLists.txt	(revision 1629)
@@ -63,10 +63,8 @@
 #Performs the search and sets the variables
 FIND_PACKAGE(OGRE)
-#FIND_PACKAGE(OIS)
 # FIND_PACKAGE(CEGUI)
 # FIND_PACKAGE(CEGUI_OGRE)
 FIND_PACKAGE(ENet)
 FIND_PACKAGE(Boost REQUIRED thread filesystem)
-#FIND_PACKAGE(Boost REQUIRED filesystem)
 FIND_PACKAGE(OpenAL)
 FIND_PACKAGE(ALUT)
@@ -80,5 +78,4 @@
 LINK_DIRECTORIES(
   ${OGRE_LIB_DIR}
-#  ${OIS_LIB_DIR}
 #  ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR}
   ${ENet_LIBRARY}
@@ -91,5 +88,4 @@
 INCLUDE_DIRECTORIES(
   ${OGRE_INCLUDE_DIR}
-#  ${OIS_INCLUDE_DIR}
 #  ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR}
   ${ENet_INCLUDE_DIR}
Index: code/branches/input/bin/levels/sample.oxw
===================================================================
--- code/branches/input/bin/levels/sample.oxw	(revision 1623)
+++ code/branches/input/bin/levels/sample.oxw	(revision 1629)
@@ -9,5 +9,5 @@
   </audio--> 
 
-<Ambient colourvalue="0.1, 0.1, 0.1" />
+<Ambient colourvalue="1.0, 1.0, 1.0" />
 <Skybox src="Orxonox/Starbox" />
 <SpaceShip camera="true" position="0,0,0" scale="10" yawpitchroll="0,0,0" mesh="assff.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" />
@@ -44,5 +44,5 @@
 for i = 1, 226, 1 
 do ?>
-  <Model position="<?lua print(math.random(-19597, 18732))?>, <?lua print(math.random(-19597, 18732)) ?>, <?lua print(math.random(-19597, 18732)) ?>" scale="<?lua print(math.random( 20, 119)) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" rotationAxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationRate="<?lua print(math.random(16, 44)) ?>" />
+  <Model position="<?lua print(math.random() * 40000 - 20000)?>, <?lua print(math.random() * 40000 - 20000) ?>, <?lua print(math.random() * 40000 - 20000) ?>" scale="<?lua print(math.random() * 250 + 20) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" rotationAxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationRate="<?lua print(math.random() * 30 + 15) ?>" />
 <?lua 
 end
Index: code/branches/input/cmake/FindOIS.cmake
===================================================================
--- code/branches/input/cmake/FindOIS.cmake	(revision 1623)
+++ 	(revision )
@@ -1,56 +1,0 @@
-# Find OIS includes and library
-#
-# This module defines
-#  OIS_INCLUDE_DIR
-#  OIS_LIBRARIES, the libraries to link against to use OIS.
-#  OIS_LIB_DIR, the location of the libraries
-#  OIS_FOUND, If false, do not try to use OIS
-#
-# Created by Matt Williams to find OGRE libraries
-# Copyright © 2007, Matt Williams
-#
-# Modified by Nicolas Schlumberger to find OIS libraries
-# and make it run on the Tardis-Infrastucture of the ETH Zurich
-# Copyright 2007, Nicolas Schlumberger
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-
-IF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
-    SET(OIS_FIND_QUIETLY TRUE) # Already in cache, be silent
-ENDIF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
-
-IF (WIN32) #Windows
-    MESSAGE(STATUS "Looking for OIS")
-    SET(OIS_INCLUDE_DIR ../libs/ogre/Dependencies/include)
-    SET(OIS_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libs/ogre/Samples/Common/bin/Release)
-    SET(OIS_LIBRARIES debug OIS_d optimized OIS)
-ELSE (WIN32) #Unix
-    FIND_PACKAGE(PkgConfig)
-    PKG_SEARCH_MODULE(OIS OIS /usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib/pkgconfig/OIS.pc) # tardis specific hack
-    SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIRS})
-    SET(OIS_LIB_DIR ${OIS_LIBDIR})
-    SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
-ENDIF (WIN32)
-
-#Do some preparation
-SEPARATE_ARGUMENTS(OIS_INCLUDE_DIR)
-SEPARATE_ARGUMENTS(OIS_LIBRARIES)
-
-SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIR} CACHE PATH "")
-SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
-SET(OIS_LIB_DIR ${OIS_LIB_DIR} CACHE PATH "")
-
-IF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
-    SET(OIS_FOUND TRUE)
-ENDIF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
-
-IF (OIS_FOUND)
-    IF (NOT OIS_FIND_QUIETLY)
-        MESSAGE(STATUS "  libraries : ${OIS_LIBRARIES} from ${OIS_LIB_DIR}")
-        MESSAGE(STATUS "  includes  : ${OIS_INCLUDE_DIR}")
-    ENDIF (NOT OIS_FIND_QUIETLY)
-ELSE (OIS_FOUND)
-    IF (OIS_FIND_REQUIRED)
-        MESSAGE(FATAL_ERROR "Could not find OIS")
-    ENDIF (OIS_FIND_REQUIRED)
-ENDIF (OIS_FOUND)
Index: code/branches/input/src/CMakeLists.txt
===================================================================
--- code/branches/input/src/CMakeLists.txt	(revision 1623)
+++ code/branches/input/src/CMakeLists.txt	(revision 1629)
@@ -1,6 +1,6 @@
 INCLUDE_DIRECTORIES(.)
+INCLUDE_DIRECTORIES(..)
 INCLUDE_DIRECTORIES(orxonox)
 INCLUDE_DIRECTORIES(tolua)
-INCLUDE_DIRECTORIES(ois)
 
 ADD_SUBDIRECTORY(cpptcl)
Index: code/branches/input/src/asylum/orxonox/objects/Fighter.cc
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/Fighter.cc	(revision 1623)
+++ code/branches/input/src/asylum/orxonox/objects/Fighter.cc	(revision 1629)
@@ -42,5 +42,5 @@
 #include "GraphicsEngine.h"
 #include "core/InputManager.h"
-#include "particle/ParticleInterface.h"
+#include "tools/ParticleInterface.h"
 #include "weapon/AmmunitionDump.h"
 #include "weapon/BarrelGun.h"
@@ -132,5 +132,4 @@
 #if 0
         w = new particle::ParticleInterface(GraphicsEngine::getSingleton().getSceneManager(),"schuss" + this->getName(),"Orxonox/schuss");
-        w->getParticleSystem()->setParameter("local_space","true");
         w->newEmitter();
 /*
@@ -151,5 +150,4 @@
 
         tt = new ParticleInterface(GraphicsEngine::getSingleton().getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow");
-        tt->getParticleSystem()->setParameter("local_space","true");
         tt->newEmitter();
 /*
Index: code/branches/input/src/asylum/orxonox/objects/weapon/AmmunitionDump.cc
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/AmmunitionDump.cc	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/AmmunitionDump.cc	(revision 1629)
@@ -0,0 +1,127 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "AmmunitionDump.h"
+
+#include "orxonox/Orxonox.h"
+#include "BulletManager.h"
+#include "tinyxml/tinyxml.h"
+#include "core/CoreIncludes.h"
+
+
+namespace orxonox {
+  CreateFactory(AmmunitionDump);
+
+  AmmunitionDump::AmmunitionDump()
+    : numberOfAmmos_(Orxonox::getSingleton()->getBulletMgr()->getNumberOfAmmos()),
+      stock_(new int[numberOfAmmos_]),
+      capacity_(new int[numberOfAmmos_])
+  {
+    RegisterObject(AmmunitionDump);
+    registerAllVariables();
+
+    for (int i = 0; i < numberOfAmmos_; i++)
+    {
+      stock_[i] = 0;
+      capacity_[i] = 0;
+    }
+  }
+
+
+  AmmunitionDump::~AmmunitionDump()
+  {
+    if (stock_)
+      delete stock_;
+    if (capacity_)
+      delete capacity_;
+  }
+
+  void AmmunitionDump::setDumpSize(const std::string &name, int size)
+  {
+    if (size < 0)
+      return;
+    int id = Orxonox::getSingleton()->getBulletMgr()->getAmmunitionID(name);
+    if (id == -1)
+      return;
+    capacity_[id] = size;
+  }
+
+
+  int AmmunitionDump::store(const std::string &name, int quantity)
+  {
+    int id = Orxonox::getSingleton()->getBulletMgr()->getAmmunitionID(name);
+    if (id == -1)
+      return quantity;
+    stock_[id] += quantity;
+    if (stock_[id] > capacity_[id])
+    {
+      quantity = capacity_[id] - stock_[id];
+      stock_[id] = capacity_[id];
+      return quantity;
+    }
+    else
+      return 0;
+  }
+
+
+  int AmmunitionDump::getAmmunition(const std::string &name, int quantity)
+  {
+    int id = Orxonox::getSingleton()->getBulletMgr()->getAmmunitionID(name);
+    if (id == -1)
+      return 0;
+    if (stock_[id] >= quantity)
+      stock_[id] -= quantity;
+    else
+    {
+      quantity = stock_[id];
+      stock_[id] = 0;
+    }
+    return quantity;
+  }
+
+
+  int AmmunitionDump::getStockSize(const std::string &name)
+  {
+    int id = Orxonox::getSingleton()->getBulletMgr()->getAmmunitionID(name);
+    // FIXME changed = to ==, check if correct
+    if (id == -1)
+      return -1;
+    return stock_[id];
+  }
+
+  void AmmunitionDump::registerAllVariables(){
+    registerVar( &numberOfAmmos_, sizeof(int), network::DATA);
+
+    for (int i = 0; i < numberOfAmmos_; i++)
+    {
+      registerVar(&stock_[i], sizeof(int), network::DATA);
+      registerVar(&capacity_[i], sizeof(int), network::DATA);
+    }
+  }
+}
Index: code/branches/input/src/asylum/orxonox/objects/weapon/AmmunitionDump.h
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/AmmunitionDump.h	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/AmmunitionDump.h	(revision 1629)
@@ -0,0 +1,69 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _AmmunitionDump_H__
+#define _AmmunitionDump_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+
+#include <OgrePrerequisites.h>
+
+#include "network/Synchronisable.h"
+#include "core/BaseObject.h"
+
+
+namespace orxonox {
+  class _OrxonoxExport AmmunitionDump : public BaseObject, public network::Synchronisable
+  {
+  public:
+    AmmunitionDump();
+	  ~AmmunitionDump();
+
+    void setDumpSize(const std::string &name, int size);
+
+    int store(const std::string &name, int quantiy);
+
+    int getAmmunition(const std::string &name, int quantity);
+
+    int getStockSize(const std::string &name);
+
+
+  protected:
+    inline bool create() { return Synchronisable::create(); }
+    void registerAllVariables();
+
+    int numberOfAmmos_;
+    int *stock_;
+    int *capacity_;
+  };
+}
+
+#endif /* _AmmunitionDump_H__ */
Index: code/branches/input/src/asylum/orxonox/objects/weapon/BarrelGun.cc
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/BarrelGun.cc	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/BarrelGun.cc	(revision 1629)
@@ -0,0 +1,147 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "BarrelGun.h"
+
+#include <OgreStringConverter.h>
+#include <OgreSceneNode.h>
+#include <OgreEntity.h>
+#include <OgreSceneManager.h>
+
+#include "util/Math.h"
+#include "Bullet.h"
+#include "BulletManager.h"
+#include "AmmunitionDump.h"
+#include "BaseWeapon.h"
+#include "core/CoreIncludes.h"
+
+
+namespace orxonox {
+  CreateFactory(BarrelGun);
+
+  BarrelGun::BarrelGun()
+  {
+    RegisterObject(BarrelGun);
+
+    primaryFirePower_ = 100;
+    secondaryFirePower_ = 500;
+    primaryFiringRate_ = 1.0/7.0;
+    secondaryFiringRate_ = 1.0/2.0;
+    primaryBulletSpeed_ = 800;
+    secondaryBulletSpeed_ = 500;
+    magazineSize_ = 25;
+  }
+
+
+  BarrelGun::~BarrelGun()
+  {
+  }
+
+
+  void BarrelGun::primaryFire()
+  {
+    if (leftAmmo_ < 1)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    Ogre::SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          getNode()->getWorldPosition(),
+          getNode()->getWorldOrientation());
+
+    Ogre::Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+      + Ogre::StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(1, 0, 0))
+          .normalisedCopy() * primaryBulletSpeed_;
+    speed += getVelocity();
+
+	  temp->setScale(Vector3(1, 1, 1) * 1.5);
+    temp->roll(Degree(90));
+
+    Bullet* bullet = new Bullet();
+    bullet->setNode(temp);
+    bullet->attachObject(bulletEntity);
+    bullet->setVelocity(speed);
+	  bulletManager_->addBullet(bullet);
+
+    --leftAmmo_;
+  }
+
+
+  void BarrelGun::primaryFiring(float time)
+  {
+    if (time > primaryFiringRate_)
+    {
+      currentState_ = IDLE;
+    }
+  }
+
+
+  void BarrelGun::secondaryFire()
+  {
+    if (leftAmmo_ < 5)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    Ogre::SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          getNode()->getWorldPosition(),
+          getNode()->getWorldOrientation());
+
+    Ogre::Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+      + Ogre::StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(1, 0, 0))
+          .normalisedCopy() * secondaryBulletSpeed_*0.5;
+    speed += getVelocity();
+
+	  temp->setScale(Vector3(1, 1, 1) * 3);
+	  temp->roll(Degree(90));
+
+    Bullet* bullet = new Bullet();
+    bullet->setNode(temp);
+    bullet->attachObject(bulletEntity);
+    bullet->setVelocity(speed);
+	  bulletManager_->addBullet(bullet);
+
+
+    leftAmmo_ -= 5;
+  }
+
+
+  void BarrelGun::secondaryFiring(float time)
+  {
+    if (time > secondaryFiringRate_)
+      currentState_ = IDLE;
+  }
+
+}
Index: code/branches/input/src/asylum/orxonox/objects/weapon/BarrelGun.h
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/BarrelGun.h	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/BarrelGun.h	(revision 1629)
@@ -0,0 +1,65 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _BarrelGun_H__
+#define _BarrelGun_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgrePrerequisites.h>
+
+#include "BaseWeapon.h"
+
+
+namespace orxonox {
+  class _OrxonoxExport BarrelGun : public BaseWeapon
+  {
+ public:
+    BarrelGun();
+	  virtual ~BarrelGun();
+
+    //virtual void tick(float dt);
+
+  protected:
+    void primaryFire();
+
+    void primaryFiring(float);
+
+    void secondaryFire();
+
+    void secondaryFiring(float);
+
+  public:
+
+  protected:
+
+  };
+}
+
+#endif /* _BarrelGun_H__ */
Index: code/branches/input/src/asylum/orxonox/objects/weapon/BaseWeapon.cc
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/BaseWeapon.cc	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/BaseWeapon.cc	(revision 1629)
@@ -0,0 +1,186 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "BaseWeapon.h"
+
+#include <OgreStringConverter.h>
+#include <OgreSceneNode.h>
+#include <OgreEntity.h>
+#include <OgreSceneManager.h>
+
+#include "util/Math.h"
+#include "Orxonox.h"
+#include "Bullet.h"
+#include "BulletManager.h"
+#include "AmmunitionDump.h"
+#include "core/CoreIncludes.h"
+
+
+namespace orxonox {
+  float BaseWeapon::nextActionValidityPeriod_s = 0.5;
+
+  BaseWeapon::BaseWeapon()
+    : sceneMgr_(GraphicsEngine::getSingleton().getSceneManager()),
+      bulletCounter_(0),
+      bulletManager_(Orxonox::getSingleton()->getBulletMgr()),
+      ammoDump_(NULL),
+      primaryFireRequest_(false), secondaryFireRequest_(false),
+      totalTime_(0.0f), actionStartTime_(0.0f),
+      currentState_(IDLE), secondaryFired_(false),
+      nextAction_(NOTHING), actionAdded_(false),
+      timeSinceNextActionAdded_(0.0f),
+      leftAmmo_(0)
+  {
+    RegisterObject(BaseWeapon);
+  }
+
+
+  BaseWeapon::~BaseWeapon()
+  {
+  }
+
+
+  bool BaseWeapon::addAction(const Action act)
+  {
+    if (nextAction_ == NOTHING)
+    {
+      nextAction_ = act;
+      actionAdded_ = true;
+      return true;
+    }
+    else
+      return false;
+  }
+
+
+  void BaseWeapon::primaryFireRequest()
+  {
+    primaryFireRequest_ = true;
+  }
+
+
+  void BaseWeapon::secondaryFireRequest()
+  {
+    secondaryFireRequest_ = true;
+  }
+
+
+  void BaseWeapon::tick(float dt)
+  {
+    totalTime_ += dt;
+    // process action adder
+    if (actionAdded_)
+    {
+      timeSinceNextActionAdded_ = totalTime_;
+      actionAdded_ = false;
+    }
+
+    switch (currentState_)
+    {
+    case IDLE:
+      break;
+
+    case PRIMARY_FIRE:
+      primaryFiring(totalTime_ - actionStartTime_);
+      break;
+
+    case SECONDARY_FIRE:
+      secondaryFiring(totalTime_ - actionStartTime_);
+      break;
+
+    case RELOADING:
+      break;
+
+    case CHANGING_AMMO:
+      break;
+    }
+
+    if (currentState_ == IDLE)
+    {
+      // first, process next action
+      if (nextAction_ != NOTHING)
+      {
+        actionStartTime_ = totalTime_;
+        switch (nextAction_)
+        {
+        case RELOAD:
+          leftAmmo_ += ammoDump_->getAmmunition("Barrel", magazineSize_ - leftAmmo_);
+          break;
+
+        case CHANGE_AMMO:
+          break;
+
+        case SPECIAL:
+          break;
+
+        default:
+          break;
+        }
+
+        // pay attention when multithreaded!
+        nextAction_ = NOTHING;
+      }
+      else
+      {
+        // secondly, execute firing
+        if (primaryFireRequest_ && !(secondaryFired_ && secondaryFireRequest_))
+        {
+          actionStartTime_ = totalTime_;
+          currentState_ = PRIMARY_FIRE;
+          secondaryFired_ = false;
+          primaryFire();
+        }
+        else if (secondaryFireRequest_)
+        {
+          actionStartTime_ = totalTime_;
+          currentState_ = SECONDARY_FIRE;
+          secondaryFired_ = true;
+          secondaryFire();
+        }
+      }
+    }
+
+    primaryFireRequest_ = false;
+    secondaryFireRequest_ = false;
+
+    if (totalTime_ - timeSinceNextActionAdded_ > nextActionValidityPeriod_s)
+      nextAction_ = NOTHING;
+  }
+
+
+  int BaseWeapon::getAmmoState()
+  {
+    return leftAmmo_;
+  }
+
+  void BaseWeapon::setAmmoDump(AmmunitionDump* dump)
+  {
+    this->ammoDump_ = dump;
+  }
+}
Index: code/branches/input/src/asylum/orxonox/objects/weapon/BaseWeapon.h
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/BaseWeapon.h	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/BaseWeapon.h	(revision 1629)
@@ -0,0 +1,125 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _BaseWeapon_H__
+#define _BaseWeapon_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgrePrerequisites.h>
+
+#include "../Model.h"
+
+
+namespace orxonox {
+  class _OrxonoxExport BaseWeapon : public Model
+  {
+  public:
+    enum Action {
+      NOTHING  = 0,
+      RELOAD   = 1,
+      CHANGE_AMMO  = 2,
+      SPECIAL  = 3
+    };
+
+  protected:
+    enum State {
+      IDLE = 0,
+      PRIMARY_FIRE = 1,
+      SECONDARY_FIRE = 2,
+      RELOADING = 3,
+      CHANGING_AMMO = 4,
+    };
+
+  public:
+    BaseWeapon();
+	  virtual ~BaseWeapon();
+
+    bool addAction(const Action);
+
+    void primaryFireRequest();
+
+    void secondaryFireRequest();
+
+    int getAmmoState();
+
+    void setAmmoDump(AmmunitionDump*);
+
+    virtual void tick(float dt);
+
+  protected:
+    virtual void primaryFire() = 0;
+
+    virtual void primaryFiring(float) = 0;
+
+    virtual void secondaryFire() = 0;
+
+    virtual void secondaryFiring(float) = 0;
+
+    virtual void registerAllVariables() { };
+
+  public:
+
+  protected:
+    Ogre::SceneManager *sceneMgr_;
+
+    int bulletCounter_;
+    BulletManager *bulletManager_;
+
+    AmmunitionDump *ammoDump_;
+
+    bool primaryFireRequest_;
+    bool secondaryFireRequest_;
+
+    float totalTime_;
+    float actionStartTime_;
+
+    State currentState_;
+    bool secondaryFired_;
+
+    Action nextAction_;
+    bool actionAdded_;
+    float timeSinceNextActionAdded_;
+    static float nextActionValidityPeriod_s;
+
+    // weapon properties
+    int leftAmmo_;
+    float primaryFirePower_;
+    float secondaryFirePower_;
+    float primaryFiringRate_;
+    float secondaryFiringRate_;
+    Real primaryBulletSpeed_;
+    Real secondaryBulletSpeed_;
+
+    int magazineSize_;
+
+  };
+}
+
+#endif /* _BaseWeapon_H__ */
Index: code/branches/input/src/asylum/orxonox/objects/weapon/Bullet.cc
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/Bullet.cc	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/Bullet.cc	(revision 1629)
@@ -0,0 +1,46 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Bullet.h"
+
+#include "core/CoreIncludes.h"
+
+
+namespace orxonox {
+  CreateFactory(Bullet);
+
+  Bullet::Bullet()
+  {
+    RegisterObject(Bullet);
+  }
+
+  Bullet::~Bullet()
+  {
+  }
+}
Index: code/branches/input/src/asylum/orxonox/objects/weapon/Bullet.h
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/Bullet.h	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/Bullet.h	(revision 1629)
@@ -0,0 +1,50 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _Bullet_H__
+#define _Bullet_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgrePrerequisites.h>
+
+#include "../Model.h"
+
+namespace orxonox {
+  class _OrxonoxExport Bullet : public Model
+  {
+  public:
+	  Bullet();
+	  ~Bullet();
+
+    virtual void tick(float dt) { }
+ };
+}
+
+#endif /* _Bullet_H__ */
Index: code/branches/input/src/asylum/orxonox/objects/weapon/BulletManager.cc
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/BulletManager.cc	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/BulletManager.cc	(revision 1629)
@@ -0,0 +1,114 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "BulletManager.h"
+
+#include "Bullet.h"
+#include "core/CoreIncludes.h"
+
+
+namespace orxonox {
+  CreateFactory(BulletManager);
+
+  BulletManager::BulletManager() : bulletsSize_(8), bulletsIndex_(0)
+  {
+    RegisterObject(BulletManager);
+    registerAllVariables();
+    bullets_ = new Bullet*[bulletsSize_];
+  }
+
+
+  BulletManager::~BulletManager()
+  {
+    // clean up the bullet list
+    if (bullets_)
+    {
+      for (int i = 0; i < bulletsIndex_; i++)
+        delete bullets_[i];
+      delete bullets_;
+    }
+  }
+
+
+  void BulletManager::addBullet(Bullet *bullet)
+  {
+    // resize array if neccessary (double the size then)
+    if (bulletsIndex_ >= bulletsSize_)
+    {
+      // redimension the array
+      Bullet **tempArray = new Bullet*[2*bulletsSize_];
+      for (int i = 0; i < bulletsSize_; i++)
+        tempArray[i] = bullets_[i];
+      bulletsSize_ *= 2;
+      delete bullets_;
+      bullets_ = tempArray;
+    }
+
+    // add the bullet to the list
+    bullets_[bulletsIndex_++] = bullet;
+  }
+
+
+  void BulletManager::tick(float dt)
+  {
+    // update the bullet positions
+    for (int i = 0; i < bulletsIndex_; i++)
+    {
+      bullets_[i]->getNode()->translate(bullets_[i]->getVelocity()*dt);
+      //bullets_[i]->getNode()->yaw(Degree(dt*100));
+      //bullets_[i]->getNode()->roll(Degree(dt*300));
+    }
+  }
+
+  int BulletManager::getAmmunitionID(const std::string &ammoName)
+  {
+    std::string ammoTypes[] = { "Energy Cell", "Barrel", "Lead Shot" };
+    int ammoTypesLength = 3;
+
+    for (int i = 0; i < ammoTypesLength; i++)
+    {
+      if (ammoTypes[i] == ammoName)
+        return i;
+    }
+    return -1;
+  }
+
+  int BulletManager::getNumberOfAmmos()
+  {
+    return 3;
+  }
+
+  void BulletManager::registerAllVariables(){
+    registerVar(&bulletsSize_, sizeof(int), network::DATA);
+    registerVar(&bulletsIndex_, sizeof(int), network::DATA);
+    // TODO we got a problem here:
+    // there is no possibility (so far) to synchronise pointers to objects
+  }
+
+}
Index: code/branches/input/src/asylum/orxonox/objects/weapon/BulletManager.h
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/BulletManager.h	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/BulletManager.h	(revision 1629)
@@ -0,0 +1,70 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _BulletManager_H__
+#define _BulletManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+
+#include <OgrePrerequisites.h>
+
+#include "network/Synchronisable.h"
+#include "tinyxml/tinyxml.h"
+#include "core/BaseObject.h"
+#include "core/Tickable.h"
+
+namespace orxonox {
+  class _OrxonoxExport BulletManager : public BaseObject, public network::Synchronisable, public Tickable
+  {
+  public:
+    BulletManager();
+	  virtual ~BulletManager();
+
+    void addBullet(Bullet*);
+
+    int getAmmunitionID(const std::string&);
+
+    int getNumberOfAmmos();
+
+    virtual void tick(float dt);
+
+  protected:
+    inline bool create() { return Synchronisable::create(); }
+    void registerAllVariables();
+
+    // Bullet array
+	  Bullet **bullets_;
+	  int bulletsSize_;
+	  int bulletsIndex_;
+  };
+}
+
+#endif /* _BulletManager_H__ */
Index: code/branches/input/src/asylum/orxonox/objects/weapon/WeaponStation.cc
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/WeaponStation.cc	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/WeaponStation.cc	(revision 1629)
@@ -0,0 +1,71 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "WeaponStation.h"
+
+#include "BaseWeapon.h"
+
+
+namespace orxonox {
+  WeaponStation::WeaponStation(int stationSize)
+        : slots_(new BaseWeapon*[stationSize]),
+          lastActiveSlotIndex_(-1), stationSize_(stationSize)
+  {
+  	//slots_ = new BaseWeapon*[stationSize];
+  }
+
+
+  WeaponStation::~WeaponStation()
+  {
+    if (slots_)
+      delete slots_;
+    // when factory available: delete weapons too
+  }
+
+
+  bool WeaponStation::addWeapon(BaseWeapon *weapon)
+  {
+    if (lastActiveSlotIndex_ == stationSize_ - 1)
+      return false;
+
+    // this is ugly, but for the time being, it has to fit.
+    slots_[++lastActiveSlotIndex_] = weapon;
+    selectedSlot_ = slots_ + lastActiveSlotIndex_;
+    return true;
+  }
+
+
+  BaseWeapon* WeaponStation::selectWeapon(int slotNumber)
+  {
+    if (slotNumber < lastActiveSlotIndex_)
+      return NULL;
+    return slots_[slotNumber];
+  }
+
+}
Index: code/branches/input/src/asylum/orxonox/objects/weapon/WeaponStation.h
===================================================================
--- code/branches/input/src/asylum/orxonox/objects/weapon/WeaponStation.h	(revision 1629)
+++ code/branches/input/src/asylum/orxonox/objects/weapon/WeaponStation.h	(revision 1629)
@@ -0,0 +1,66 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _WeaponStation_H__
+#define _WeaponStation_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgrePrerequisites.h>
+
+
+namespace orxonox {
+  class _OrxonoxExport WeaponStation
+  {
+  public:
+    WeaponStation(int slotSize);
+	  ~WeaponStation();
+
+    bool addWeapon(BaseWeapon*);
+
+    //bool removeCurrentWeapon();
+
+    // TODO: access every weapon by name
+    BaseWeapon* selectWeapon(int slotNumber);
+
+  protected:
+
+  public:
+
+  protected:
+    // slot management
+    BaseWeapon **slots_;
+    BaseWeapon **selectedSlot_;
+    int lastActiveSlotIndex_;
+    int stationSize_;
+
+  };
+}
+
+#endif /* _WeaponStation_H__ */
Index: code/branches/input/src/core/BaseObject.cc
===================================================================
--- code/branches/input/src/core/BaseObject.cc	(revision 1623)
+++ code/branches/input/src/core/BaseObject.cc	(revision 1629)
@@ -45,11 +45,15 @@
         @brief Constructor: Registers the object in the BaseObject-list.
     */
-    BaseObject::BaseObject() :
-      bActive_(true),
-      bVisible_(true),
-      level_(0),
-      namespace_(0)
+    BaseObject::BaseObject() : bInitialized_(false)
     {
         RegisterRootObject(BaseObject);
+
+        this->bInitialized_ = true;
+
+        this->bActive_ = true;
+        this->bVisible_ = true;
+
+        this->level_ = 0;
+        this->namespace_ = 0;
     }
 
@@ -59,15 +63,4 @@
     BaseObject::~BaseObject()
     {
-    }
-
-    /**
-        @brief load general xml paramters
-    */
-    void BaseObject::loadParams(TiXmlElement* xmlElem)
-    {
-        if (xmlElem->Attribute("name"))
-        {
-            this->setName(xmlElem->Attribute("name"));
-        }
     }
 
@@ -81,4 +74,6 @@
     {
         XMLPortParam(BaseObject, "name", setName, getName, xmlelement, mode);
+        XMLPortParam(BaseObject, "visible", setVisible, isVisible, xmlelement, mode);
+        XMLPortParam(BaseObject, "active", setActive, isActive, xmlelement, mode);
     }
 
Index: code/branches/input/src/core/BaseObject.h
===================================================================
--- code/branches/input/src/core/BaseObject.h	(revision 1623)
+++ code/branches/input/src/core/BaseObject.h	(revision 1629)
@@ -47,9 +47,13 @@
     class _CoreExport BaseObject : virtual public OrxonoxClass
     {
+        friend class WorldEntity;
+
         public:
             BaseObject();
             virtual ~BaseObject();
-            virtual void loadParams(TiXmlElement* xmlElem);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            /** @brief Returns if the object was initialized (passed the object registration). @return True was the object is initialized */
+            inline bool isInitialized() const { return this->bInitialized_; }
 
             /** @brief Sets the name of the object. @param name The name */
@@ -61,14 +65,14 @@
 
             /** @brief Sets the state of the objects activity. @param bActive True = active */
-            inline void setActivity(bool bActive) { this->bActive_ = bActive; this->changedActivity(); }
+            inline void setActive(bool bActive) { this->bActive_ = bActive; this->changedActivity(); }
             /** @brief Returns the state of the objects activity. @return The state of the activity */
-            inline const bool isActive() const { return this->bActive_; }
+            inline bool isActive() const { return this->bActive_; }
             /** @brief This function gets called if the activity of the object changes. */
             virtual void changedActivity() {}
 
             /** @brief Sets the state of the objects visibility. @param bVisible True = visible */
-            inline void setVisibility(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); }
+            inline void setVisible(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); }
             /** @brief Returns the state of the objects visibility. @return The state of the visibility */
-            inline const bool isVisible() const { return this->bVisible_; }
+            inline bool isVisible() const { return this->bVisible_; }
             /** @brief This function gets called if the visibility of the object changes. */
             virtual void changedVisibility() {}
@@ -90,4 +94,5 @@
         private:
             std::string name_;                          //!< The name of the object
+            bool bInitialized_;                         //!< True if the object was initialized (passed the object registration)
             bool bActive_;                              //!< True = the object is active
             bool bVisible_;                             //!< True = the object is visible
Index: code/branches/input/src/core/CMakeLists.txt
===================================================================
--- code/branches/input/src/core/CMakeLists.txt	(revision 1623)
+++ code/branches/input/src/core/CMakeLists.txt	(revision 1629)
@@ -53,5 +53,5 @@
 GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
 ADD_CUSTOM_COMMAND(
-  OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h
+  OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/tolua/tolua_bind.cc
   COMMAND ${TOLUA_EXE} -n core -o ../../src/core/tolua/tolua_bind.cc -H ../../src/core/tolua/tolua_bind.h ../../src/core/tolua/tolua.pkg
   DEPENDS tolua
@@ -65,7 +65,7 @@
   ${OGRE_LIBRARIES}
   cpptcl
+  ois_orxonox
   tinyxml
   tolualib
-  ois
   util
   ${Boost_thread_LIBRARIES}
Index: code/branches/input/src/core/CommandEvaluation.cc
===================================================================
--- code/branches/input/src/core/CommandEvaluation.cc	(revision 1623)
+++ code/branches/input/src/core/CommandEvaluation.cc	(revision 1629)
@@ -78,5 +78,5 @@
         if (this->bEvaluatedParams_ && this->function_)
         {
-            COUT(4) << "CE_execute (evaluation): " << this->function_->getName() << " " << this->param_[0] << " " << this->param_[1] << " " << this->param_[2] << " " << this->param_[3] << " " << this->param_[4] << std::endl;
+            COUT(5) << "CE_execute (evaluation): " << this->function_->getName() << " " << this->param_[0] << " " << this->param_[1] << " " << this->param_[2] << " " << this->param_[3] << " " << this->param_[4] << std::endl;
             (*this->function_)(this->param_[0], this->param_[1], this->param_[2], this->param_[3], this->param_[4]);
             return true;
Index: code/branches/input/src/core/ConsoleCommand.h
===================================================================
--- code/branches/input/src/core/ConsoleCommand.h	(revision 1623)
+++ code/branches/input/src/core/ConsoleCommand.h	(revision 1629)
@@ -33,5 +33,5 @@
 
 #include "Executor.h"
-#include "ClassManager.h"
+#include "Identifier.h"
 #include "CommandExecutor.h"
 #include "ArgumentCompletionFunctions.h"
Index: code/branches/input/src/core/Executor.cc
===================================================================
--- code/branches/input/src/core/Executor.cc	(revision 1623)
+++ code/branches/input/src/core/Executor.cc	(revision 1629)
@@ -30,4 +30,5 @@
 #include "Executor.h"
 #include "util/Math.h"
+#include "util/Convert.h"
 #include "Language.h"
 
@@ -136,5 +137,5 @@
             {
                 std::string paramnumber;
-                if (!Convert::ToString(&paramnumber, param))
+                if (!convertValue(&paramnumber, param))
                     return (*this);
 
Index: code/branches/input/src/core/Iterator.h
===================================================================
--- code/branches/input/src/core/Iterator.h	(revision 1623)
+++ code/branches/input/src/core/Iterator.h	(revision 1629)
@@ -92,4 +92,5 @@
             {
                 this->element_ = element;
+                return *this;
             }
 
Index: code/branches/input/src/core/Loader.cc
===================================================================
--- code/branches/input/src/core/Loader.cc	(revision 1623)
+++ code/branches/input/src/core/Loader.cc	(revision 1629)
@@ -116,4 +116,5 @@
         Script::run();*/
         Script* lua = Script::getInstance();
+        lua->clearLuaOutput();
         lua->loadFile(level->getFile(), true);
         lua->run();
Index: code/branches/input/src/core/Script.cc
===================================================================
--- code/branches/input/src/core/Script.cc	(revision 1623)
+++ code/branches/input/src/core/Script.cc	(revision 1629)
@@ -39,5 +39,5 @@
 }
 
-#include "tolua++.h"
+#include "tolua/tolua++.h"
 #include "tolua/tolua_bind.h"
 
Index: code/branches/input/src/core/Script.h
===================================================================
--- code/branches/input/src/core/Script.h	(revision 1623)
+++ code/branches/input/src/core/Script.h	(revision 1629)
@@ -72,4 +72,5 @@
     inline std::string getLuaOutput() { return output_; };
     //inline std::string* getFileString() { return &fileString_; };
+    inline void clearLuaOutput() { output_ = ""; }
 
     unsigned int getNextQuote(const std::string& text, unsigned int start);
Index: code/branches/input/src/core/TclThreadManager.h
===================================================================
--- code/branches/input/src/core/TclThreadManager.h	(revision 1623)
+++ code/branches/input/src/core/TclThreadManager.h	(revision 1629)
@@ -45,6 +45,4 @@
 namespace orxonox
 {
-    class boost::thread;
-
     struct _CoreExport TclInterpreterBundle
     {
Index: code/branches/input/src/core/XMLPort.h
===================================================================
--- code/branches/input/src/core/XMLPort.h	(revision 1623)
+++ code/branches/input/src/core/XMLPort.h	(revision 1629)
@@ -152,4 +152,6 @@
                                 this->parseResult_ = PR_waiting_for_default_values;
                         }
+                        else
+                            this->parseResult_ = PR_waiting_for_default_values;
                     }
                     catch (ticpp::Exception& ex)
Index: code/branches/input/src/core/input/InputInterfaces.h
===================================================================
--- code/branches/input/src/core/input/InputInterfaces.h	(revision 1623)
+++ code/branches/input/src/core/input/InputInterfaces.h	(revision 1629)
@@ -37,5 +37,7 @@
 #include "core/CorePrereqs.h"
 
-#include "ois/OIS.h"
+#include "src/ois/OISKeyboard.h"
+#include "src/ois/OISMouse.h"
+#include "src/ois/OISJoyStick.h"
 #include "util/Math.h"
 
@@ -47,91 +49,91 @@
     enum Enum
     {
-      Unassigned    = OIS::KC_UNASSIGNED,  
-      Escape        = OIS::KC_ESCAPE,      
-      NumRow1       = OIS::KC_1,           
-      NumRow2       = OIS::KC_2,           
-      NumRow3       = OIS::KC_3,           
-      NumRow4       = OIS::KC_4,           
-      NumRow5       = OIS::KC_5,           
-      NumRow6       = OIS::KC_6,           
-      NumRow7       = OIS::KC_7,           
-      NumRow8       = OIS::KC_8,           
-      NumRow9       = OIS::KC_9,           
-      NumRow0       = OIS::KC_0,           
+      Unassigned    = OIS::KC_UNASSIGNED,
+      Escape        = OIS::KC_ESCAPE,
+      NumRow1       = OIS::KC_1,
+      NumRow2       = OIS::KC_2,
+      NumRow3       = OIS::KC_3,
+      NumRow4       = OIS::KC_4,
+      NumRow5       = OIS::KC_5,
+      NumRow6       = OIS::KC_6,
+      NumRow7       = OIS::KC_7,
+      NumRow8       = OIS::KC_8,
+      NumRow9       = OIS::KC_9,
+      NumRow0       = OIS::KC_0,
       Minus         = OIS::KC_MINUS,           // - on main keyboard
-      Equals        = OIS::KC_EQUALS,      
+      Equals        = OIS::KC_EQUALS,
       Back          = OIS::KC_BACK,            // backspace
-      Tab           = OIS::KC_TAB,         
-      Q             = OIS::KC_Q,           
-      W             = OIS::KC_W,           
-      E             = OIS::KC_E,           
-      R             = OIS::KC_R,           
-      T             = OIS::KC_T,           
-      Y             = OIS::KC_Y,           
-      U             = OIS::KC_U,           
-      I             = OIS::KC_I,           
-      O             = OIS::KC_O,           
-      P             = OIS::KC_P,           
-      LeftBracket   = OIS::KC_LBRACKET,    
-      RightBracket  = OIS::KC_RBRACKET,    
+      Tab           = OIS::KC_TAB,
+      Q             = OIS::KC_Q,
+      W             = OIS::KC_W,
+      E             = OIS::KC_E,
+      R             = OIS::KC_R,
+      T             = OIS::KC_T,
+      Y             = OIS::KC_Y,
+      U             = OIS::KC_U,
+      I             = OIS::KC_I,
+      O             = OIS::KC_O,
+      P             = OIS::KC_P,
+      LeftBracket   = OIS::KC_LBRACKET,
+      RightBracket  = OIS::KC_RBRACKET,
       Return        = OIS::KC_RETURN,          // Enter on main keyboard
-      LeftControl   = OIS::KC_LCONTROL,    
-      A             = OIS::KC_A,           
-      S             = OIS::KC_S,           
-      D             = OIS::KC_D,           
-      F             = OIS::KC_F,           
-      G             = OIS::KC_G,           
-      H             = OIS::KC_H,           
-      J             = OIS::KC_J,           
-      K             = OIS::KC_K,           
-      L             = OIS::KC_L,           
-      Semicolon     = OIS::KC_SEMICOLON,   
-      Apostrophe    = OIS::KC_APOSTROPHE,  
+      LeftControl   = OIS::KC_LCONTROL,
+      A             = OIS::KC_A,
+      S             = OIS::KC_S,
+      D             = OIS::KC_D,
+      F             = OIS::KC_F,
+      G             = OIS::KC_G,
+      H             = OIS::KC_H,
+      J             = OIS::KC_J,
+      K             = OIS::KC_K,
+      L             = OIS::KC_L,
+      Semicolon     = OIS::KC_SEMICOLON,
+      Apostrophe    = OIS::KC_APOSTROPHE,
       Grave         = OIS::KC_GRAVE,           // accent
-      LeftShift     = OIS::KC_LSHIFT,      
-      Backslash     = OIS::KC_BACKSLASH,   
-      Z             = OIS::KC_Z,           
-      X             = OIS::KC_X,           
-      C             = OIS::KC_C,           
-      V             = OIS::KC_V,           
-      B             = OIS::KC_B,           
-      N             = OIS::KC_N,           
-      M             = OIS::KC_M,           
-      Comma         = OIS::KC_COMMA,       
+      LeftShift     = OIS::KC_LSHIFT,
+      Backslash     = OIS::KC_BACKSLASH,
+      Z             = OIS::KC_Z,
+      X             = OIS::KC_X,
+      C             = OIS::KC_C,
+      V             = OIS::KC_V,
+      B             = OIS::KC_B,
+      N             = OIS::KC_N,
+      M             = OIS::KC_M,
+      Comma         = OIS::KC_COMMA,
       Period        = OIS::KC_PERIOD,          // . on main keyboard
       Slash         = OIS::KC_SLASH,           // / on main keyboard
-      RightShift    = OIS::KC_RSHIFT,      
+      RightShift    = OIS::KC_RSHIFT,
       Multiply      = OIS::KC_MULTIPLY,        // * on numeric keypad
       LeftAlt       = OIS::KC_LMENU,           // left Alt
-      Space         = OIS::KC_SPACE,       
-      CapsLock      = OIS::KC_CAPITAL,     
-      F1            = OIS::KC_F1,          
-      F2            = OIS::KC_F2,          
-      F3            = OIS::KC_F3,          
-      F4            = OIS::KC_F4,          
-      F5            = OIS::KC_F5,          
-      F6            = OIS::KC_F6,          
-      F7            = OIS::KC_F7,          
-      F8            = OIS::KC_F8,          
-      F9            = OIS::KC_F9,          
-      F10           = OIS::KC_F10,         
-      Numlock       = OIS::KC_NUMLOCK,     
+      Space         = OIS::KC_SPACE,
+      CapsLock      = OIS::KC_CAPITAL,
+      F1            = OIS::KC_F1,
+      F2            = OIS::KC_F2,
+      F3            = OIS::KC_F3,
+      F4            = OIS::KC_F4,
+      F5            = OIS::KC_F5,
+      F6            = OIS::KC_F6,
+      F7            = OIS::KC_F7,
+      F8            = OIS::KC_F8,
+      F9            = OIS::KC_F9,
+      F10           = OIS::KC_F10,
+      Numlock       = OIS::KC_NUMLOCK,
       Scrolllock    = OIS::KC_SCROLL,          // Scroll Lock
-      Numpad7       = OIS::KC_NUMPAD7,     
-      Numpad8       = OIS::KC_NUMPAD8,     
-      Numpad9       = OIS::KC_NUMPAD9,     
+      Numpad7       = OIS::KC_NUMPAD7,
+      Numpad8       = OIS::KC_NUMPAD8,
+      Numpad9       = OIS::KC_NUMPAD9,
       NumpadSubtract= OIS::KC_SUBTRACT,        // - on numeric keypad
-      Numpad4       = OIS::KC_NUMPAD4,     
-      Numpad5       = OIS::KC_NUMPAD5,     
-      Numpad6       = OIS::KC_NUMPAD6,     
+      Numpad4       = OIS::KC_NUMPAD4,
+      Numpad5       = OIS::KC_NUMPAD5,
+      Numpad6       = OIS::KC_NUMPAD6,
       NumpadAdd     = OIS::KC_ADD,             // + on numeric keypad
-      Numpad1       = OIS::KC_NUMPAD1,     
-      Numpad2       = OIS::KC_NUMPAD2,     
-      Numpad3       = OIS::KC_NUMPAD3,     
-      Numpad0       = OIS::KC_NUMPAD0,     
+      Numpad1       = OIS::KC_NUMPAD1,
+      Numpad2       = OIS::KC_NUMPAD2,
+      Numpad3       = OIS::KC_NUMPAD3,
+      Numpad0       = OIS::KC_NUMPAD0,
       NumpadPeriod  = OIS::KC_DECIMAL,         // . on numeric keypad
       LessThan      = OIS::KC_OEM_102,         // < > | on UK/Germany keyboards
-      F11           = OIS::KC_F11,         
-      F12           = OIS::KC_F12,         
+      F11           = OIS::KC_F11,
+      F12           = OIS::KC_F12,
       F13           = OIS::KC_F13,             //                     (NEC PC98)
       F14           = OIS::KC_F14,             //                     (NEC PC98)
@@ -154,5 +156,5 @@
       NextTrack     = OIS::KC_NEXTTRACK,       // Next Track
       NumpadEnter   = OIS::KC_NUMPADENTER,     // Enter on numeric keypad
-      RightControl  = OIS::KC_RCONTROL,    
+      RightControl  = OIS::KC_RCONTROL,
       Mute          = OIS::KC_MUTE,            // Mute
       Calculator    = OIS::KC_CALCULATOR,      // Calculator
@@ -164,5 +166,5 @@
       NumpadComma   = OIS::KC_NUMPADCOMMA,     // , on numeric keypad (NEC PC98)
       Divide        = OIS::KC_DIVIDE,          // / on numeric keypad
-      SYSRQ         = OIS::KC_SYSRQ,       
+      SYSRQ         = OIS::KC_SYSRQ,
       RightAlt      = OIS::KC_RMENU,           // right Alt
       Pause         = OIS::KC_PAUSE,           // Pause
@@ -254,5 +256,5 @@
 		std::vector<Vector3> mVectors;
   };*/
-  
+
   /**
   * Helper struct to determine which handlers of an object (can implement
Index: code/branches/input/src/core/input/InputManager.cc
===================================================================
--- code/branches/input/src/core/input/InputManager.cc	(revision 1623)
+++ code/branches/input/src/core/input/InputManager.cc	(revision 1629)
@@ -36,4 +36,5 @@
 
 #include <limits.h>
+
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
@@ -42,8 +43,12 @@
 #include "core/ConsoleCommand.h"
 #include "core/Shell.h"               // hack!
+
 #include "InputBuffer.h"
 #include "KeyBinder.h"
 #include "KeyDetector.h"
 #include "CalibratorCallback.h"
+
+#include "src/ois/OISException.h"
+#include "src/ois/OISInputManager.h"
 
 namespace orxonox
@@ -650,5 +655,5 @@
       activeHandlers_[iHandler].first->tickInput(dt, activeHandlers_[iHandler].second);
   }
-    
+
   void InputManager::_completeCalibration()
   {
Index: code/branches/input/src/core/input/InputManager.h
===================================================================
--- code/branches/input/src/core/input/InputManager.h	(revision 1623)
+++ code/branches/input/src/core/input/InputManager.h	(revision 1629)
@@ -41,5 +41,4 @@
 #include <vector>
 
-#include "ois/OIS.h"
 #include "util/Math.h"
 #include "core/OrxonoxClass.h"
Index: code/branches/input/src/core/input/KeyBinder.cc
===================================================================
--- code/branches/input/src/core/input/KeyBinder.cc	(revision 1623)
+++ code/branches/input/src/core/input/KeyBinder.cc	(revision 1629)
@@ -234,8 +234,8 @@
   void KeyBinder::setConfigValues()
   {
-    SetConfigValueGeneric(KeyBinder, analogThreshold_, 0.01f)  .description("Threshold for analog axes until which the state is 0.");
+    SetConfigValueGeneric(KeyBinder, analogThreshold_, 0.05f)  .description("Threshold for analog axes until which the state is 0.");
     SetConfigValueGeneric(KeyBinder, mouseSensitivity_, 1.0f)  .description("Mouse sensitivity.");
     SetConfigValueGeneric(KeyBinder, bDeriveMouseInput_, false).description("Whether or not to derive moues movement for the absolute value.");
-    SetConfigValueGeneric(KeyBinder, derivePeriod_, 0.5f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
+    SetConfigValueGeneric(KeyBinder, derivePeriod_, 0.05f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
     SetConfigValueGeneric(KeyBinder, mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived.");
     SetConfigValueGeneric(KeyBinder, bClipMouse_, true).description("Whether or not to clip absolute value of mouse in non derive mode.");
Index: code/branches/input/src/network/GameStateClient.cc
===================================================================
--- code/branches/input/src/network/GameStateClient.cc	(revision 1623)
+++ code/branches/input/src/network/GameStateClient.cc	(revision 1629)
@@ -34,4 +34,5 @@
 #include "core/BaseObject.h"
 #include "Synchronisable.h"
+#include "objects/SpaceShip.h"
 
 
Index: code/branches/input/src/network/GameStateClient.h
===================================================================
--- code/branches/input/src/network/GameStateClient.h	(revision 1623)
+++ code/branches/input/src/network/GameStateClient.h	(revision 1629)
@@ -44,10 +44,12 @@
 // 
 #include "NetworkPrereqs.h"
+#include "OrxonoxPrereqs.h"
 #include "core/CorePrereqs.h"
 #include "PacketTypes.h"
-#include "objects/SpaceShip.h"
+#include "Synchronisable.h"
 
 
 #define GAMESTATEID_INITIAL -1
+
 
 namespace network
Index: code/branches/input/src/network/Server.cc
===================================================================
--- code/branches/input/src/network/Server.cc	(revision 1623)
+++ code/branches/input/src/network/Server.cc	(revision 1629)
@@ -181,8 +181,11 @@
     timeSinceLastUpdate_+=time;
     if(timeSinceLastUpdate_>=(1./NETWORK_FREQUENCY)){
-      timeSinceLastUpdate_-=(1./NETWORK_FREQUENCY);
+      timeSinceLastUpdate_=(float)((int)(timeSinceLastUpdate_*NETWORK_FREQUENCY))/timeSinceLastUpdate_;
+//      timeSinceLastUpdate_-=1./NETWORK_FREQUENCY;
       gamestates->processGameStates();
       updateGamestate();
     }
+    /*while(timeSinceLastUpdate_>1./NETWORK_FREQUENCY)
+      timeSinceLastUpdate_-=1./NETWORK_FREQUENCY;*/
 //     usleep(5000); // TODO remove
     return;
@@ -217,4 +220,6 @@
             COUT(3) << "Server: could not elaborate" << std::endl;
         }
+        break;
+      default:
         break;
       }
Index: code/branches/input/src/ois/CMakeLists.txt
===================================================================
--- code/branches/input/src/ois/CMakeLists.txt	(revision 1623)
+++ code/branches/input/src/ois/CMakeLists.txt	(revision 1629)
@@ -1,2 +1,4 @@
+INCLUDE_DIRECTORIES(.)
+
 SET( OIS_SRC_FILES
   OISEffect.cpp
@@ -36,9 +38,9 @@
 ENDIF (WIN32)
 
-ADD_LIBRARY( ois SHARED ${OIS_SRC_FILES} )
+ADD_LIBRARY( ois_orxonox SHARED ${OIS_SRC_FILES} )
 
 IF(WIN32)
   LINK_DIRECTORIES(${DirectX_LIB_DIR})
-  TARGET_LINK_LIBRARIES( ois
+  TARGET_LINK_LIBRARIES( ois_orxonox
     dxguid
     dinput8
Index: code/branches/input/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/input/src/orxonox/CMakeLists.txt	(revision 1623)
+++ code/branches/input/src/orxonox/CMakeLists.txt	(revision 1629)
@@ -3,13 +3,23 @@
   Main.cc
   Orxonox.cc
+  Radar.cc
+  RadarListener.cc
+  RadarViewable.cc
   Settings.cc
 
-  console/InGameConsole.cc
-  hud/HUD.cc
-  hud/BarOverlayElement.cc
-  hud/RadarOverlayElement.cc
-  hud/RadarObject.cc
-  hud/Navigation.cc
-  particle/ParticleInterface.cc
+  overlays/OrxonoxOverlay.cc
+  overlays/OverlayGroup.cc
+  overlays/OverlayText.cc
+
+  overlays/console/InGameConsole.cc
+
+  overlays/debug/DebugFPSText.cc
+  overlays/debug/DebugRTRText.cc
+
+  overlays/hud/HUDBar.cc
+  overlays/hud/HUDNavigation.cc
+  overlays/hud/HUDRadar.cc
+  overlays/hud/HUDSpeedBar.cc
+
   tolua/tolua_bind.cc
 
@@ -17,14 +27,16 @@
   tools/Light.cc
   tools/Mesh.cc
+  tools/ParticleInterface.cc
+  tools/TextureGenerator.cc
   tools/Timer.cc
+  tools/WindowEventListener.cc
 
   objects/Ambient.cc
+  objects/Backlight.cc
   objects/Camera.cc
   objects/CameraHandler.cc
-  objects/Explosion.cc
   objects/Model.cc
   objects/NPC.cc
-  objects/Projectile.cc
-  objects/RotatingProjectile.cc
+  objects/ParticleSpawner.cc
   objects/Skybox.cc
   objects/SpaceShip.cc
@@ -33,15 +45,13 @@
   objects/WorldEntity.cc
 
-#  objects/weapon/AmmunitionDump.cc
-#  objects/weapon/BarrelGun.cc
-#  objects/weapon/BaseWeapon.cc
-#  objects/weapon/Bullet.cc
-#  objects/weapon/BulletManager.cc
-#  objects/weapon/WeaponStation.cc
+  objects/Projectile.cc
+  objects/BillboardProjectile.cc
+  objects/RotatingProjectile.cc
+  objects/ParticleProjectile.cc
 )
 
 GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
 ADD_CUSTOM_COMMAND(
-  OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h
+  OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/tolua/tolua_bind.cc
   COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/orxonox/tolua/tolua_bind.cc -H ../../src/orxonox/tolua/tolua_bind.h ../../src/orxonox/tolua/tolua.pkg
   DEPENDS tolua
@@ -75,5 +85,5 @@
   tinyxml
   tolualib
-  ois
+  ois_orxonox
   util
   core
Index: code/branches/input/src/orxonox/GraphicsEngine.cc
===================================================================
--- code/branches/input/src/orxonox/GraphicsEngine.cc	(revision 1623)
+++ code/branches/input/src/orxonox/GraphicsEngine.cc	(revision 1629)
@@ -50,11 +50,14 @@
 #include "core/CommandExecutor.h"
 #include "core/ConsoleCommand.h"
-#include "core/input/InputManager.h"
-
-#include "console/InGameConsole.h"
+
+#include "overlays/console/InGameConsole.h"
+#include "overlays/OverlayGroup.h"
+#include "tools/ParticleInterface.h"
 #include "Settings.h"
-
-
-namespace orxonox {
+#include "tools/WindowEventListener.h"
+
+
+namespace orxonox
+{
   /**
     @brief Returns the singleton instance and creates it the first time.
@@ -76,4 +79,6 @@
   {
     RegisterObject(GraphicsEngine);
+
+    this->detailLevelParticle_ = 0;
 
     this->setConfigValues();
@@ -91,4 +96,11 @@
     SetConfigValue(ogreLogLevelNormal_  , 4).description("Corresponding orxonox debug level for ogre Normal");
     SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");
+
+    unsigned int old = this->detailLevelParticle_;
+    SetConfigValue(detailLevelParticle_, 2).description("O: off, 1: low, 2: normal, 3: high");
+
+    if (this->detailLevelParticle_ != old)
+      for (Iterator<ParticleInterface> it = ObjectList<ParticleInterface>::begin(); it; ++it)
+        it->detailLevelChanged(this->detailLevelParticle_);
   }
 
@@ -424,10 +436,11 @@
 
   /**
-  * Window has resized.
+  * Window has moved.
   * @param rw The render window it occured in
   */
   void GraphicsEngine::windowMoved(Ogre::RenderWindow *rw)
   {
-    // note: this doesn't change the window extents
+    for (Iterator<orxonox::WindowEventListener> it = ObjectList<orxonox::WindowEventListener>::start(); it; ++it)
+      it->windowMoved();
   }
 
@@ -440,27 +453,25 @@
   void GraphicsEngine::windowResized(Ogre::RenderWindow *rw)
   {
-    // change the mouse clipping size for absolute mouse movements
-    int w = rw->getWidth();
-    int h = rw->getHeight();
-    InputManager::setWindowExtents(w, h);
-    InGameConsole::getInstance().resize();
-  }
-
-  /**
-  * Window has resized.
+    for (Iterator<orxonox::WindowEventListener> it = ObjectList<orxonox::WindowEventListener>::start(); it; ++it)
+      it->windowResized(this->renderWindow_->getWidth(), this->renderWindow_->getHeight());
+  }
+
+  /**
+  * Window has changed Focus.
   * @param rw The render window it occured in
   */
   void GraphicsEngine::windowFocusChanged(Ogre::RenderWindow *rw)
   {
-    // note: this doesn't change the window extents
-  }
-
-  /**
-  * Window has resized.
+    for (Iterator<orxonox::WindowEventListener> it = ObjectList<orxonox::WindowEventListener>::start(); it; ++it)
+      it->windowFocusChanged();
+  }
+
+  /**
+  * Window was closed.
   * @param rw The render window it occured in
   */
   void GraphicsEngine::windowClosed(Ogre::RenderWindow *rw)
   {
-    // using CommandExecutor in order to avoid depending on Orxonox class.
+    // using CommandExecutor in order to avoid depending on Orxonox.h.
     CommandExecutor::execute("exit", false);
   }
Index: code/branches/input/src/orxonox/GraphicsEngine.h
===================================================================
--- code/branches/input/src/orxonox/GraphicsEngine.h	(revision 1623)
+++ code/branches/input/src/orxonox/GraphicsEngine.h	(revision 1629)
@@ -47,6 +47,6 @@
 
 
-namespace orxonox {
-
+namespace orxonox
+{
     /**
     @brief Graphics engine manager class
@@ -72,6 +72,11 @@
             int getWindowHeight() const;
             float getWindowAspectRatio() const;
-            float getAverageFPS() const
-            { if (renderWindow_) return this->renderWindow_->getAverageFPS(); else return 0.0f; }
+            float getAverageFramesPerSecond() const { return this->avgFramesPerSecond_; }
+            float getAverageTickTime() const { return this->avgTickTime_; }
+            void setAverageTickTime(float tickTime) { this->avgTickTime_ = tickTime; }
+            void setAverageFramesPerSecond(float fps) { this->avgFramesPerSecond_ = fps; }
+
+            void setWindowActivity(bool activity)
+            { if (this->renderWindow_) this->renderWindow_->setActive(activity); }
 
             void windowMoved       (Ogre::RenderWindow* rw);
@@ -79,4 +84,7 @@
             void windowFocusChanged(Ogre::RenderWindow* rw);
             void windowClosed      (Ogre::RenderWindow* rw);
+
+            inline unsigned int getDetailLevelParticle() const
+              { return this->detailLevelParticle_; }
 
             static GraphicsEngine& getSingleton();
@@ -94,14 +102,17 @@
                              bool, const std::string&);
 
-            Ogre::Root*         root_;              //!< Ogre's root
-            Ogre::SceneManager* scene_;             //!< scene manager of the game
-            Ogre::RenderWindow* renderWindow_;      //!< the current render window
-            std::string         resourceFile_;      //!< resources file name
-            std::string         ogreConfigFile_;    //!< ogre config file name
-            std::string         ogrePluginsFile_;   //!< ogre plugins file name
-            std::string         ogreLogFile_;       //!< log file name for Ogre log messages
-            int ogreLogLevelTrivial_;               //!< Corresponding Orxonx debug level for LL_TRIVIAL
-            int ogreLogLevelNormal_;                //!< Corresponding Orxonx debug level for LL_NORMAL
-            int ogreLogLevelCritical_;              //!< Corresponding Orxonx debug level for LL_CRITICAL
+            Ogre::Root*         root_;                  //!< Ogre's root
+            Ogre::SceneManager* scene_;                 //!< scene manager of the game
+            Ogre::RenderWindow* renderWindow_;          //!< the current render window
+            std::string         resourceFile_;          //!< resources file name
+            std::string         ogreConfigFile_;        //!< ogre config file name
+            std::string         ogrePluginsFile_;       //!< ogre plugins file name
+            std::string         ogreLogFile_;           //!< log file name for Ogre log messages
+            int                 ogreLogLevelTrivial_;   //!< Corresponding Orxonx debug level for LL_TRIVIAL
+            int                 ogreLogLevelNormal_;    //!< Corresponding Orxonx debug level for LL_NORMAL
+            int                 ogreLogLevelCritical_;  //!< Corresponding Orxonx debug level for LL_CRITICAL
+            unsigned int        detailLevelParticle_;   //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
+            float               avgTickTime_;           //!< time in ms to tick() one frame
+            float               avgFramesPerSecond_;    //!< number of frames processed in one second
     };
 }
Index: code/branches/input/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/input/src/orxonox/Orxonox.cc	(revision 1623)
+++ code/branches/input/src/orxonox/Orxonox.cc	(revision 1629)
@@ -69,14 +69,17 @@
 
 // objects and tools
-#include "hud/HUD.h"
+#include "overlays/OverlayGroup.h"
+#include "overlays/console/InGameConsole.h"
 #include "objects/Tickable.h"
+#include "objects/Backlight.h"
+#include "tools/ParticleInterface.h"
 
 #include "GraphicsEngine.h"
 #include "Settings.h"
-
-// FIXME: is this really file scope?
+#include "Radar.h"
+
 // globals for the server or client
-network::Client *client_g = 0;
-network::Server *server_g = 0;
+static network::Client *client_g = 0;
+static network::Server *server_g = 0;
 
 namespace orxonox
@@ -94,16 +97,16 @@
    * Create a new instance of Orxonox. Avoid doing any actual work here.
    */
-  Orxonox::Orxonox() :
-    ogre_(0),
-    //auMan_(0),
-    timer_(0),
-    // turn on frame smoothing by setting a value different from 0
-    frameSmoothingTime_(0.0f),
-    orxonoxHUD_(0),
-    bAbort_(false),
-    timefactor_(1.0f),
-    mode_(STANDALONE),
-    serverIp_(""),
-    serverPort_(NETWORK_PORT)
+  Orxonox::Orxonox()
+    : ogre_(0)
+    , startLevel_(0)
+    , hud_(0)
+    , radar_(0)
+    //, auMan_(0)
+    , timer_(0)
+    , bAbort_(false)
+    , timefactor_(1.0f)
+    , mode_(STANDALONE)
+    , serverIp_("")
+    , serverPort_(NETWORK_PORT)
   {
   }
@@ -115,12 +118,22 @@
   {
     // keep in mind: the order of deletion is very important!
-//    if (this->orxonoxHUD_)
-//      delete this->orxonoxHUD_;
+    Loader::unload(startLevel_);
+    if (this->startLevel_)
+      delete this->startLevel_;
+
+    Loader::unload(hud_);
+    if (this->hud_)
+      delete this->hud_;
+
+    if (this->radar_)
+      delete this->radar_;
+
     Loader::close();
-    InputManager::destroy();
     //if (this->auMan_)
     //  delete this->auMan_;
+    InGameConsole::getInstance().destroy();
     if (this->timer_)
       delete this->timer_;
+    InputManager::destroy();
     GraphicsEngine::getSingleton().destroy();
 
@@ -159,4 +172,18 @@
       delete singletonRef_s;
     singletonRef_s = 0;
+  }
+
+  /**
+    @brief Changes the speed of Orxonox
+  */
+  void Orxonox::setTimeFactor(float factor)
+  {
+    float change = factor / Orxonox::getSingleton()->getTimeFactor();
+    Orxonox::getSingleton()->timefactor_ = factor;
+    for (Iterator<ParticleInterface> it = ObjectList<ParticleInterface>::begin(); it; ++it)
+        it->setSpeedFactor(it->getSpeedFactor() * change);
+
+    for (Iterator<Backlight> it = ObjectList<Backlight>::begin(); it; ++it)
+        it->setTimeFactor(Orxonox::getSingleton()->getTimeFactor());
   }
 
@@ -251,4 +278,11 @@
         return false;
 
+      // TODO: Spread this so that this call only initialises things needed for the Console
+      if (!ogre_->initialiseResources())
+        return false;
+
+      // Load the InGameConsole
+      InGameConsole::getInstance().initialise();
+
       // Calls the InputManager which sets up the input devices.
       // The render window width and height are used to set up the mouse movement.
@@ -257,8 +291,4 @@
         return false;
 
-      // TODO: Spread this so that this call only initialises things needed for the GUI
-      if (!ogre_->initialiseResources())
-        return false;
-
       // TOOD: load the GUI here
       // set InputManager to GUI mode
@@ -303,5 +333,5 @@
   /**
    * Loads everything in the scene except for the actual objects.
-   * This includes HUD, Console..
+   * This includes HUD, audio..
    */
   bool Orxonox::loadPlayground()
@@ -316,6 +346,11 @@
 
     // Load the HUD
-    COUT(3) << "Orxonox: Loading HUD..." << std::endl;
-    orxonoxHUD_ = &HUD::getSingleton();
+    COUT(3) << "Orxonox: Loading HUD" << std::endl;
+    hud_ = new Level(Settings::getDataPath() + "overlay/hud.oxo");
+    Loader::load(hud_);
+
+    // Start the Radar
+    this->radar_ = new Radar();
+
     return true;
   }
@@ -326,5 +361,5 @@
   bool Orxonox::serverLoad()
   {
-    COUT(2) << "Loading level in server mode" << std::endl;
+    COUT(0) << "Loading level in server mode" << std::endl;
 
     //server_g = new network::Server(serverPort_);
@@ -344,5 +379,5 @@
   bool Orxonox::clientLoad()
   {
-    COUT(2) << "Loading level in client mode" << std::endl;\
+    COUT(0) << "Loading level in client mode" << std::endl;\
 
     if (serverIp_.compare("") == 0)
@@ -364,5 +399,5 @@
   bool Orxonox::standaloneLoad()
   {
-    COUT(2) << "Loading level in standalone mode" << std::endl;
+    COUT(0) << "Loading level in standalone mode" << std::endl;
 
     if (!loadScene())
@@ -377,7 +412,7 @@
   bool Orxonox::loadScene()
   {
-    Level* startlevel = new Level("levels/sample.oxw");
-    Loader::open(startlevel);
-    
+    startLevel_ = new Level("levels/sample.oxw");
+    Loader::open(startLevel_);
+
     return true;
   }
@@ -403,68 +438,70 @@
 
 
-    // Contains the times of recently fired events
-    // eventTimes[4] is the list for the times required for the fps counter
-    std::deque<unsigned long> eventTimes[3];
-    // Clear event times
-    for (int i = 0; i < 3; ++i)
-      eventTimes[i].clear();
-
     // use the ogre timer class to measure time.
     if (!timer_)
       timer_ = new Ogre::Timer();
+
+    unsigned long frameCount = 0;
+    
+    // TODO: this would very well fit into a configValue
+    const unsigned long refreshTime = 200000;
+    unsigned long refreshStartTime = 0;
+    unsigned long tickTime = 0;
+    unsigned long oldFrameCount = 0;
+
+    unsigned long timeBeforeTick = 0;
+    unsigned long timeBeforeTickOld = 0;
+    unsigned long timeAfterTick = 0;
+
+    COUT(3) << "Orxonox: Starting the main loop." << std::endl;
+
     timer_->reset();
-
-    float renderTime = 0.0f;
-    float frameTime = 0.0f;
-    clock_t time = 0;
-
-    //Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager();
-    //Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport();
-    
-    //Ogre::CompositorManager::getSingleton().addCompositor(mViewport, "Bloom");
-    //Ogre::CompositorManager::getSingleton().addCompositor(mViewport, "MotionBlur");
-
-    COUT(3) << "Orxonox: Starting the main loop." << std::endl;
     while (!bAbort_)
     {
       // get current time
-      unsigned long now = timer_->getMilliseconds();
-
-      // create an event to pass to the frameStarted method in ogre
-      Ogre::FrameEvent evt;
-      evt.timeSinceLastEvent = calculateEventTime(now, eventTimes[0]);
-      evt.timeSinceLastFrame = calculateEventTime(now, eventTimes[1]);
-      frameTime += evt.timeSinceLastFrame;
-
-      // show the current time in the HUD
-      // HUD::getSingleton().setTime(now);
-      if (mode_ != DEDICATED && frameTime > 0.4f)
-      {
-        HUD::getSingleton().setRenderTimeRatio(renderTime / frameTime);
-        frameTime = 0.0f;
-        renderTime = 0.0f;
-      }
-
-      // tick the core
-      Core::tick((float)evt.timeSinceLastFrame);
+      timeBeforeTickOld = timeBeforeTick;
+      timeBeforeTick    = timer_->getMicroseconds();
+      float dt = (timeBeforeTick - timeBeforeTickOld) / 1000000.0;
+
+
+      // tick the core (needs real time for input and tcl thread management)
+      Core::tick(dt);
+
       // Call those objects that need the real time
       for (Iterator<TickableReal> it = ObjectList<TickableReal>::start(); it; ++it)
-        it->tick((float)evt.timeSinceLastFrame);
+        it->tick(dt);
       // Call the scene objects
       for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it)
-        it->tick((float)evt.timeSinceLastFrame * this->timefactor_);
-      //AudioManager::tick();
+        it->tick(dt * this->timefactor_);
+
+      // call server/client with normal dt
       if (client_g)
-        client_g->tick((float)evt.timeSinceLastFrame);
+        client_g->tick(dt * this->timefactor_);
       if (server_g)
-        server_g->tick((float)evt.timeSinceLastFrame);
+        server_g->tick(dt * this->timefactor_);
+
+
+      // get current time once again
+      timeAfterTick = timer_->getMicroseconds();
+
+      tickTime += timeAfterTick - timeBeforeTick;
+      if (timeAfterTick > refreshStartTime + refreshTime)
+      {
+        GraphicsEngine::getSingleton().setAverageTickTime(
+            (float)tickTime * 0.001 / (frameCount - oldFrameCount));
+        GraphicsEngine::getSingleton().setAverageFramesPerSecond(
+            (float)(frameCount - oldFrameCount) / (timeAfterTick - refreshStartTime) * 1000000.0);
+        oldFrameCount = frameCount;
+        tickTime = 0;
+        refreshStartTime = timeAfterTick;
+      }
+
 
       // don't forget to call _fireFrameStarted in ogre to make sure
       // everything goes smoothly
+      Ogre::FrameEvent evt;
+      evt.timeSinceLastFrame = dt;
+      evt.timeSinceLastEvent = dt; // note: same time, but shouldn't matter anyway
       ogreRoot._fireFrameStarted(evt);
-
-      // get current time
-      now = timer_->getMilliseconds();
-      calculateEventTime(now, eventTimes[2]);
 
       if (mode_ != DEDICATED)
@@ -473,4 +510,7 @@
         // This calls the WindowEventListener objects.
         Ogre::WindowEventUtilities::messagePump();
+        // make sure the window stays active even when not focused
+        // (probably only necessary on windows)
+        GraphicsEngine::getSingleton().setWindowActivity(true);
 
         // render
@@ -478,14 +518,8 @@
       }
 
-      // get current time
-      now = timer_->getMilliseconds();
-
-      // create an event to pass to the frameEnded method in ogre
-      evt.timeSinceLastEvent = calculateEventTime(now, eventTimes[0]);
-      renderTime += calculateEventTime(now, eventTimes[2]);
-
       // again, just to be sure ogre works fine
-      ogreRoot._fireFrameEnded(evt);
-      //msleep(200);
+      ogreRoot._fireFrameEnded(evt); // note: uses the same time as _fireFrameStarted
+
+      ++frameCount;
     }
 
@@ -497,41 +531,3 @@
     return true;
   }
-
-  /**
-    Method for calculating the average time between recently fired events.
-    Code directly taken from OgreRoot.cc
-    @param now The current time in ms.
-    @param type The type of event to be considered.
-  */
-  float Orxonox::calculateEventTime(unsigned long now, std::deque<unsigned long> &times)
-  {
-    // Calculate the average time passed between events of the given type
-    // during the last frameSmoothingTime_ seconds.
-
-    times.push_back(now);
-
-    if(times.size() == 1)
-      return 0;
-
-    // Times up to frameSmoothingTime_ seconds old should be kept
-    unsigned long discardThreshold = (unsigned long)(frameSmoothingTime_ * 1000.0f);
-
-    // Find the oldest time to keep
-    std::deque<unsigned long>::iterator it  = times.begin();
-    // We need at least two times
-    std::deque<unsigned long>::iterator end = times.end() - 2;
-
-    while(it != end)
-    {
-      if (now - *it > discardThreshold)
-        ++it;
-      else
-        break;
-    }
-
-    // Remove old times
-    times.erase(times.begin(), it);
-
-    return (float)(times.back() - times.front()) / ((times.size() - 1) * 1000);
-  }
 }
Index: code/branches/input/src/orxonox/Orxonox.h
===================================================================
--- code/branches/input/src/orxonox/Orxonox.h	(revision 1623)
+++ code/branches/input/src/orxonox/Orxonox.h	(revision 1629)
@@ -62,11 +62,10 @@
 
       void abortRequest();
-      //inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
 
       static Orxonox* getSingleton();
       static void destroySingleton();
 
-      static inline void slomo(float factor) { Orxonox::getSingleton()->timefactor_ = factor; }
-      static inline void setTimeFactor(float factor = 1.0) { Orxonox::getSingleton()->timefactor_ = factor; }
+      static inline void slomo(float factor) { Orxonox::setTimeFactor(factor); }
+      static void setTimeFactor(float factor = 1.0);
       static inline float getTimeFactor() { return Orxonox::getSingleton()->timefactor_; }
       static inline void exit() { Orxonox::getSingleton()->abortRequest(); }
@@ -93,9 +92,9 @@
     private:
       GraphicsEngine*       ogre_;          //!< our dearest graphics engine <3
+      Level*                startLevel_;    //!< current hard coded default level
+      Level*                hud_;           //!< 'level' object fo the HUD
+      Radar*                radar_;         //!< represents the Radar (not the HUD part)
       //audio::AudioManager*  auMan_;         //!< audio manager
       Ogre::Timer*          timer_;         //!< Main loop timer
-      // TODO: make this a config-value by creating a config class for orxonox
-      float                 frameSmoothingTime_;
-      HUD*                  orxonoxHUD_;
       bool                  bAbort_;        //!< aborts the render loop if true
       float                 timefactor_;    //!< A factor to change the gamespeed
Index: code/branches/input/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/input/src/orxonox/OrxonoxPrereqs.h	(revision 1623)
+++ code/branches/input/src/orxonox/OrxonoxPrereqs.h	(revision 1629)
@@ -60,50 +60,71 @@
 //-----------------------------------------------------------------------
 
-namespace orxonox {
-  class GraphicsEngine;
-  class Orxonox;
+namespace orxonox
+{
+    namespace LODParticle
+    {
+        enum LOD
+        {
+            off = 0,
+            low = 1,
+            normal = 2,
+            high = 3
+        };
+    }
 
-  // objects
-  class Ambient;
-  class Camera;
-  class Explosion;
-  class Fighter;
-  class Model;
-  class NPC;
-  class Projectile;
-  class Skybox;
-  class SpaceShip;
-  class SpaceShipAI;
-  class WorldEntity;
+    class GraphicsEngine;
+    class Orxonox;
 
-  class AmmunitionDump;
-  class Bullet;
-  class BulletManager;
-  class BaseWeapon;
-  class BarrelGun;
-  class WeaponStation;
+    class RadarViewable;
+    class Radar;
+    class RadarListener;
 
-  // tools
-  class BillboardSet;
-  class Light;
-  class Mesh;
-  template <class T>
-  class Timer;
-  class TimerBase;
+    // objects
+    class Ambient;
+    class Backlight;
+    class Camera;
+    class Fighter;
+    class Model;
+    class NPC;
+    class ParticleSpawner;
+    class Skybox;
+    class SpaceShip;
+    class SpaceShipAI;
+    class WorldEntity;
 
-  // particle
-  class ParticleInterface;
+    class Projectile;
+    class BillboardProjectile;
+    class RotatingProjectile;
+    class ParticleProjectile;
 
-  // hud
-  class BarOverlayElement;
-  class HUD;
-  class Navigation;
-  class RadarObject;
-  class RadarOverlayElement;
+    // tools
+    class BillboardSet;
+    class Light;
+    class Mesh;
+    class ParticleInterface;
+    template <class T>
+    class Timer;
 
-  //console
-  class InGameConsole;
+    // overlays
+    class BarColour;
+    class DebugFPSText;
+    class DebugRTRText;
+    class HUDBar;
+    class HUDNavigation;
+    class HUDRadar;
+    class HUDSpeedBar;
+    class InGameConsole;
+    class OrxonoxOverlay;
+    class OverlayGroup;
+    class OverlayText;
 }
 
+namespace Ogre
+{
+    // some got forgotten in OgrePrerequisites
+    class BorderPanelOverlayElement;
+    class PanelOverlayElement;
+    class TextAreaOverlayElement;
+}
 
 #endif /* _OrxonoxPrereqs_H__ */
Index: code/branches/input/src/orxonox/OrxonoxStableHeaders.h
===================================================================
--- code/branches/input/src/orxonox/OrxonoxStableHeaders.h	(revision 1623)
+++ code/branches/input/src/orxonox/OrxonoxStableHeaders.h	(revision 1629)
@@ -37,5 +37,5 @@
 #include "util/OrxonoxPlatform.h"
 
-#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
+#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && 0
 
 // including std headers here is useless since they're already precompiled
@@ -112,9 +112,9 @@
 #include "network/Synchronisable.h"
 
-#include "tools/Mesh.h"
-#include "tools/Timer.h"
-#include "objects/Model.h"
-#include "objects/Tickable.h"
-#include "objects/WorldEntity.h"
+//#include "tools/Mesh.h"
+//#include "tools/Timer.h"
+//#include "objects/Model.h"
+//#include "objects/Tickable.h"
+//#include "objects/WorldEntity.h"
 
 #endif /* Compiler MSVC */
Index: code/branches/input/src/orxonox/Radar.cc
===================================================================
--- code/branches/input/src/orxonox/Radar.cc	(revision 1629)
+++ code/branches/input/src/orxonox/Radar.cc	(revision 1629)
@@ -0,0 +1,211 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      Felix Schulthess
+ *
+ */
+
+/**
+    @file
+    @brief
+*/
+
+#include "OrxonoxStableHeaders.h"
+#include "Radar.h"
+#include <float.h>
+#include "objects/WorldEntity.h"
+#include "objects/SpaceShip.h"
+#include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "RadarListener.h"
+
+namespace orxonox
+{
+    SetConsoleCommand(Radar, cycleNavigationFocus, true).setAccessLevel(AccessLevel::User);
+    SetConsoleCommand(Radar, releaseNavigationFocus, true).setAccessLevel(AccessLevel::User);
+
+    Radar* Radar::instance_s = 0;
+
+    Radar::Radar()
+        : focus_(0)
+        , objectTypeCounter_(0)
+    {
+        assert(instance_s == 0);
+        instance_s = this;
+
+        // TODO: make this mapping configurable. Maybe there's a possibility with self configured
+        //       configValues..
+        this->objectTypes_["Asteroid"] = RadarViewable::Dot;
+        this->objectTypes_["SpaceShip"] = RadarViewable::Square;
+        this->objectTypes_["AsdfQwerty"] = RadarViewable::Triangle;
+
+        /*WorldEntity* object;
+        object = new WorldEntity();
+        object->setPosition(2000.0, 0.0, 0.0);
+        addRadarObject(object, ColourValue(0.5, 0, 0, 1));
+        object = new WorldEntity();
+        object->setPosition(0.0, 2000.0, 0.0);
+        addRadarObject(object, ColourValue(0.5, 0, 0, 1));
+        object = new WorldEntity();
+        object->setPosition(0.0, 0.0, 2000.0);
+        addRadarObject(object, ColourValue(0.5, 0, 0, 1));
+        object = new WorldEntity();
+        object->setPosition(10000.0,16000.0,0.0);
+        addRadarObject(object);*/
+
+    }
+
+    Radar::~Radar()
+    {
+        instance_s = 0;
+    }
+
+    const RadarViewable* Radar::getFocus()
+    {
+        return *(this->itFocus_);
+    }
+
+    RadarViewable::Shape Radar::addObjectDescription(const std::string name)
+    {
+        std::map<std::string, RadarViewable::Shape>::iterator it = this->objectTypes_.find(name);
+        if (it == this->objectTypes_.end())
+            return this->objectTypes_[name] = RadarViewable::Square; // default, configure!!
+        else
+            return this->objectTypes_[name];
+    }
+
+
+    void Radar::tick(float dt)
+    {
+        if (this->focus_ != *(this->itFocus_))
+        {
+            // focus object was deleted, release focus
+            this->focus_ = 0;
+            this->itFocus_ = 0;
+        }
+
+        for (Iterator<RadarListener> itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
+        {
+            (*itListener)->radarTick(dt);
+
+            for (Iterator<RadarViewable> itElement = ObjectList<RadarViewable>::begin(); itElement; ++itElement)
+            {
+                if ((*itElement) != SpaceShip::getLocalShip() && (*itListener)->getRadarSensitivity() > (*itElement)->getRadarObjectCamouflage())
+                    (*itListener)->displayObject(*itElement, *itElement == this->focus_);
+            }
+        }
+    }
+
+    void Radar::cycleFocus()
+    {
+        if (*(ObjectList<RadarViewable>::begin()) == 0)
+        {
+            // list is empty
+            this->itFocus_ = 0;
+            this->focus_ = 0;
+        }
+        else
+        {
+            Vector3 localPosition = SpaceShip::getLocalShip()->getPosition();
+            Vector3 targetPosition = localPosition;
+            if (*(this->itFocus_))
+                targetPosition = this->itFocus_->getWorldPosition();
+
+            // find the closed object further away than targetPosition
+            float currentDistance = localPosition.squaredDistance(targetPosition);
+            float nextDistance = FLT_MAX;
+            float minimumDistance = FLT_MAX;
+            Iterator<RadarViewable> itFallback = 0;
+
+            for (Iterator<RadarViewable> it = ObjectList<RadarViewable>::begin(); it; ++it)
+            {
+                if (*it == SpaceShip::getLocalShip())
+                    continue;
+
+                float targetDistance = localPosition.squaredDistance((*it)->getWorldPosition());
+                if (targetDistance > currentDistance && targetDistance < nextDistance)
+                {
+                    this->itFocus_ = it;
+                    nextDistance = targetDistance;
+                }
+                if (targetDistance < minimumDistance)
+                {
+                    itFallback = it;
+                    minimumDistance = targetDistance;
+                }
+            }
+
+            if (nextDistance == FLT_MAX)
+            {
+                // we already had the furthest object
+                this->itFocus_ = itFallback;
+                this->focus_ = *itFallback;
+            }
+            else
+            {
+                this->focus_ = *(this->itFocus_);
+            }
+        }
+    }
+
+    void Radar::releaseFocus()
+    {
+        this->itFocus_ = 0;
+        this->focus_ = 0;
+    }
+
+    void Radar::listObjects() const
+    {
+        COUT(3) << "List of RadarObjects:\n";
+        // iterate through all Radar Objects
+        unsigned int i = 0;
+        for (Iterator<RadarViewable> it = ObjectList<RadarViewable>::start(); it; ++it, ++i)
+        {
+            COUT(3) << i++ << ": " << (*it)->getWorldPosition() << std::endl;
+        }
+    }
+
+
+    /*static*/ Radar& Radar::getInstance()
+    {
+        assert(instance_s);
+        return *instance_s;
+    }
+
+    /*static*/ void Radar::cycleNavigationFocus()
+    {
+        // avoid using getInstance because of the assert().
+        // User might call this fuction even if HUDNavigation doesn't exist.
+        if (instance_s)
+            instance_s->cycleFocus();
+    }
+
+    /*static*/ void Radar::releaseNavigationFocus()
+    {
+        // avoid using getInstance because of the assert().
+        // User might call this fuction even if HUDNavigation doesn't exist.
+        if (instance_s)
+            instance_s->releaseFocus();
+    }
+}
Index: code/branches/input/src/orxonox/Radar.h
===================================================================
--- code/branches/input/src/orxonox/Radar.h	(revision 1629)
+++ code/branches/input/src/orxonox/Radar.h	(revision 1629)
@@ -0,0 +1,91 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      Felix Schulthess
+ *
+ */
+
+/**
+    @file
+    @brief
+*/
+
+#ifndef _Radar_H__
+#define _Radar_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <string>
+#include "core/Iterator.h"
+#include "core/OrxonoxClass.h"
+#include "objects/Tickable.h"
+#include "RadarViewable.h"
+
+namespace orxonox
+{
+    /**
+    @brief This class merely ensures that no one can inherit from Radar.
+    */
+    class _OrxonoxExport RadarBase
+    {
+    private:
+        friend class Radar;
+        RadarBase() { }
+    };
+ 
+    class _OrxonoxExport Radar : public Tickable, private virtual RadarBase
+    {
+    public:
+        Radar();
+        ~Radar();
+
+        const RadarViewable* getFocus();
+        RadarViewable::Shape addObjectDescription(const std::string name);
+
+        void listObjects() const;
+
+        static Radar& getInstance();
+        static Radar* getInstancePtr() { return instance_s; }
+
+        static void cycleNavigationFocus();
+        static void releaseNavigationFocus();
+
+    private:
+        Radar(Radar& instance);
+        void tick(float dt);
+
+        void releaseFocus();
+        void updateFocus();
+        void cycleFocus();
+
+        Iterator<RadarViewable> itFocus_;
+        RadarViewable* focus_;
+        std::map<std::string, RadarViewable::Shape> objectTypes_;
+        int objectTypeCounter_; 
+
+        static Radar* instance_s;
+    };
+}
+#endif /* _Radar_H__ */
Index: code/branches/input/src/orxonox/RadarListener.cc
===================================================================
--- code/branches/input/src/orxonox/RadarListener.cc	(revision 1629)
+++ code/branches/input/src/orxonox/RadarListener.cc	(revision 1629)
@@ -0,0 +1,39 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "RadarListener.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    RadarListener::RadarListener()
+    {
+        RegisterRootObject(RadarListener);
+    }
+}
Index: code/branches/input/src/orxonox/RadarListener.h
===================================================================
--- code/branches/input/src/orxonox/RadarListener.h	(revision 1629)
+++ code/branches/input/src/orxonox/RadarListener.h	(revision 1629)
@@ -0,0 +1,49 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _RadarListener_H__
+#define _RadarListener_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport RadarListener : virtual public OrxonoxClass
+    {
+    public:
+        RadarListener();
+        virtual ~RadarListener() { }
+
+        virtual void displayObject(RadarViewable* viewable, bool bIsMarked) = 0;
+        virtual float getRadarSensitivity() const = 0;
+        virtual void radarTick(float dt) = 0;
+    };
+}
+
+#endif /* _RadarListener_H__ */
Index: code/branches/input/src/orxonox/RadarViewable.cc
===================================================================
--- code/branches/input/src/orxonox/RadarViewable.cc	(revision 1629)
+++ code/branches/input/src/orxonox/RadarViewable.cc	(revision 1629)
@@ -0,0 +1,73 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "RadarViewable.h"
+#include "core/Debug.h"
+#include "core/CoreIncludes.h"
+#include "objects/WorldEntity.h"
+#include "Radar.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor.
+    */
+    RadarViewable::RadarViewable()
+        : radarObject_(0)
+        , radarObjectCamouflage_(0.0f)
+        , radarObjectType_(Dot)
+        , radarObjectDescription_("staticObject")
+    {
+        RegisterRootObject(RadarViewable);
+    }
+
+    void RadarViewable::setRadarObjectDescription(const std::string& str)
+    {
+        Radar* radar = Radar::getInstancePtr();
+        if (radar)
+            this->radarObjectType_ = radar->addObjectDescription(str);
+        else
+        {
+            CCOUT(2) << "Attempting to access the radar, but the radar is non existent." << std::endl;
+        }
+        this->radarObjectDescription_ = str;
+    }
+
+    const Vector3& RadarViewable::getWorldPosition() const
+    {
+        validate();
+        return this->radarObject_->getWorldPosition();
+    }
+
+    Vector3 RadarViewable::getOrientedVelocity() const
+    {
+        validate();
+        return this->radarObject_->getOrientation() * this->radarObject_->getVelocity();
+    }
+}
Index: code/branches/input/src/orxonox/RadarViewable.h
===================================================================
--- code/branches/input/src/orxonox/RadarViewable.h	(revision 1629)
+++ code/branches/input/src/orxonox/RadarViewable.h	(revision 1629)
@@ -0,0 +1,86 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _RadarViewable_H__
+#define _RadarViewable_H__
+
+#include "OrxonoxPrereqs.h"
+#include <string>
+#include "util/Math.h"
+#include "core/Debug.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    /**
+    @brief Interface for receiving window events.
+    */
+    class _OrxonoxExport RadarViewable : virtual public OrxonoxClass
+    {
+    public:
+        enum Shape
+        {
+            Square,
+            Dot,
+            Triangle
+        };
+
+    public:
+        RadarViewable();
+        virtual ~RadarViewable() { }
+
+        float getRadarObjectCamouflage() const { return this->radarObjectCamouflage_; }
+        void setRadarObjectCamouflage(float camouflage) { this->radarObjectCamouflage_ = camouflage; }
+
+        const ColourValue& getRadarObjectColour() const { return this->radarObjectColour_; }
+        void setRadarObjectColour(const ColourValue& colour) { this->radarObjectColour_ = colour; }
+
+        const std::string& getRadarObjectDescription() const { return this->radarObjectDescription_; }
+        void setRadarObjectDescription(const std::string& str);
+
+        const WorldEntity* getWorldEntity() const { return this->radarObject_; }
+        const Vector3& getWorldPosition() const;
+        Vector3 getOrientedVelocity() const;
+
+        Shape getRadarObjectType() const { return this->radarObjectType_; }
+
+    protected:
+        WorldEntity* radarObject_;
+
+    private:
+        void validate() const { if (!this->radarObject_)
+        { COUT(1) << "Assertation: Every RadarViewable has to be assigned a WorldEntity pointer!" << std::endl; assert(0); } }
+
+        float radarObjectCamouflage_;
+        Shape radarObjectType_;
+        std::string radarObjectDescription_;
+        ColourValue radarObjectColour_;
+    };
+}
+
+#endif /* _RadarViewable_H__ */
Index: code/branches/input/src/orxonox/objects/Ambient.cc
===================================================================
--- code/branches/input/src/orxonox/objects/Ambient.cc	(revision 1623)
+++ code/branches/input/src/orxonox/objects/Ambient.cc	(revision 1629)
@@ -73,27 +73,10 @@
       
     }
-    
-    void Ambient::loadParams(TiXmlElement* xmlElem)
+
+    void Ambient::setAmbientLight(const ColourValue& colour)
     {
-    	if (xmlElem->Attribute("colourvalue"))
-    	{
-        SubString colourvalues(xmlElem->Attribute("colourvalue"), ',');
-
-	    	float r, g, b;
-        convertValue<std::string, float>(&r, colourvalues[0]);
-        convertValue<std::string, float>(&g, colourvalues[1]);
-        convertValue<std::string, float>(&b, colourvalues[2]);
-
-	    	this->setAmbientLight(ColourValue(r, g, b));
-
-	    	COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b  << std::endl << std::endl;
-    	}
-   }
-
-   void Ambient::setAmbientLight(const ColourValue& colour)
-   {
-    	GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
+	    GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
       ambientLight_=colour;	
-   }
+    }
 
     /**
Index: code/branches/input/src/orxonox/objects/Ambient.h
===================================================================
--- code/branches/input/src/orxonox/objects/Ambient.h	(revision 1623)
+++ code/branches/input/src/orxonox/objects/Ambient.h	(revision 1629)
@@ -44,5 +44,4 @@
             virtual ~Ambient();
 
-            void loadParams(TiXmlElement* xmlElem);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setAmbientLight(const ColourValue& colour);
Index: code/branches/input/src/orxonox/objects/Backlight.cc
===================================================================
--- code/branches/input/src/orxonox/objects/Backlight.cc	(revision 1629)
+++ code/branches/input/src/orxonox/objects/Backlight.cc	(revision 1629)
@@ -0,0 +1,154 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Backlight.h"
+
+#include <OgreBillboard.h>
+#include <OgreRibbonTrail.h>
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/Executor.h"
+#include "util/Math.h"
+#include "GraphicsEngine.h"
+#include "Orxonox.h"
+
+namespace orxonox
+{
+    CreateFactory(Backlight);
+
+    float Backlight::timeFactor_s = 1.0;
+
+    Backlight::Backlight(float maxspeed, float brakingtime, float scale)
+    {
+        RegisterObject(Backlight);
+
+        this->setConfigValues();
+        this->traillength_ = 1;
+
+        this->getNode()->setInheritScale(false);
+
+        this->billboard_.setBillboardSet("Flares/backlightflare");
+        this->attachObject(this->billboard_.getBillboardSet());
+
+        this->ribbonTrail_ = GraphicsEngine::getSingleton().getSceneManager()->createRibbonTrail(this->getName() + "RibbonTrail");
+        this->ribbonTrailNode_ = GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName() + "RibbonTrailNode");
+        this->ribbonTrailNode_->attachObject(this->ribbonTrail_);
+        this->ribbonTrail_->addNode(this->getNode());
+
+        this->configure(maxspeed, brakingtime, scale);
+
+        this->ribbonTrail_->setTrailLength(this->maxTraillength_);
+        this->ribbonTrail_->setMaterialName("Trail/backlighttrail");
+
+        this->setTimeFactor(Orxonox::getSingleton()->getTimeFactor());
+    }
+
+    Backlight::~Backlight()
+    {
+        if (this->isInitialized())
+        {
+            this->detachObject(this->billboard_.getBillboardSet());
+            GraphicsEngine::getSingleton().getSceneManager()->destroySceneNode(this->getName() + "RibbonTrailNode");
+            GraphicsEngine::getSingleton().getSceneManager()->destroyRibbonTrail(this->ribbonTrail_);
+        }
+    }
+
+    void Backlight::setConfigValues()
+    {
+        SetConfigValue(maxLifeTime_, 4.0).description("The maximal amount of seconds the trail behind a SpaceShip stays visible");
+        SetConfigValue(trailSegmentLength_, 50).description("The length of one segment of the trail behind a SpaceShip (lower values make it more smooth)");
+        SetConfigValue(width_, 7.0).description("The width of the trail");
+    }
+
+    void Backlight::setTimeFactor(float factor)
+    {
+        Backlight::timeFactor_s = factor;
+        float change = Backlight::timeFactor_s / this->maxLifeTime_;
+        this->ribbonTrail_->setWidthChange(0, this->width_ * change);
+        this->updateColourChange();
+    }
+
+    void Backlight::updateColourChange()
+    {
+        this->ribbonTrail_->setColourChange(0, ColourValue(0, 0, 0, this->maxTraillength_ / this->traillength_ / this->maxLifeTime_ * Backlight::timeFactor_s));
+    }
+
+    void Backlight::tick(float dt)
+    {
+        WorldEntity::tick(dt);
+
+        if (this->isActive())
+        {
+            if (this->traillength_ < this->maxTraillength_)
+            {
+                this->traillength_ = min<float>(this->maxTraillength_, this->traillength_ + dt * this->maxTraillength_ / this->maxLifeTime_);
+                this->updateColourChange();
+            }
+        }
+        else
+        {
+            if (this->traillength_ > 1)
+            {
+                this->traillength_ = max<float>(1, this->traillength_ - this->brakefactor_ * dt * this->maxTraillength_ / this->maxLifeTime_);
+                this->updateColourChange();
+            }
+        }
+
+        this->ribbonTrail_->setTrailLength(this->traillength_);
+    }
+
+    void Backlight::setColour(const ColourValue& colour)
+    {
+        this->billboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
+        this->ribbonTrail_->setInitialColour(0, ColourValue(colour.r / 4 + 0.75, colour.g / 4 + 0.75, colour.b / 4 + 0.75));
+    }
+
+    void Backlight::configure(float maxspeed, float brakingtime, float scale)
+    {
+        this->maxTraillength_ = this->maxLifeTime_ * maxspeed;
+        this->maxTrailsegments_ = (size_t)(this->maxTraillength_ / this->trailSegmentLength_);
+        this->ribbonTrail_->setMaxChainElements(this->maxTrailsegments_);
+        this->ribbonTrail_->setTrailLength(this->traillength_ = 2 * this->maxTrailsegments_);
+
+        this->brakefactor_ = this->maxLifeTime_ / brakingtime;
+
+        this->scale(scale);
+        this->ribbonTrail_->setInitialWidth(0, this->width_ * scale);
+        this->ribbonTrail_->setWidthChange(0, this->width_ * scale / this->maxLifeTime_ * Backlight::timeFactor_s);
+    }
+
+    void Backlight::changedVisibility()
+    {
+        WorldEntity::changedVisibility();
+
+        this->billboard_.setVisible(this->isVisible());
+        this->ribbonTrail_->setVisible(this->isVisible());
+    }
+}
Index: code/branches/input/src/orxonox/objects/Backlight.h
===================================================================
--- code/branches/input/src/orxonox/objects/Backlight.h	(revision 1629)
+++ code/branches/input/src/orxonox/objects/Backlight.h	(revision 1629)
@@ -0,0 +1,75 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Backlight_H__
+#define _Backlight_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "WorldEntity.h"
+#include "tools/Timer.h"
+#include "tools/BillboardSet.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Backlight : public WorldEntity
+    {
+        public:
+            Backlight(float maxspeed = 1.0, float brakingtime = 1.0, float scale = 1.0);
+            virtual ~Backlight();
+
+            void setConfigValues();
+            virtual void tick(float dt);
+            virtual void changedVisibility();
+
+            void setColour(const ColourValue& colour);
+            void setTimeFactor(float factor);
+
+        private:
+            void configure(float maxspeed, float brakingtime, float scale = 1);
+            void updateColourChange();
+
+            static float timeFactor_s;
+            BillboardSet billboard_;
+            Ogre::SceneNode* ribbonTrailNode_;
+            Ogre::RibbonTrail* ribbonTrail_;
+
+            float maxLifeTime_;
+            float trailSegmentLength_;
+            float width_;
+
+            float brakefactor_;
+
+            float maxTraillength_;
+            float traillength_;
+
+            size_t maxTrailsegments_;
+    };
+}
+
+#endif /* _Backlight_H__ */
Index: code/branches/input/src/orxonox/objects/BillboardProjectile.cc
===================================================================
--- code/branches/input/src/orxonox/objects/BillboardProjectile.cc	(revision 1629)
+++ code/branches/input/src/orxonox/objects/BillboardProjectile.cc	(revision 1629)
@@ -0,0 +1,68 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "BillboardProjectile.h"
+
+#include <OgreBillboard.h>
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(BillboardProjectile);
+
+    BillboardProjectile::BillboardProjectile(SpaceShip* owner) : Projectile(owner)
+    {
+        RegisterObject(BillboardProjectile);
+
+        if (this->owner_)
+        {
+            this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
+            this->attachObject(this->billboard_.getBillboardSet());
+            this->scale(0.5);
+        }
+    }
+
+    BillboardProjectile::~BillboardProjectile()
+    {
+        if (this->isInitialized() && this->owner_)
+            this->detachObject(this->billboard_.getBillboardSet());
+    }
+
+    void BillboardProjectile::setColour(const ColourValue& colour)
+    {
+        this->billboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
+    }
+
+    void BillboardProjectile::changedVisibility()
+    {
+        Projectile::changedVisibility();
+        this->billboard_.setVisible(this->isVisible());
+    }
+}
Index: code/branches/input/src/orxonox/objects/BillboardProjectile.h
===================================================================
--- code/branches/input/src/orxonox/objects/BillboardProjectile.h	(revision 1629)
+++ code/branches/input/src/orxonox/objects/BillboardProjectile.h	(revision 1629)
@@ -0,0 +1,54 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _BillboardProjectile_H__
+#define _BillboardProjectile_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "Projectile.h"
+#include "tools/BillboardSet.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport BillboardProjectile : public Projectile
+    {
+        public:
+            BillboardProjectile(SpaceShip* owner = 0);
+            virtual ~BillboardProjectile();
+
+            virtual void setColour(const ColourValue& colour);
+            virtual void changedVisibility();
+
+        private:
+            BillboardSet billboard_;
+    };
+}
+
+#endif /* _BillboardProjectile_H__ */
Index: code/branches/input/src/orxonox/objects/Explosion.cc
===================================================================
--- code/branches/input/src/orxonox/objects/Explosion.cc	(revision 1623)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   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
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Explosion.h"
-
-#include <OgreParticleSystem.h>
-#include <OgreSceneManager.h>
-#include <OgreSceneNode.h>
-
-#include "core/CoreIncludes.h"
-#include "core/Executor.h"
-
-#include "util/Math.h"
-#include "GraphicsEngine.h"
-#include "particle/ParticleInterface.h"
-
-namespace orxonox
-{
-    CreateFactory(Explosion);
-
-    Explosion::Explosion(WorldEntity* owner) :
-      lifetime_(0.4),
-      particle_(0)
-    {
-        RegisterObject(Explosion);
-
-        if (owner)
-        {
-            this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Explosion::destroyObject)));
-
-            Vector3 position = owner->getNode()->getWorldPosition();
-
-            this->particle_ = new ParticleInterface(GraphicsEngine::getSingleton().getSceneManager(), "explosion" + this->getName(), "Orxonox/treibwerk");
-            this->particle_->getParticleSystem()->setParameter("local_space", "true");
-            this->particle_->newEmitter();
-            this->particle_->setPositionOfEmitter(0, Vector3::ZERO);
-            this->particle_->setPositionOfEmitter(1, Vector3::ZERO);
-            this->particle_->setColour(ColourValue(1.0, 0.8, 0.2));
-
-            this->setPosition(position);
-            this->scale(2);
-
-            this->particle_->addToSceneNode(this->getNode());
-        }
-    }
-
-    Explosion::~Explosion()
-    {
-        if (this->particle_)
-        {
-            this->particle_->detachFromSceneNode();
-            delete this->particle_;
-        }
-    };
-    
-    /*bool Explosion::create(){
-      if(!WorldEntity::create())
-        return false;
-      classID=this->getIdentifier()->getNetworkID();
-    }*/
-
-    void Explosion::destroyObject()
-    {
-        delete this;
-    }
-}
Index: code/branches/input/src/orxonox/objects/Explosion.h
===================================================================
--- code/branches/input/src/orxonox/objects/Explosion.h	(revision 1623)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   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
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _Explosion_H__
-#define _Explosion_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "WorldEntity.h"
-#include "../tools/Timer.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Explosion : public WorldEntity
-    {
-        public:
-            Explosion(WorldEntity* owner = 0);
-            virtual ~Explosion();
-            void destroyObject();
-            virtual bool create(){return WorldEntity::create();}
-
-        private:
-            Timer<Explosion> destroyTimer_;
-            float lifetime_;
-            ParticleInterface* particle_;
-    };
-}
-
-#endif /* _Explosion_H__ */
Index: code/branches/input/src/orxonox/objects/Model.cc
===================================================================
--- code/branches/input/src/orxonox/objects/Model.cc	(revision 1623)
+++ code/branches/input/src/orxonox/objects/Model.cc	(revision 1629)
@@ -53,10 +53,11 @@
     Model::~Model()
     {
+        if (this->isInitialized() && (this->meshSrc_ != "") && (this->meshSrc_.size() > 0))
+            this->detachObject(this->mesh_.getEntity());
     }
 
     /**
         @brief XML loading and saving.
-    @p
-    aram xmlelement The XML-element
+        @param xmlelement The XML-element
         @param loading Loading (true) or saving (false)
         @return The XML-element
@@ -94,3 +95,10 @@
       registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING);
     }
+
+    void Model::changedVisibility()
+    {
+        WorldEntity::changedVisibility();
+        if (this->isInitialized())
+            this->mesh_.setVisible(this->isVisible());
+    }
 }
Index: code/branches/input/src/orxonox/objects/Model.h
===================================================================
--- code/branches/input/src/orxonox/objects/Model.h	(revision 1623)
+++ code/branches/input/src/orxonox/objects/Model.h	(revision 1629)
@@ -44,4 +44,5 @@
             virtual ~Model();
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void changedVisibility();
             void setMesh(const std::string& meshname);
             virtual bool create();
Index: code/branches/input/src/orxonox/objects/NPC.cc
===================================================================
--- code/branches/input/src/orxonox/objects/NPC.cc	(revision 1623)
+++ code/branches/input/src/orxonox/objects/NPC.cc	(revision 1629)
@@ -45,9 +45,4 @@
   NPC::~NPC()
   {
-  }
-
-  void NPC::loadParams(TiXmlElement* xmlElem)
-  {
-    Model::loadParams(xmlElem);
   }
 
Index: code/branches/input/src/orxonox/objects/NPC.h
===================================================================
--- code/branches/input/src/orxonox/objects/NPC.h	(revision 1623)
+++ code/branches/input/src/orxonox/objects/NPC.h	(revision 1629)
@@ -48,5 +48,4 @@
       NPC();
       virtual ~NPC();
-      virtual void loadParams(TiXmlElement* xmlElem);
       void tick(float dt);
       void update();
Index: code/branches/input/src/orxonox/objects/ParticleProjectile.cc
===================================================================
--- code/branches/input/src/orxonox/objects/ParticleProjectile.cc	(revision 1629)
+++ code/branches/input/src/orxonox/objects/ParticleProjectile.cc	(revision 1629)
@@ -0,0 +1,67 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "ParticleProjectile.h"
+
+#include "SpaceShip.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(ParticleProjectile);
+
+    ParticleProjectile::ParticleProjectile(SpaceShip* owner) : BillboardProjectile(owner)
+    {
+        RegisterObject(ParticleProjectile);
+
+        if (this->owner_)
+        {
+            this->particles_ = new ParticleInterface("Orxonox/shot2", LODParticle::normal);
+            this->particles_->addToSceneNode(this->getNode());
+            this->particles_->getAllEmitters()->setDirection(-this->owner_->getInitialDir());
+            this->particles_->setKeepParticlesInLocalSpace(true);
+        }
+        else
+        {
+            this->particles_ = 0;
+        }
+    }
+
+    ParticleProjectile::~ParticleProjectile()
+    {
+        if (this->isInitialized() && this->particles_)
+            delete this->particles_;
+    }
+
+    void ParticleProjectile::changedVisibility()
+    {
+        BillboardProjectile::changedVisibility();
+        this->particles_->setEnabled(this->isVisible());
+    }
+}
Index: code/branches/input/src/orxonox/objects/ParticleProjectile.h
===================================================================
--- code/branches/input/src/orxonox/objects/ParticleProjectile.h	(revision 1629)
+++ code/branches/input/src/orxonox/objects/ParticleProjectile.h	(revision 1629)
@@ -0,0 +1,52 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ParticleProjectile_H__
+#define _ParticleProjectile_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "BillboardProjectile.h"
+#include "tools/ParticleInterface.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ParticleProjectile : public BillboardProjectile
+    {
+        public:
+            ParticleProjectile(SpaceShip* owner = 0);
+            virtual ~ParticleProjectile();
+            virtual void changedVisibility();
+
+        private:
+            ParticleInterface* particles_;
+    };
+}
+
+#endif /* _ParticleProjectile_H__ */
Index: code/branches/input/src/orxonox/objects/ParticleSpawner.cc
===================================================================
--- code/branches/input/src/orxonox/objects/ParticleSpawner.cc	(revision 1629)
+++ code/branches/input/src/orxonox/objects/ParticleSpawner.cc	(revision 1629)
@@ -0,0 +1,105 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "ParticleSpawner.h"
+
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "tools/ParticleInterface.h"
+#include "GraphicsEngine.h"
+
+namespace orxonox
+{
+    CreateFactory(ParticleSpawner);
+
+    ParticleSpawner::ParticleSpawner()
+    {
+        RegisterObject(ParticleSpawner);
+        this->particle_ = 0;
+    }
+
+    ParticleSpawner::ParticleSpawner(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float startdelay, float destroydelay, const Vector3& direction)
+    {
+        RegisterObject(ParticleSpawner);
+        this->setParticle(templateName, detaillevel, lifetime, startdelay, destroydelay, direction);
+    }
+
+    void ParticleSpawner::setParticle(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float startdelay, float destroydelay, const Vector3& direction)
+    {
+        ExecutorMember<ParticleSpawner>* executor = createExecutor(createFunctor(&ParticleSpawner::createParticleSpawner));
+        this->destroydelay_ = destroydelay;
+        executor->setDefaultValues(lifetime);
+        this->timer_.setTimer(startdelay, false, this, executor);
+        this->particle_ = new ParticleInterface(templateName, detaillevel);
+        this->particle_->addToSceneNode(this->getNode());
+        this->particle_->setEnabled(false);
+        if (direction != Vector3::ZERO)
+        {
+            this->particle_->getAllEmitters()->setDirection(direction);
+        }
+    }
+
+    ParticleSpawner::~ParticleSpawner()
+    {
+        if (this->isInitialized() && this->particle_)
+        {
+            this->particle_->detachFromSceneNode();
+            delete this->particle_;
+        }
+    };
+
+    void ParticleSpawner::destroy()
+    {
+        this->setPosition(this->getNode()->getParent()->getPosition());
+        this->getNode()->getParent()->removeChild(this->getNode());
+        GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->addChild(this->getNode());
+        if (this->particle_)
+            this->particle_->setEnabled(false);
+        if (!this->timer_.isActive() || this->timer_.getRemainingTime() > this->destroydelay_)
+            this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
+    }
+
+    void ParticleSpawner::createParticleSpawner(float lifetime)
+    {
+        this->particle_->setEnabled(true);
+        if (lifetime != 0)
+            this->timer_.setTimer(lifetime, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
+    }
+
+    void ParticleSpawner::destroyParticleSpawner()
+    {
+        delete this;
+    }
+
+    void ParticleSpawner::setVisible(bool visible)
+    {
+        if (this->particle_)
+            this->particle_->setEnabled(visible);
+    }
+}
Index: code/branches/input/src/orxonox/objects/ParticleSpawner.h
===================================================================
--- code/branches/input/src/orxonox/objects/ParticleSpawner.h	(revision 1629)
+++ code/branches/input/src/orxonox/objects/ParticleSpawner.h	(revision 1629)
@@ -0,0 +1,63 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ParticleSpawner_H__
+#define _ParticleSpawner_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "WorldEntity.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ParticleSpawner : public WorldEntity
+    {
+        public:
+            ParticleSpawner();
+            ParticleSpawner(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime = 0, float startdelay = 0, float destroydelay = 0, const Vector3& direction = Vector3::ZERO);
+            virtual ~ParticleSpawner();
+            void destroy();
+
+            void setParticle(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime = 0, float startdelay = 0, float destroydelay = 0, const Vector3& direction = Vector3::ZERO);
+            inline ParticleInterface* getParticleInterface() const
+                { return this->particle_; }
+
+            void setVisible(bool visible);
+
+        private:
+            void createParticleSpawner(float lifetime);
+            void destroyParticleSpawner();
+
+            Timer<ParticleSpawner> timer_;
+            ParticleInterface* particle_;
+            float destroydelay_;
+    };
+}
+
+#endif /* _ParticleSpawner_H__ */
Index: code/branches/input/src/orxonox/objects/Projectile.cc
===================================================================
--- code/branches/input/src/orxonox/objects/Projectile.cc	(revision 1623)
+++ code/branches/input/src/orxonox/objects/Projectile.cc	(revision 1629)
@@ -35,25 +35,21 @@
 #include "core/Executor.h"
 #include "core/ConfigValueIncludes.h"
+#include "tools/ParticleInterface.h"
 
-#include "SpaceShip.h"
-#include "Explosion.h"
+#include "SpaceShipAI.h"
+#include "ParticleSpawner.h"
 #include "Model.h"
 
 namespace orxonox
 {
-    CreateFactory(Projectile);
+    float Projectile::speed_ = 5000;
 
-    float Projectile::speed_ = 0;
-
-    Projectile::Projectile(SpaceShip* owner) :
-      owner_(owner)
+    Projectile::Projectile(SpaceShip* owner) : owner_(owner)
     {
         RegisterObject(Projectile);
 
         this->setConfigValues();
-
-        this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
-        this->attachObject(this->billboard_.getBillboardSet());
-        this->scale(0.5);
+        this->explosionTemplateName_ = "Orxonox/explosion3";
+        this->smokeTemplateName_ = "Orxonox/smoke4";
 
         if (this->owner_)
@@ -63,9 +59,8 @@
             this->setPosition(this->owner_->getPosition());
             this->translate(Vector3(55, 0, 0), Ogre::Node::TS_LOCAL);
-            this->setVelocity(Vector3(1, 0, 0) * this->speed_);
+            this->setVelocity(this->owner_->getInitialDir() * this->speed_);
         }
 
         this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
-//        COUT(3) << this->classID << std::endl;
     }
 
@@ -76,8 +71,10 @@
     void Projectile::setConfigValues()
     {
-        SetConfigValue(lifetime_, 10.0).description("The time in seconds a projectile stays alive");
-        SetConfigValue(speed_, 2000.0).description("The speed of a projectile in units per second");
+        SetConfigValue(damage_, 15.0).description("The damage caused by the projectile");
+        SetConfigValue(lifetime_, 4.0).description("The time in seconds a projectile stays alive");
+        SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second");
 
-        this->setVelocity(Vector3(1, 0, 0) * this->speed_);
+	if(this->owner_)
+          this->setVelocity(this->owner_->getInitialDir() * this->speed_);
     }
 
@@ -85,4 +82,7 @@
     {
         WorldEntity::tick(dt);
+
+        if (!this->isActive())
+            return;
 
         float radius;
@@ -95,6 +95,14 @@
                 if (this->getPosition().squaredDistance(it->getPosition()) <= (radius*radius))
                 {
-                    Explosion *exp = new Explosion(this);
-                    exp->create();
+                    // hit
+                    if (it->isA(Class(SpaceShipAI)))
+                        ((SpaceShipAI*)(*it))->damage(this->damage_);
+                    ParticleSpawner* explosion = new ParticleSpawner(this->explosionTemplateName_, LODParticle::low, 2.0);
+                    explosion->setPosition(this->getPosition());
+                    explosion->create();
+                    ParticleSpawner* smoke = new ParticleSpawner(this->smokeTemplateName_, LODParticle::normal, 2.0, 0.0);
+                    smoke->setPosition(this->getPosition());
+//                    smoke->getParticleInterface()->setSpeedFactor(3.0);
+                    smoke->create();
                     delete this;
                     return;
@@ -108,8 +116,3 @@
         delete this;
     }
-
-    void Projectile::setColour(const ColourValue& colour)
-    {
-        this->billboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
-    }
 }
Index: code/branches/input/src/orxonox/objects/Projectile.h
===================================================================
--- code/branches/input/src/orxonox/objects/Projectile.h	(revision 1623)
+++ code/branches/input/src/orxonox/objects/Projectile.h	(revision 1629)
@@ -33,7 +33,5 @@
 
 #include "WorldEntity.h"
-#include "../tools/BillboardSet.h"
-#include "../tools/Timer.h"
-#include "util/Math.h"
+#include "tools/Timer.h"
 
 namespace orxonox
@@ -42,11 +40,8 @@
     {
         public:
-            Projectile(SpaceShip* owner = 0);
             virtual ~Projectile();
             void setConfigValues();
             void destroyObject();
             virtual void tick(float dt);
-            virtual bool create(){return WorldEntity::create();}
-            void setColour(const ColourValue& colour);
 
             static float getSpeed()
@@ -54,10 +49,13 @@
 
         protected:
+            Projectile(SpaceShip* owner = 0);
             SpaceShip* owner_;
 
         private:
-            BillboardSet billboard_;
+            std::string explosionTemplateName_;
+            std::string smokeTemplateName_;
             static float speed_;
             float lifetime_;
+            float damage_;
             Timer<Projectile> destroyTimer_;
     };
Index: code/branches/input/src/orxonox/objects/RotatingProjectile.cc
===================================================================
--- code/branches/input/src/orxonox/objects/RotatingProjectile.cc	(revision 1623)
+++ code/branches/input/src/orxonox/objects/RotatingProjectile.cc	(revision 1629)
@@ -37,5 +37,5 @@
     CreateFactory(RotatingProjectile);
 
-    RotatingProjectile::RotatingProjectile(SpaceShip* owner) : Projectile(owner)
+    RotatingProjectile::RotatingProjectile(SpaceShip* owner) : BillboardProjectile(owner)
     {
         RegisterObject(RotatingProjectile);
@@ -73,10 +73,20 @@
     void RotatingProjectile::tick(float dt)
     {
-        this->time_ += dt;
+        if (this->isActive())
+        {
+            this->time_ += dt;
 
-        this->rotatingNode1_->setPosition(0, 50 * sin(this->time_ * 20), 50 * cos(this->time_ * 20));
-        this->rotatingNode2_->setPosition(0, -50 * sin(this->time_ * 20), -50 * cos(this->time_ * 20));
+            this->rotatingNode1_->setPosition(0, 50 * sin(this->time_ * 20), 50 * cos(this->time_ * 20));
+            this->rotatingNode2_->setPosition(0, -50 * sin(this->time_ * 20), -50 * cos(this->time_ * 20));
+        }
 
         Projectile::tick(dt);
     }
+
+    void RotatingProjectile::changedVisibility()
+    {
+        BillboardProjectile::changedVisibility();
+        this->rotatingBillboard1_.setVisible(this->isVisible());
+        this->rotatingBillboard2_.setVisible(this->isVisible());
+    }
 }
Index: code/branches/input/src/orxonox/objects/RotatingProjectile.h
===================================================================
--- code/branches/input/src/orxonox/objects/RotatingProjectile.h	(revision 1623)
+++ code/branches/input/src/orxonox/objects/RotatingProjectile.h	(revision 1629)
@@ -2,11 +2,11 @@
 #define _RotatingProjectile_H__
 
-#include "../OrxonoxPrereqs.h"
+#include "OrxonoxPrereqs.h"
 #include "util/Math.h"
-#include "Projectile.h"
+#include "BillboardProjectile.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport RotatingProjectile : public Projectile/*, public network::Synchronisable*/
+    class _OrxonoxExport RotatingProjectile : public BillboardProjectile
     {
         public:
@@ -15,5 +15,5 @@
             void setConfigValues();
             virtual void tick(float dt);
-            virtual bool create(){return Projectile::create();}
+            virtual void changedVisibility();
 
         private:
Index: code/branches/input/src/orxonox/objects/Skybox.cc
===================================================================
--- code/branches/input/src/orxonox/objects/Skybox.cc	(revision 1623)
+++ code/branches/input/src/orxonox/objects/Skybox.cc	(revision 1629)
@@ -54,24 +54,14 @@
     }
 
-    void Skybox::loadParams(TiXmlElement* xmlElem)
+    void Skybox::setSkybox(const std::string& skyboxname)
     {
-    	if (xmlElem->Attribute("src"))
-    	{
-    		skyboxSrc_ = xmlElem->Attribute("src");
-        this->create();
+    	GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(true, skyboxname);
+    }
 
-	    	COUT(4) << "Loader: Set skybox: "<< skyboxSrc_ << std::endl << std::endl;
-    	}
-   }
+    void Skybox::setSkyboxSrc(const std::string& src)
+    {
+        this->skyboxSrc_ = src;
+    }
 
-   void Skybox::setSkybox(const std::string& skyboxname)
-   {
-    	GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(true, skyboxname);
-   }
-
-   void Skybox::setSkyboxSrc(const std::string& src){
-     skyboxSrc_ = src;
-   }
-   
     /**
         @brief XML loading and saving.
@@ -87,13 +77,20 @@
         create();
     }
-    
-    bool Skybox::create(){
-      this->setSkybox(skyboxSrc_);
-      return Synchronisable::create();
+
+    bool Skybox::create()
+    {
+        this->setSkybox(this->skyboxSrc_);
+        return Synchronisable::create();
     }
-    
-    void Skybox::registerAllVariables(){
-      registerVar(&skyboxSrc_, skyboxSrc_.length()+1 ,network::STRING);
+
+    void Skybox::registerAllVariables()
+    {
+        registerVar(&skyboxSrc_, skyboxSrc_.length()+1 ,network::STRING);
     }
-    
+
+    void Skybox::changedVisibility()
+    {
+        BaseObject::changedVisibility();
+        GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_);
+    }
 }
Index: code/branches/input/src/orxonox/objects/Skybox.h
===================================================================
--- code/branches/input/src/orxonox/objects/Skybox.h	(revision 1623)
+++ code/branches/input/src/orxonox/objects/Skybox.h	(revision 1629)
@@ -43,8 +43,8 @@
             virtual ~Skybox();
 
-            void loadParams(TiXmlElement* xmlElem);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void changedVisibility();
             void setSkybox(const std::string& skyboxname);
-            
+
             virtual bool create();
             void registerAllVariables();
Index: code/branches/input/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/branches/input/src/orxonox/objects/SpaceShip.cc	(revision 1623)
+++ code/branches/input/src/orxonox/objects/SpaceShip.cc	(revision 1629)
@@ -35,19 +35,23 @@
 #include <OgreSceneNode.h>
 
-#include "CameraHandler.h"
 #include "util/Convert.h"
 #include "util/Math.h"
+
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
 #include "core/Debug.h"
-#include "GraphicsEngine.h"
-#include "core/input/InputManager.h"
-#include "particle/ParticleInterface.h"
-#include "Projectile.h"
-#include "RotatingProjectile.h"
 #include "core/XMLPort.h"
 #include "core/ConsoleCommand.h"
+
 #include "network/Client.h"
-#include "hud/HUD.h"
+
+#include "tools/ParticleInterface.h"
+
+#include "GraphicsEngine.h"
+#include "RotatingProjectile.h"
+#include "ParticleProjectile.h"
+#include "ParticleSpawner.h"
+#include "Backlight.h"
+#include "CameraHandler.h"
 
 namespace orxonox
@@ -69,5 +73,5 @@
     SpaceShip* SpaceShip::instance_s;
 
-    
+
     SpaceShip *SpaceShip::getLocalShip(){
       Iterator<SpaceShip> it;
@@ -79,72 +83,82 @@
     }
 
-    SpaceShip::SpaceShip() :
-      //testvector_(0,0,0),
-      //bInvertYAxis_(false),
-      setMouseEventCallback_(false),
-      bLMousePressed_(false),
-      bRMousePressed_(false),
-      camNode_(0),
-      cam_(0),
-      camName_("CamNode"),
-      tt_(0),
-      redNode_(0),
-      greenNode_(0),
-      blinkTime_(0.0f),
-      chNearNode_(0),
-      chFarNode_(0),
-      timeToReload_(0.0f),
-      //reloadTime_(0.0f),
-      maxSideAndBackSpeed_(0.0f),
-      maxSpeed_(0.0f),
-      maxRotation_(0.0f),
-      translationAcceleration_(0.0f),
-      rotationAcceleration_(0.0f),
-      translationDamping_(0.0f),
-      rotationDamping_(0.0f),
-      maxRotationRadian_(0),
-      rotationAccelerationRadian_(0),
-      rotationDampingRadian_(0),
-      zeroRadian_(0),
-      mouseXRotation_(0),
-      mouseYRotation_(0),
-      mouseX_(0.0f),
-      mouseY_(0.0f),
-      emitterRate_(0.0f),
-      myShip_(false),
-      teamNr_(0),
-      health_(100)
+    SpaceShip::SpaceShip()
     {
         RegisterObject(SpaceShip);
-        this->registerAllVariables();
-
-        SpaceShip::instance_s = this;
-
-        this->setConfigValues();
-
-        initialDir_ = Vector3(1.0, 0.0, 0.0);
-        currentDir_ = initialDir_;
-        initialOrth_ = Vector3(0.0, 0.0, 1.0);
-        currentOrth_ = initialOrth_;
-
-        this->camName_ = this->getName() + "CamNode";
 
         this->setRotationAxis(1, 0, 0);
         this->setStatic(false);
 
-        COUT(3) << "Info: SpaceShip was loaded" << std::endl;
+        this->zeroRadian_ = 0;
+        this->maxSideAndBackSpeed_ = 0;
+        this->maxSpeed_ = 0;
+        this->maxRotation_ = 0;
+        this->translationAcceleration_ = 0;
+        this->rotationAcceleration_ = 0;
+        this->translationDamping_ = 0;
+        this->rotationDamping_ = 0;
+        this->maxRotationRadian_ = 0;
+        this->rotationAccelerationRadian_ = 0;
+        this->rotationDampingRadian_ = 0;
+
+        this->cam_ = 0;
+        this->tt1_ = 0;
+        this->tt2_ = 0;
+        this->smoke_ = 0;
+        this->fire_ = 0;
+
+        this->backlight_ = 0;
+
+        this->redNode_ = 0;
+        this->greenNode_ = 0;
+        this->blinkTime_ = 0;
+
+        this->timeToReload_ = 0;
+
+        this->bLMousePressed_ = false;
+        this->bRMousePressed_ = false;
+        this->mouseXRotation_ = 0;
+        this->mouseYRotation_ = 0;
+        this->myShip_ = false;
+
+        this->registerAllVariables();
+
+        SpaceShip::instance_s = this;
+
+        this->setConfigValues();
+
+        this->initialDir_ = Vector3(1.0, 0.0, 0.0);
+        this->currentDir_ = initialDir_;
+        this->initialOrth_ = Vector3(0.0, 0.0, 1.0);
+        this->currentOrth_ = initialOrth_;
+
+        this->camName_ = this->getName() + "CamNode";
+
+        this->teamNr_ = 0;
+        this->health_ = 100;
+
+        this->radarObject_ = static_cast<WorldEntity*>(this);
     }
 
     SpaceShip::~SpaceShip()
     {
-        if (this->tt_)
-            delete this->tt_;
-        if(setMouseEventCallback_)
-          InputManager::removeMouseHandler("SpaceShip");
-        if (this->cam_)
-          delete this->cam_;
-        if (!Identifier::isCreatingHierarchy() && !myShip_ && &HUD::getSingleton()!=NULL)
-          //remove the radar object
-          HUD::getSingleton().removeRadarObject(this->getNode());
+        if (this->isInitialized())
+        {
+            if (this->tt1_)
+                delete this->tt1_;
+            if (this->tt2_)
+                delete this->tt2_;
+
+            if (this->smoke_)
+                this->smoke_->destroy();
+            if (this->fire_)
+                this->fire_->destroy();
+
+            if (this->backlight_)
+                delete this->backlight_;
+
+            if (this->cam_)
+                delete this->cam_;
+        }
     }
 
@@ -154,5 +168,5 @@
           myShip_=true;
         else
-          HUD::getSingleton().addRadarObject(this->getNode(), 3);
+          this->setRadarObjectColour(this->getProjectileColour());
       }
       if(Model::create())
@@ -179,24 +193,37 @@
     void SpaceShip::init()
     {
-        // START CREATING THRUSTER
-        this->tt_ = new ParticleInterface(GraphicsEngine::getSingleton().getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow");
-        this->tt_->getParticleSystem()->setParameter("local_space","true");
-        this->tt_->newEmitter();
-/*
-        this->tt_->setDirection(Vector3(0,0,1));
-        this->tt_->setPositionOfEmitter(0, Vector3(20,-1,-15));
-        this->tt_->setPositionOfEmitter(1, Vector3(-20,-1,-15));
-*/
-        this->tt_->setDirection(Vector3(-1,0,0));
-        this->tt_->setPositionOfEmitter(0, Vector3(-15,20,-1));
-        this->tt_->setPositionOfEmitter(1, Vector3(-15,-20,-1));
-        this->tt_->setVelocity(50);
-
-        emitterRate_ = tt_->getRate();
-
-        Ogre::SceneNode* node2 = this->getNode()->createChildSceneNode(this->getName() + "particle2");
-        node2->setInheritScale(false);
-        tt_->addToSceneNode(node2);
-        // END CREATING THRUSTER
+        // START CREATING THRUSTERS
+        this->tt1_ = new ParticleInterface("Orxonox/thruster1", LODParticle::low);
+        this->tt1_->createNewEmitter();
+        this->tt1_->getAllEmitters()->setDirection(-this->getInitialDir());
+        this->tt1_->getEmitter(0)->setPosition(Vector3(-15, 20, -1));
+        this->tt1_->getEmitter(1)->setPosition(Vector3(-15, -20, -1));
+        this->tt1_->setSpeedFactor(3.0);
+
+        Ogre::SceneNode* node2a = this->getNode()->createChildSceneNode(this->getName() + "particle2a");
+        node2a->setInheritScale(false);
+        node2a->setScale(1, 1, 1);
+        tt1_->addToSceneNode(node2a);
+
+        this->tt2_ = new ParticleInterface("Orxonox/thruster2", LODParticle::normal);
+        this->tt2_->createNewEmitter();
+        this->tt2_->getAllEmitters()->setDirection(Vector3(-1, 0, 0));
+        this->tt2_->getEmitter(0)->setPosition(Vector3(-30, 40, -2));
+        this->tt2_->getEmitter(1)->setPosition(Vector3(-30, -40, -2));
+
+        Ogre::SceneNode* node2b = this->getNode()->createChildSceneNode(this->getName() + "particle2b");
+        node2b->setInheritScale(false);
+        node2b->setScale(0.5, 0.5, 0.5);
+        tt2_->addToSceneNode(node2b);
+
+        this->leftThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, -10, -0.5));
+        this->rightThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, 10, -0.5));
+
+        Ogre::SceneNode* node2c = this->getNode()->createChildSceneNode(this->getName() + "particle2c");
+        node2c->setInheritScale(false);
+        node2c->setScale(2, 2, 2);
+        node2c->attachObject(this->leftThrusterFlare_.getBillboardSet());
+        node2c->attachObject(this->rightThrusterFlare_.getBillboardSet());
+        // END CREATING THRUSTERS
 
         // START CREATING BLINKING LIGHTS
@@ -216,4 +243,19 @@
         // END CREATING BLINKING LIGHTS
 
+        // START CREATING ADDITIONAL EFFECTS
+        this->backlight_ = new Backlight(this->maxSpeed_, 0.8);
+        this->attachObject(this->backlight_);
+        this->backlight_->setPosition(-2.35, 0, 0.2);
+        this->backlight_->setColour(this->getProjectileColour());
+
+        this->smoke_ = new ParticleSpawner();
+        this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3);
+        this->attachObject(this->smoke_);
+
+        this->fire_ = new ParticleSpawner();
+        this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1);
+        this->attachObject(this->fire_);
+        // END CREATING ADDITIONAL EFFECTS
+
         if (this->isExactlyA(Class(SpaceShip)))
         {
@@ -232,8 +274,8 @@
             this->chFarNode_->attachObject(this->crosshairFar_.getBillboardSet());
             this->chFarNode_->setScale(0.4, 0.4, 0.4);
+            // END of testing crosshair
         }
 
         createCamera();
-        // END of testing crosshair
     }
 
@@ -245,6 +287,38 @@
     }
 
+    void SpaceShip::changedVisibility()
+    {
+        Model::changedVisibility();
+
+        this->tt1_->setEnabled(this->isVisible());
+        this->tt2_->setEnabled(this->isVisible());
+        this->redBillboard_.setVisible(this->isVisible());
+        this->greenBillboard_.setVisible(this->isVisible());
+        this->crosshairNear_.setVisible(this->isVisible());
+        this->crosshairFar_.setVisible(this->isVisible());
+        this->rightThrusterFlare_.setVisible(this->isVisible());
+        this->leftThrusterFlare_.setVisible(this->isVisible());
+        this->smoke_->setVisible(this->isVisible());
+        this->fire_->setVisible(this->isVisible());
+        this->backlight_->setVisible(this->isVisible());
+    }
+
+    void SpaceShip::changedActivity()
+    {
+        Model::changedActivity();
+
+        this->tt1_->setEnabled(this->isVisible());
+        this->tt2_->setEnabled(this->isVisible());
+        this->redBillboard_.setVisible(this->isVisible());
+        this->greenBillboard_.setVisible(this->isVisible());
+        this->crosshairNear_.setVisible(this->isVisible());
+        this->crosshairFar_.setVisible(this->isVisible());
+        this->rightThrusterFlare_.setVisible(this->isVisible());
+        this->leftThrusterFlare_.setVisible(this->isVisible());
+    }
+
     void SpaceShip::setCamera(const std::string& camera)
     {
+      myShip_=true; // TODO: this is only a hack
       camName_=camera;
       // change camera attributes here, if you want to ;)
@@ -266,5 +340,5 @@
       this->camNode_ = this->getNode()->createChildSceneNode(camName_);
       COUT(4) << "position: (this)" << this->getNode()->getPosition() << std::endl;
-      this->camNode_->setPosition(Vector3(-50,0,10));
+      this->camNode_->setPosition(Vector3(-25,0,5));
 //      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
 //      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,0,-1));
@@ -277,10 +351,9 @@
       Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
       Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(1,0,0));
-      camNode_->setOrientation(q2*q1);
+      this->camNode_->setOrientation(q2*q1);
       if(network::Client::getSingleton()!=0 && network::Client::getSingleton()->getShipID()==objectID){
         this->setBacksync(true);
         CameraHandler::getInstance()->requestFocus(cam_);
       }
-
     }
 
@@ -318,5 +391,4 @@
         XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);
         XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
-        myShip_=true; // TODO: this is only a hack
 
         SpaceShip::create();
@@ -325,35 +397,33 @@
     }
 
-    int sgn(float x)
-    {
-        if (x >= 0)
-            return 1;
-        else
-            return -1;
-    }
-
     std::string SpaceShip::whereAmI() {
-	return getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().x)
-	+ "  " + getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().y)
-	+ "  " + getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().z);
-    }
-
-    Vector3 SpaceShip::getDir() {
-        return currentDir_;
-    }
-
-    Vector3 SpaceShip::getOrth(){
-        return currentOrth_;
-    }
-
-    float SpaceShip::getMaxSpeed() { return maxSpeed_; }
+        return getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().x)
+        + "  " + getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().y)
+        + "  " + getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().z);
+    }
 
     void SpaceShip::tick(float dt)
     {
+        if (!this->isActive())
+            return;
+
         currentDir_ = getOrientation()*initialDir_;
-		currentOrth_ = getOrientation()*initialOrth_;
+        currentOrth_ = getOrientation()*initialOrth_;
 
         if (this->cam_)
             this->cam_->tick(dt);
+
+        if (this->smoke_)
+            this->smoke_->setVisible(this->isVisible() && this->health_ < 40);
+        if (this->fire_)
+            this->fire_->setVisible(this->isVisible() && this->health_ < 20);
+
+        if (this->backlight_)
+        {   // (there's already fire ||                 we're to slow                 ||                  we're moving backwards                  )
+            if (this->health_ < 20   || this->getVelocity().squaredLength() < 150*150 || this->getVelocity().dotProduct(this->getInitialDir()) < 0)
+                this->backlight_->setActive(false);
+            else
+                this->backlight_->setActive(true);
+        }
 
         if (this->redNode_ && this->greenNode_)
@@ -374,15 +444,13 @@
         {
 
-            Projectile *p;
-            if (this->isExactlyA(Class(SpaceShip)))
-                p = new RotatingProjectile(this);
-            else
-                p = new Projectile(this);
-            p->setColour(this->getProjectileColour());
-            p->create();
-            if(p->classID==0)
+            BillboardProjectile* projectile = new ParticleProjectile(this);
+            projectile->setColour(this->getProjectileColour());
+            projectile->create();
+            if (projectile->classID == 0)
+            {
               COUT(3) << "generated projectile with classid 0" <<  std::endl; // TODO: remove this output
-
-            p->setBacksync(true);
+            }
+
+            projectile->setBacksync(true);
             this->timeToReload_ = this->reloadTime_;
         }
@@ -464,19 +532,21 @@
 
         if (this->acceleration_.x > 0)
-            this->tt_->setRate(emitterRate_);
+        {
+            this->tt1_->setEnabled(true);
+            this->tt2_->setEnabled(true);
+        }
         else
-            this->tt_->setRate(0);
-
-        if( myShip_ )
-        {
-          COUT(5) << "steering our ship: " << objectID << std::endl;
-          this->acceleration_.x = 0;
-          this->acceleration_.y = 0;
-          this->momentum_ = 0;
-          this->mouseXRotation_ = Radian(0);
-          this->mouseYRotation_ = Radian(0);
-          this->bLMousePressed_ = false;
-        }/*else
-          COUT(4) << "not steering ship: " << objectID << " our ship: " << network::Client::getSingleton()->getShipID() << std::endl;*/
+        {
+            this->tt1_->setEnabled(false);
+            this->tt2_->setEnabled(false);
+        }
+
+        COUT(5) << "steering our ship: " << objectID << std::endl;
+        this->acceleration_.x = 0;
+        this->acceleration_.y = 0;
+        this->momentum_ = 0;
+        this->mouseXRotation_ = Radian(0);
+        this->mouseYRotation_ = Radian(0);
+        this->bLMousePressed_ = false;
     }
 
Index: code/branches/input/src/orxonox/objects/SpaceShip.h
===================================================================
--- code/branches/input/src/orxonox/objects/SpaceShip.h	(revision 1623)
+++ code/branches/input/src/orxonox/objects/SpaceShip.h	(revision 1629)
@@ -36,13 +36,12 @@
 #include "Camera.h"
 #include "Model.h"
+#include "RadarViewable.h"
 #include "tools/BillboardSet.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport SpaceShip : public Model
+    class _OrxonoxExport SpaceShip : public Model, public RadarViewable
     {
         public:
-          
-
             static SpaceShip *getLocalShip();
 
@@ -55,4 +54,6 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void tick(float dt);
+            virtual void changedVisibility();
+            virtual void changedActivity();
 
             void setCamera(const std::string& camera = "");
@@ -65,4 +66,19 @@
             void setRotDamp(float value);
             void getFocus();
+
+            inline float getMaxSpeed() const
+                { return this->maxSpeed_; }
+            inline float getMaxSideAndBackSpeed() const
+                { return this->maxSideAndBackSpeed_; }
+            inline float getMaxRotation() const
+                { return this->maxRotation_; }
+            inline float getTransAcc() const
+                { return this->translationAcceleration_; }
+            inline float getRotAcc() const
+                { return this->rotationAcceleration_; }
+            inline float getTransDamp() const
+                { return this->translationDamping_; }
+            inline float getRotDamp() const
+                { return this->rotationDamping_; }
 
             static std::string whereAmI();
@@ -83,12 +99,18 @@
             void doFire();
 
-            float getMaxSpeed();
-            Vector3 getDir();
-            Vector3 getOrth();
+            inline const Vector3& getDir() const
+                { return this->currentDir_; }
+            inline const Vector3& getInitialDir() const
+                { return this->initialDir_; }
+            inline const Vector3& getOrth() const
+                { return this->currentOrth_; }
+            inline const Vector3& getInitialOrth() const
+                { return this->initialOrth_; }
+
             Camera* getCamera();
 
             int getTeamNr() const
                 { return this->teamNr_; }
-            int getHealth() const
+            float getHealth() const
                 { return this->health_; }
 
@@ -110,5 +132,4 @@
             Vector3 currentOrth_;
             bool bInvertYAxis_;
-            bool setMouseEventCallback_;
             bool bLMousePressed_;
             bool bRMousePressed_;
@@ -118,6 +139,10 @@
             std::string camName_;
 
+            ParticleInterface* tt1_;
+            ParticleInterface* tt2_;
+            BillboardSet leftThrusterFlare_;
+            BillboardSet rightThrusterFlare_;
 
-            ParticleInterface* tt_;
+            Backlight* backlight_;
 
             BillboardSet redBillboard_;
@@ -126,4 +151,7 @@
             Ogre::SceneNode* greenNode_;
             float blinkTime_;
+
+            ParticleSpawner* smoke_;
+            ParticleSpawner* fire_;
 
             BillboardSet crosshairNear_;
@@ -153,11 +181,9 @@
             float mouseY_;
 
-            float emitterRate_;
-
         protected:
             bool myShip_;
 
             int teamNr_;
-            int health_;
+            float health_;
 
             static SpaceShip* instance_s;
Index: code/branches/input/src/orxonox/objects/SpaceShipAI.cc
===================================================================
--- code/branches/input/src/orxonox/objects/SpaceShipAI.cc	(revision 1623)
+++ code/branches/input/src/orxonox/objects/SpaceShipAI.cc	(revision 1629)
@@ -32,4 +32,5 @@
 #include <OgreMath.h>
 #include "Projectile.h"
+#include "ParticleSpawner.h"
 #include "core/CoreIncludes.h"
 #include "core/Iterator.h"
@@ -37,4 +38,5 @@
 #include "core/ConsoleCommand.h"
 #include "core/XMLPort.h"
+#include "tools/ParticleInterface.h"
 
 #define ACTION_INTERVAL 1.0f
@@ -51,6 +53,4 @@
         RegisterObject(SpaceShipAI);
 
-        this->alive_ = true;
-        this->setPosition(Vector3(rnd(-1000, 1000), rnd(-1000, 1000), rnd(-1000, 0000)));
         this->target_ = 0;
         this->bShooting_ = 0;
@@ -70,8 +70,13 @@
     }
 
+    SpaceShipAI::~SpaceShipAI()
+    {
+        for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; ++it)
+            it->shipDied(this);
+    }
+
     void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SpaceShip::XMLPort(xmlelement, mode);
-        myShip_=true;
 
         this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));
@@ -85,4 +90,5 @@
             newenemy->setMesh("assff.mesh");
 //            newenemy->setPosition(0, 0, 0);
+            newenemy->setPosition(Vector3(rnd(-3000, 3000), rnd(-3000, 3000), rnd(-3000, 3000)));
             newenemy->setScale(10);
             newenemy->setMaxSpeed(500);
@@ -95,4 +101,8 @@
             Element xmlelement;
             newenemy->XMLPort(xmlelement, XMLPort::LoadObject);
+
+            ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", LODParticle::normal, 2.0, 0, 0, newenemy->getOrth());
+            spawneffect->setPosition(newenemy->getPosition() - newenemy->getOrth() * 50);
+            spawneffect->create();
         }
     }
@@ -103,6 +113,5 @@
         for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; )
         {
-            delete *(it++);
-            ++i;
+            (it++)->kill();
             if (num && i >= num)
                 break;
@@ -122,69 +131,93 @@
         // search enemy
         random = rnd(maxrand);
-//std::cout << "search enemy: " << random << std::endl;
-        if (random < 20 && (!this->target_))
-        {
+        if (random < 15 && (!this->target_))
             this->searchNewTarget();
-        }
 
         // forget enemy
         random = rnd(maxrand);
-//std::cout << "forget enemy: " << random << std::endl;
         if (random < 5 && (this->target_))
-        {
             this->forgetTarget();
-        }
 
         // next enemy
         random = rnd(maxrand);
-//std::cout << "next enemy: " << random << std::endl;
         if (random < 10 && (this->target_))
-        {
             this->searchNewTarget();
-        }
 
         // fly somewhere
         random = rnd(maxrand);
-//std::cout << "fly somewhere: " << random << std::endl;
-        if (random < 40 && (!this->bHasTargetPosition_ && !this->target_))
-        {
+        if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
             this->searchNewTargetPosition();
-        }
 
         // stop flying
         random = rnd(maxrand);
-//std::cout << "stop flying: " << random << std::endl;
         if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
-        {
             this->bHasTargetPosition_ = false;
-        }
 
         // fly somewhere else
         random = rnd(maxrand);
-//std::cout << "fly somewhere else: " << random << std::endl;
         if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
-        {
             this->searchNewTargetPosition();
-        }
 
         // shoot
         random = rnd(maxrand);
-//std::cout << "shoot: " << random << std::endl;
         if (random < 75 && (this->target_ && !this->bShooting_))
-        {
             this->bShooting_ = true;
-        }
 
         // stop shooting
         random = rnd(maxrand);
-//std::cout << "stop shooting: " << random << std::endl;
         if (random < 25 && (this->bShooting_))
-        {
             this->bShooting_ = false;
-        }
+    }
+
+    void SpaceShipAI::damage(float damage)
+    {
+        this->health_ -= damage;
+        if (this->health_ <= 0)
+        {
+            this->kill();
+            SpaceShipAI::createEnemy(1);
+        }
+    }
+
+    void SpaceShipAI::kill()
+    {
+        ParticleSpawner* explosion = new ParticleSpawner("Orxonox/BigExplosion1part1", LODParticle::low, 3.0);
+        explosion->setPosition(this->getPosition());
+        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
+        explosion->setScale(4);
+        explosion->create();
+
+        explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::normal, 3.0);
+        explosion->setPosition(this->getPosition());
+        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
+        explosion->setScale(4);
+        explosion->create();
+        explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::high, 3.0);
+        explosion->setPosition(this->getPosition());
+        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
+        explosion->setScale(4);
+        explosion->create();
+
+        Vector3 ringdirection = Vector3(rnd(), rnd(), rnd());
+        ringdirection.normalise();
+        explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::normal, 3.0, 0.5, 0, ringdirection);
+        explosion->setPosition(this->getPosition());
+        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
+        explosion->setScale(4);
+        explosion->create();
+        explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::high, 3.0, 0.5, 0, ringdirection);
+        explosion->setPosition(this->getPosition());
+        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
+        explosion->setScale(4);
+        explosion->create();
+
+        delete this;
     }
 
     void SpaceShipAI::tick(float dt)
     {
+        if (!this->isActive())
+            return;
+
         if (this->target_)
             this->aimAtTarget();
@@ -193,5 +226,5 @@
             this->moveToTargetPosition(dt);
 
-        if (this->bShooting_ && this->isCloseAtTarget(2000) && this->isLookingAtTarget(Ogre::Math::PI / 10.0f))
+        if (this->bShooting_ && this->isCloseAtTarget(2500) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
             this->doFire();
 
@@ -201,23 +234,20 @@
     void SpaceShipAI::moveToTargetPosition(float dt)
     {
-        static Radian RadianZERO(0);
-
-//        float dotprod = (this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(this->targetPosition_ - this->getPosition());
-        Quaternion rotation = (this->getOrientation() * Ogre::Vector3::UNIT_X).getRotationTo(this->targetPosition_ - this->getPosition());
-/*
-std::cout << "scalprod: " << dotprod << std::endl;
-std::cout << "dist: " << this->targetPosition_ - this->getPosition() << std::endl;
-std::cout << "yaw: " << rotation.getYaw().valueRadians() << std::endl;
-std::cout << "pitch: " << rotation.getPitch().valueRadians() << std::endl;
-std::cout << "roll: " << rotation.getRoll().valueRadians() << std::endl;
-*/
-        this->setMoveYaw(-rotation.getRoll().valueRadians());
-        this->setMovePitch(rotation.getYaw().valueRadians());
-
-        if ((this->targetPosition_ - this->getPosition()).length() > 100)
-        {
-            this->setMoveLongitudinal(1);
-        }
-
+        Vector2 coord = get2DViewdirection(this->getPosition(), this->getDir(), this->getOrth(), this->targetPosition_);
+
+        float distance = (this->targetPosition_ - this->getPosition()).length();
+        if (this->target_ || distance > 50)
+        {
+            // Multiply with 0.8 to make them a bit slower
+            this->setMoveYaw(0.8 * sgn(coord.x) * coord.x*coord.x);
+            this->setMovePitch(0.8 * sgn(coord.y) * coord.y*coord.y);
+        }
+
+        if (this->target_ && distance < 1000 && this->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+            this->setMoveLongitudinal(-0.5); // They don't brake with full power to give the player a chance
+        else if (!this->target_ && distance <= this->getVelocity().length() / (2 * this->getTransAcc()))
+            this->setMoveLongitudinal(-1.0);
+        else
+            this->setMoveLongitudinal(0.8);
     }
 
@@ -241,5 +271,5 @@
                 Vector3 distanceNew = it->getPosition() - this->getPosition();
                 if (!this->target_ || it->getPosition().squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * Ogre::Math::PI))
-                        < this->targetPosition_.squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * Ogre::Math::PI)))
+                        < this->targetPosition_.squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * Ogre::Math::PI)) + rnd(-250, 250))
                 {
                     this->target_ = (*it);
@@ -248,5 +278,5 @@
             }
         }
-   }
+    }
 
     void SpaceShipAI::forgetTarget()
@@ -260,34 +290,29 @@
         if (!this->target_)
             return;
-/*
-        Vector3 enemymovement = this->target_->getVelocity();
-        Vector3 distance_normalised = this->target_->getPosition() - this->getPosition();
-        distance_normalised.normalise();
-
-        float scalarprod = enemymovement.dotProduct(distance_normalised);
-        float aimoffset = scalarprod*scalarprod + Projectile::getSpeed() * Projectile::getSpeed() - this->target_->getVelocity().squaredLength();
-        if (aimoffset < 0)
-        {
-            this->bHasTargetPosition_ = false;
-            return;
-        }
-        aimoffset = -scalarprod + sqrt(aimoffset);
-        this->targetPosition_ = enemymovement + distance_normalised * aimoffset;
-        this->bHasTargetPosition_ = true;
-
-        std::cout << "targetpos: " << this->targetPosition_ << std::endl;
-*/
-        this->targetPosition_ = this->target_->getPosition();
-        this->bHasTargetPosition_ = true;
+
+        this->targetPosition_ = getPredictedPosition(this->getPosition(), Projectile::getSpeed(), this->target_->getPosition(), this->target_->getOrientation() * this->target_->getVelocity());
+        this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
     }
 
     bool SpaceShipAI::isCloseAtTarget(float distance)
     {
-        return (this->getPosition().squaredDistance(this->targetPosition_) < distance*distance);
+        if (!this->target_)
+            return (this->getPosition().squaredDistance(this->targetPosition_) < distance*distance);
+        else
+            return (this->getPosition().squaredDistance(this->target_->getPosition()) < distance*distance);
     }
 
     bool SpaceShipAI::isLookingAtTarget(float angle)
     {
-        return (this->getOrientation() * Ogre::Vector3::UNIT_X).directionEquals(this->targetPosition_ - this->getPosition(), Radian(angle));
+        return (getAngle(this->getPosition(), this->getDir(), this->targetPosition_) < angle);
+    }
+
+    void SpaceShipAI::shipDied(SpaceShipAI* ship)
+    {
+        if (ship == this->target_)
+        {
+            this->forgetTarget();
+            this->searchNewTargetPosition();
+        }
     }
 }
Index: code/branches/input/src/orxonox/objects/SpaceShipAI.h
===================================================================
--- code/branches/input/src/orxonox/objects/SpaceShipAI.h	(revision 1623)
+++ code/branches/input/src/orxonox/objects/SpaceShipAI.h	(revision 1629)
@@ -44,7 +44,12 @@
         public:
             SpaceShipAI();
+            virtual ~SpaceShipAI();
+
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             static void createEnemy(int num);
             static void killEnemies(int num);
+            void shipDied(SpaceShipAI* ship);
+            void damage(float damage);
+            void kill();
 
         private:
@@ -64,5 +69,4 @@
             Timer<SpaceShipAI> actionTimer_;
 
-            bool alive_;
             bool bHasTargetPosition_;
             Vector3 targetPosition_;
Index: code/branches/input/src/orxonox/objects/WorldEntity.cc
===================================================================
--- code/branches/input/src/orxonox/objects/WorldEntity.cc	(revision 1623)
+++ code/branches/input/src/orxonox/objects/WorldEntity.cc	(revision 1629)
@@ -45,12 +45,5 @@
     unsigned int WorldEntity::worldEntityCounter_s = 0;
 
-    WorldEntity::WorldEntity() :
-      velocity_    (0, 0, 0),
-      acceleration_(0, 0, 0),
-      rotationAxis_(0, 1, 0),
-      rotationRate_(0),
-      momentum_    (0),
-      node_        (0),
-      bStatic_     (true)
+    WorldEntity::WorldEntity()
     {
         RegisterObject(WorldEntity);
@@ -58,24 +51,37 @@
         if (GraphicsEngine::getSingleton().getSceneManager())
         {
-          std::ostringstream name;
-          name << (WorldEntity::worldEntityCounter_s++);
-          this->setName("WorldEntity" + name.str());
-          this->node_ = GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
+            std::ostringstream name;
+            name << (WorldEntity::worldEntityCounter_s++);
+            this->setName("WorldEntity" + name.str());
+            this->node_ = GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
 
-          registerAllVariables();
+            registerAllVariables();
         }
+        else
+        {
+            this->node_ = 0;
+        }
+
+        this->bStatic_ = true;
+        this->velocity_ = Vector3(0, 0, 0);
+        this->acceleration_ = Vector3(0, 0, 0);
+        this->rotationAxis_ = Vector3(0, 1, 0);
+        this->rotationRate_ = 0;
+        this->momentum_ = 0;
     }
-    
+
 
     WorldEntity::~WorldEntity()
     {
-      // just to make sure we clean out all scene nodes
-      if(this->getNode())
-        this->getNode()->removeAndDestroyAllChildren();
+        if (this->isInitialized())
+        {
+            this->getNode()->removeAndDestroyAllChildren();
+            GraphicsEngine::getSingleton().getSceneManager()->destroySceneNode(this->getName());
+        }
     }
 
     void WorldEntity::tick(float dt)
     {
-        if (!this->bStatic_)
+        if (!this->bStatic_ && this->isActive())
         {
 //             COUT(4) << "acceleration: " << this->acceleration_ << " velocity: " << this->velocity_ << std::endl;
@@ -89,11 +95,4 @@
     }
 
-    void WorldEntity::loadParams(TiXmlElement* xmlElem)
-    {
-
-        BaseObject::loadParams(xmlElem);
-        create();
-    }
-    
 
     void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
@@ -122,5 +121,5 @@
 
         XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, mode, false, true);
-        
+
         WorldEntity::create();
     }
@@ -129,4 +128,7 @@
     void WorldEntity::registerAllVariables()
     {
+      // register inheritec variables from BaseObject
+      registerVar( (void*) &(this->bActive_), sizeof(this->bActive_), network::DATA, 0x3);
+      registerVar( (void*) &(this->bVisible_), sizeof(this->bVisible_), network::DATA, 0x3);
       // register coordinates
       registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA, 0x3);
@@ -163,4 +165,5 @@
     {
         this->attachedWorldEntities_.push_back(entity);
+        this->attachObject(entity);
     }
 
@@ -172,3 +175,15 @@
             return 0;
     }
+
+    void WorldEntity::attachObject(const WorldEntity& obj) const
+    {
+        GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->removeChild(obj.getNode());
+        this->getNode()->addChild(obj.getNode());
+    }
+
+    void WorldEntity::attachObject(WorldEntity* obj) const
+    {
+        GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->removeChild(obj->getNode());
+        this->getNode()->addChild(obj->getNode());
+    }
 }
Index: code/branches/input/src/orxonox/objects/WorldEntity.h
===================================================================
--- code/branches/input/src/orxonox/objects/WorldEntity.h	(revision 1623)
+++ code/branches/input/src/orxonox/objects/WorldEntity.h	(revision 1629)
@@ -51,5 +51,4 @@
 
             virtual void tick(float dt);
-            virtual void loadParams(TiXmlElement* xmlElem);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual inline bool create(){ return Synchronisable::create(); }
@@ -58,5 +57,5 @@
             const WorldEntity* getAttachedWorldEntity(unsigned int index) const;
 
-            inline Ogre::SceneNode* getNode()
+            inline Ogre::SceneNode* getNode() const
                 { return this->node_; }
 
@@ -74,45 +73,49 @@
             inline const Vector3& getPosition() const
                 { return this->node_->getPosition(); }
-
-            inline void translate(const Vector3 &d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
+            inline const Vector3& getWorldPosition() const
+                { return this->node_->getWorldPosition(); }
+
+            inline void translate(const Vector3& d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
                 { this->node_->translate(d, relativeTo); }
             inline void translate(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
                 { this->node_->translate(x, y, z, relativeTo); }
-            inline void translate(const Matrix3 &axes, const Vector3 &move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
+            inline void translate(const Matrix3& axes, const Vector3& move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
                 { this->node_->translate(axes, move, relativeTo); }
-            inline void translate(const Matrix3 &axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
+            inline void translate(const Matrix3& axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
                 { this->node_->translate(axes, x, y, z, relativeTo); }
 
-            inline void yaw(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
+            inline void yaw(const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
                 { this->node_->yaw(angle, relativeTo); }
-            inline void pitch(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
+            inline void pitch(const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
                 { this->node_->pitch(angle, relativeTo); }
-            inline void roll(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
+            inline void roll(const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
                 { this->node_->roll(angle, relativeTo); }
             void setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll);
 
-            inline void setYaw(const Degree &angle)
+            inline void setYaw(const Degree& angle)
                 { this->node_->yaw(angle, Ogre::Node::TS_LOCAL); }
-            inline void setPitch(const Degree &angle)
+            inline void setPitch(const Degree& angle)
                 { this->node_->pitch(angle, Ogre::Node::TS_LOCAL); }
-            inline void setRoll(const Degree &angle)
+            inline void setRoll(const Degree& angle)
                 { this->node_->roll(angle, Ogre::Node::TS_LOCAL); }
 
             inline const Ogre::Quaternion& getOrientation()
               { return this->node_->getOrientation(); }
+            inline const Ogre::Quaternion& getWorldOrientation()
+              { return this->node_->getWorldOrientation(); }
             inline void setOrientation(const Ogre::Quaternion& quat)
               { this->node_->setOrientation(quat); }
-            inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
+            inline void rotate(const Vector3& axis, const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
               { this->node_->rotate(axis, angle, relativeTo); }
             inline void setDirectionLoader(Real x, Real y, Real z)
               { this->setDirection(x, y, z); }
-            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
+            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
               { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); }
-            inline void setDirection(const Vector3 &vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
+            inline void setDirection(const Vector3& vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
               { this->node_->setDirection(vec, relativeTo, localDirectionVector); }
-            inline void lookAt(const Vector3 &targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
+            inline void lookAt(const Vector3& targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
               { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
 
-            inline void setScale(const Vector3 &scale)
+            inline void setScale(const Vector3& scale)
               { this->node_->setScale(scale); }
             inline void setScale(Real x, Real y, Real z)
@@ -124,5 +127,5 @@
             inline const Vector3& getScale(void) const
               { return this->node_->getScale(); }
-            inline void scale(const Vector3 &scale)
+            inline void scale(const Vector3& scale)
               { this->node_->scale(scale); }
             inline void scale(Real x, Real y, Real z)
@@ -131,11 +134,13 @@
               { this->node_->scale(scale, scale, scale); }
 
-            inline void attachObject(Ogre::MovableObject *obj)
+            void attachObject(const WorldEntity& obj) const;
+            void attachObject(WorldEntity* obj) const;
+            inline void attachObject(Ogre::MovableObject* obj) const
               { this->node_->attachObject(obj); }
-            inline void attachObject(Mesh &mesh)
+            inline void attachObject(Mesh& mesh) const
               { this->node_->attachObject(mesh.getEntity()); }
-            inline void detachObject(Ogre::MovableObject *obj)
+            inline void detachObject(Ogre::MovableObject* obj) const
               { this->node_->detachObject(obj); }
-            inline void detachAllObjects()
+            inline void detachAllObjects() const
               { this->node_->detachAllObjects(); }
 
@@ -179,5 +184,5 @@
             inline void setStatic(bool bStatic)
                 { this->bStatic_ = bStatic; }
-            inline bool isStatic()
+            inline bool isStatic() const
                 { return this->bStatic_; }
 
Index: code/branches/input/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 1629)
@@ -0,0 +1,316 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief Definition of the OrxonoxOverlay class.
+*/
+
+#include "OrxonoxStableHeaders.h"
+#include "OrxonoxOverlay.h"
+
+#include <cmath>
+#include <OgreOverlay.h>
+#include <OgreOverlayManager.h>
+#include <OgrePanelOverlayElement.h>
+#include "util/Convert.h"
+#include "util/String.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "core/ConsoleCommand.h"
+#include "GraphicsEngine.h"
+
+namespace orxonox
+{
+    unsigned int OrxonoxOverlay::hudOverlayCounter_s = 0;
+    std::map<std::string, OrxonoxOverlay*> OrxonoxOverlay::overlays_s;
+
+    SetConsoleCommand(OrxonoxOverlay, scaleOverlay, false).setAccessLevel(AccessLevel::User);
+    SetConsoleCommand(OrxonoxOverlay, scrollOverlay, false).setAccessLevel(AccessLevel::User);
+    SetConsoleCommand(OrxonoxOverlay, rotateOverlay, false).setAccessLevel(AccessLevel::User);
+
+    OrxonoxOverlay::OrxonoxOverlay()
+        : overlay_(0)
+        , background_(0)
+    {
+        RegisterObject(OrxonoxOverlay);
+    }
+
+    /**
+    @brief
+        Make sure everything gets removed/destroyed.
+    @remark
+        We assume that the Ogre::OverlayManager exists (there is an assert in Ogre for that!)
+    */
+    OrxonoxOverlay::~OrxonoxOverlay()
+    {
+        // erase ourself from the map with all overlays
+        std::map<std::string, OrxonoxOverlay*>::iterator it = overlays_s.find(this->getName());
+        if (it != overlays_s.end())
+            overlays_s.erase(it);
+
+        if (this->background_)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->background_);
+        if (this->overlay_)
+            Ogre::OverlayManager::getSingleton().destroy(this->overlay_);
+    }
+
+    /**
+    @brief
+        Loads the OrxonoxOverlay.
+        
+        This has to be called before usage, otherwise strange behaviour is
+        guaranteed! (there should be no segfaults however).
+    @copydoc
+        BaseObject::XMLPort()
+    */
+    void OrxonoxOverlay::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        BaseObject::XMLPort(xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            // add this overlay to the static map of OrxonoxOverlays
+            if (overlays_s.find(this->getName()) != overlays_s.end())
+            {
+                COUT(1) << "Overlay names should be unique or you cannnot access them via console." << std::endl;
+            }
+            overlays_s[this->getName()] = this;
+
+            // create the Ogre::Overlay
+            overlay_ = Ogre::OverlayManager::getSingleton().create("OrxonoxOverlay_overlay_"
+                + convertToString(hudOverlayCounter_s++));
+
+            // create background panel (can be used to show any picture)
+            this->background_ = static_cast<Ogre::PanelOverlayElement*>(
+                Ogre::OverlayManager::getSingleton().createOverlayElement("Panel",
+                "OrxonoxOverlay_background_" + convertToString(hudOverlayCounter_s++)));
+            this->overlay_->add2D(this->background_);
+
+            // We'll have to get the aspect ratio manually for the first time. Afterwards windowResized() gets
+            // called automatically by the GraphicsEngine.
+            this->windowResized(GraphicsEngine::getSingleton().getWindowWidth(),
+                GraphicsEngine::getSingleton().getWindowHeight());
+
+            this->changedVisibility();
+        }
+
+        XMLPortParam(OrxonoxOverlay, "size",      setSize,      getSize,      xmlElement, mode)
+            .defaultValues(Vector2(0.5f, 0.5f));
+        XMLPortParam(OrxonoxOverlay, "pickPoint", setPickPoint, getPickPoint, xmlElement, mode)
+            .defaultValues(Vector2(0.0f, 0.0f));
+        XMLPortParam(OrxonoxOverlay, "position",  setPosition,  getPosition,  xmlElement, mode)
+            .defaultValues(Vector2(0.0f, 0.0f));
+        XMLPortParam(OrxonoxOverlay, "rotation",  setRotation,  getRotation,  xmlElement, mode)
+            .defaultValues(0.0f);
+        XMLPortParam(OrxonoxOverlay, "correctAspect", setAspectCorrection,   getAspectCorrection,   xmlElement, mode)
+            .defaultValues(true);
+        XMLPortParam(OrxonoxOverlay, "background",    setBackgroundMaterial, getBackgroundMaterial, xmlElement, mode)
+            .defaultValues("");
+    }
+
+    //! Only sets the background material name if not ""
+    void OrxonoxOverlay::setBackgroundMaterial(const std::string& material)
+    {
+        if (this->background_ && material != "")
+            this->background_->setMaterialName(material);
+    }
+
+    //! Returns the the material name of the background
+    const std::string& OrxonoxOverlay::getBackgroundMaterial() const
+    {
+        if (this->background_)
+            return this->background_->getMaterialName();
+        else
+            return blankString;
+    }
+
+    //! Called by BaseObject when visibility has changed.
+    void OrxonoxOverlay::changedVisibility()
+    {
+        if (!this->overlay_)
+            return;
+
+        if (this->isVisible())
+            this->overlay_->show();
+        else
+            this->overlay_->hide();
+    }
+
+    /**
+    @brief
+        Called by the GraphicsEngine whenever the window size changes.
+        Calculates the aspect ratio only.
+    */
+    void OrxonoxOverlay::windowResized(int newWidth, int newHeight)
+    {
+        this->windowAspectRatio_ = newWidth/(float)newHeight;
+        this->sizeCorrectionChanged();
+    }
+
+    /**
+    @brief
+        Called whenever the rotation angle has changed.
+    */
+    void OrxonoxOverlay::angleChanged()
+    {
+        if (!this->overlay_)
+            return;
+
+        this->overlay_->setRotate(this->angle_);
+        this->sizeCorrectionChanged();
+    }
+
+    /**
+    @brief
+        Called whenever the aspect ratio or the angle has changed.
+        The method calculates a correction factor for the size to compensate
+        for aspect distortion if desired.
+    @remarks
+        This only works when the angle is about 0 or 90 degrees.
+    */
+    void OrxonoxOverlay::sizeCorrectionChanged()
+    {
+        if (this->bCorrectAspect_)
+        {
+            float angle = this->angle_.valueDegrees();
+            if (angle < 0.0)
+                angle = -angle;
+            angle -= 180.0 * (int)(angle / 180.0);
+
+            // take the reverse if angle is about 90 degrees
+            float tempAspect;
+            if (angle > 89.0 && angle < 91.0)
+                tempAspect = 1.0 / this->windowAspectRatio_;
+            else if (angle > 179 || angle < 1)
+                tempAspect = this->windowAspectRatio_;
+            else
+                tempAspect = 1.0;
+
+            // note: this is only an approximation that is mostly valid when the
+            // magnitude of the width is about the magnitude of the height.
+            // Correctly we would have to take the square root of width*height
+            this->sizeCorrection_.x = 2.0 / (tempAspect + 1.0);
+            this->sizeCorrection_.y = tempAspect * this->sizeCorrection_.x;
+        }
+        else
+        {
+            this->sizeCorrection_ = Vector2::UNIT_SCALE;
+        }
+
+        this->sizeChanged();
+    }
+
+    /**
+    @brief
+        Sets the overlay size using the actual corrected size.
+    */
+    void OrxonoxOverlay::sizeChanged()
+    {
+        if (!this->overlay_)
+            return;
+
+        this->overlay_->setScale(size_.x * sizeCorrection_.x, size_.y * sizeCorrection_.y);
+        positionChanged();
+    }
+
+    /**
+    @brief
+        Determines the position of the overlay.
+        This works also well when a rotation angle is applied. The overlay always
+        gets aligned correctly as well as possible.
+    */
+    void OrxonoxOverlay::positionChanged()
+    {
+        if (!this->overlay_)
+            return;
+
+        // transform the angle to a range of 0 - pi/2 first.
+        float angle = this->angle_.valueRadians();
+        if (angle < 0.0)
+            angle = -angle;
+        angle -= Ogre::Math::PI * (int)(angle / (Ogre::Math::PI));
+        if (angle > Ogre::Math::PI * 0.5)
+            angle = Ogre::Math::PI - angle;
+        
+        // do some mathematical fiddling for a bounding box
+        Vector2 actualSize = size_ * sizeCorrection_;
+        float radius = actualSize.length();
+        float phi = atan(actualSize.y / actualSize.x);
+        Vector2 boundingBox(radius * cos(angle - phi), radius * sin(angle + phi));
+
+        // calculate the scrolling offset
+        Vector2 scroll = (position_ - 0.5 - boundingBox * (pickPoint_ - 0.5)) * 2.0;
+        this->overlay_->setScroll(scroll.x, -scroll.y);
+    }
+
+
+    //########### Console commands ############
+
+    /**
+    @brief
+        Scales an overlay by its name.
+    @param name
+        The name of the overlay defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OrxonoxOverlay::scaleOverlay(const std::string& name, float scale)
+    {
+        std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
+        if (it != overlays_s.end())
+            (*it).second->scale(Vector2(scale, scale));
+    }
+
+    /**
+    @brief
+        Scrolls an overlay by its name.
+    @param name
+        The name of the overlay defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OrxonoxOverlay::scrollOverlay(const std::string& name, const Vector2& scroll)
+    {
+        std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
+        if (it != overlays_s.end())
+            (*it).second->scroll(scroll);
+    }
+
+    /**
+    @brief
+        Rotates an overlay by its name.
+    @param name
+        The name of the overlay defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OrxonoxOverlay::rotateOverlay(const std::string& name, const Degree& angle)
+    {
+        std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
+        if (it != overlays_s.end())
+            (*it).second->rotate(angle);
+    }
+}
Index: code/branches/input/src/orxonox/overlays/OrxonoxOverlay.h
===================================================================
--- code/branches/input/src/orxonox/overlays/OrxonoxOverlay.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/OrxonoxOverlay.h	(revision 1629)
@@ -0,0 +1,169 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief Declaration of the OrxonoxOverlay class.
+*/
+
+#ifndef _OrxonoxOverlay_H__
+#define _OrxonoxOverlay_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgrePrerequisites.h>
+#include "tools/WindowEventListener.h"
+#include "util/Math.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        Base class to display content directly onto the screen.
+        This is merely a wrapper of the Ogre::Overlay to implement more features and integrate it
+        in our class hierarchy for xml loading and config values.
+        The mentioned features are:
+        - Automatic positioning depending on the scale and the rotation angle.
+          You can specify a "pick point" relative to the overlay itself. This point will always be exactly
+          at the position (position_) of the overlay. That allows for margin/corner aligment.
+          It even works when a rotation angle is applied.
+        - Virtual methods for changedVisibilty() (BaseObject), angleChanged(), sizeCorrectionChanged(),
+          sizeChanged() and positionChanged(), that can be overridden by any derivative. This enables for
+          custom configurability of the size, position and rotation attributes. For intance, the HUDNavigation
+          should behave differently to sizeChanged() than a standard overlay.
+        - Console commands for scale, rotate and scroll (accessed by name)
+        - Standard Ogre::PanelOverlayElement for a background image (class doesn't have to be derived
+          only for displaying a picture).
+        - Reacts to changes of the window aspect
+        - Last but not least: On demand you can tell the overlay to automatically resale to correct for
+          aspect distortion. E.g. if you play 1024x768 you wouldn't want a round object to be oval.
+          Remark: This can (due to the Ogre::Overlay transformation order) only work for angle that are
+                  multiples of 90 degrees. But it's only a small drawback.
+    */
+    class _OrxonoxExport OrxonoxOverlay : public BaseObject, public WindowEventListener
+    {
+    public:
+        OrxonoxOverlay();
+        virtual ~OrxonoxOverlay();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        //! Shows the overlay with an detour to BaseObject::visibility_
+        void show() { this->setVisible(true); }
+        //! Hides the overlay with an detour to BaseObject::visibility_
+        void hide() { this->setVisible(false); }
+
+        /** Sets whether the aspect of the overlay is corrected.
+            This is for instance useful for round objects that should stay round no matter
+            what the screen resolution is. */
+        void setAspectCorrection(bool val)        { this->bCorrectAspect_ = val; this->sizeCorrectionChanged(); }
+        //! Returns whether the window aspect is corrected
+        bool getAspectCorrection() const          { return this->bCorrectAspect_; }
+
+        //! Sets the position of this overlay on the screen.
+        void setPosition(Vector2 pos)             { this->position_ = pos; this->positionChanged(); }
+
+        //! Returns the current position on the screen.
+        const Vector2& getPosition() const        { return this->position_; }
+
+        //! Scrolls the overlay. @param offset The offset given.
+        void scroll(const Vector2& offset)        { this->position_ += offset; this->positionChanged(); }
+
+        /** Sets the point in the overlay where to pick it when translating.
+            For instance setting it to (1.0,1.0) means that the lower right corner of the
+            overlay will be put at position_.
+            This primarily helps aligning an overlay to any corner/margin on the screen. */
+        void setPickPoint(const Vector2& position){ this->pickPoint_ = position; this->positionChanged(); }
+
+        //! Gets the pick point of this overlay. @see setPickPoint()
+        const Vector2& getPickPoint() const       { return this->pickPoint_; }
+
+        //! Sets the rotation angle applied to this overlay in degrees.
+        void setRotation(const Degree& angle)     { this->angle_ = angle; this->angleChanged(); }
+
+        //! Gets the rotation angle applied to this overlay in degrees.
+        const Radian& getRotation() const         { return this->angle_; }
+
+        //! Rotates the overlay by angle degrees.
+        void rotate(const Degree& angle)          { this->angle_ += angle; this->angleChanged(); }
+
+        //! Sets the size of this overlay.
+        void setSize(const Vector2& size)         { this->size_ = size; this->sizeChanged(); }
+
+        //! Gets the current size that was set (uncorrected)
+        Vector2 getSize() const                   { return this->size_ * this->sizeCorrection_; }
+
+        //! Gets the actual size of the overlay on the screen (corrected)
+        const Vector2& getActualSize() const      { return this->size_; }
+
+        //! Gets the current size correction (default: 1.0, 1.0)
+        const Vector2& getSizeCorrection() const  { return this->sizeCorrection_; }
+
+        //! Scales the overlay by scale.
+        void scale(const Vector2& scale)          { this->size_ *= scale; this->sizeChanged(); }
+
+        //! ConsoleCommand: Accesses the overlay by its name and scales it.
+        static void scaleOverlay(const std::string& name, float scale);
+        //! ConsoleCommand: Accesses the overlay by its name and scrolls it.
+        static void scrollOverlay(const std::string& name, const Vector2& scroll);
+        //! ConsoleCommand: Accesses the overlay by its name and rotates it.
+        static void rotateOverlay(const std::string& name, const Degree& angle);
+
+    protected:
+        virtual void changedVisibility();
+        virtual void angleChanged();
+        virtual void sizeCorrectionChanged();
+        virtual void sizeChanged();
+        virtual void positionChanged();
+
+        void setBackgroundMaterial(const std::string& material);
+        const std::string& getBackgroundMaterial() const;
+
+        Ogre::Overlay* overlay_;                   //!< The overlay the entire class is about.
+        Ogre::PanelOverlayElement* background_;    //!< Background image (blank per default).
+
+        float windowAspectRatio_;                  //!< Screen.width / screen.height
+        bool bCorrectAspect_;                      //!< Whether or not to correct the size. @see setAspectCorrection()
+        Vector2 size_;                             //!< Internal size of the overlay.
+        Vector2 sizeCorrection_;                   //!< Value to correct the size because of the window aspect.
+        Vector2 position_;                         //!< Position of the pickPoint on the screen.
+        Vector2 pickPoint_;                        //!< Point on the overlay to pick when translating
+        Radian angle_;                             //!< Rotation angle of the overlay
+
+    private:
+        void windowResized(int newWidth, int newHeight);
+
+        static unsigned int hudOverlayCounter_s;   //!< Static counter for hud elements
+        /** Contains all the overlays in a map for quick access via console commands.
+            We could also use the ObjectList, but that doesn't guarantee XMLPort(.) was called and is slower. */
+        static std::map<std::string, OrxonoxOverlay*> overlays_s;
+  };
+}
+
+#endif /* _OrxonoxOverlay_H__ */
Index: code/branches/input/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/OverlayGroup.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/OverlayGroup.cc	(revision 1629)
@@ -0,0 +1,168 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief Definition of the OverlayGroup class.
+*/
+
+#include "OrxonoxStableHeaders.h"
+#include "OverlayGroup.h"
+
+#include "core/Debug.h"
+#include "core/ConsoleCommand.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "OrxonoxOverlay.h"
+
+namespace orxonox
+{
+    CreateFactory(OverlayGroup);
+
+    SetConsoleCommand(OverlayGroup, toggleVisibility, false).setAccessLevel(AccessLevel::User);
+    SetConsoleCommand(OverlayGroup, scaleGroup, false).setAccessLevel(AccessLevel::User);
+    SetConsoleCommand(OverlayGroup, scrollGroup, false).setAccessLevel(AccessLevel::User);
+
+    OverlayGroup::OverlayGroup()
+    {
+        RegisterObject(OverlayGroup);
+    }
+
+    /**
+    @brief
+        Loads the group and all its children OrxonoxOverlays.
+    @copydoc
+        BaseObject::XMLPort()
+    */
+    void OverlayGroup::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        BaseObject::XMLPort(xmlElement, mode);
+
+        XMLPortParam(OverlayGroup, "scale",  setScale,  getScale,  xmlElement, mode).defaultValues(Vector2(1.0, 1.0));
+        XMLPortParam(OverlayGroup, "scroll", setScroll, getScroll, xmlElement, mode).defaultValues(Vector2(0.0, 0.0));
+        // loads all the child elements
+        XMLPortObject(OverlayGroup, OrxonoxOverlay, "", addElement, getElement, xmlElement, mode, false, true);
+    }
+
+    //! Scales every element in the map.
+    void OverlayGroup::setScale(const Vector2& scale)
+    {
+        for (std::map<std::string, OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+            (*it).second->scale(scale / this->scale_);
+        this->scale_ = scale;
+    }
+
+    //! Scrolls every element in the map.
+    void OverlayGroup::setScroll(const Vector2& scroll)
+    {
+        for (std::map<std::string, OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+            (*it).second->scroll(scroll - this->scroll_);
+        this->scroll_ = scroll;
+    }
+
+    /**
+    @brief
+        Adds an element to the map (used when loading with XMLPort).
+    @remarks
+        The names of the OrxonoxOverlays have to be unique!
+    */
+    void OverlayGroup::addElement(OrxonoxOverlay* element)
+    {
+        if (hudElements_.find(element->getName()) != hudElements_.end())
+        {
+            COUT(1) << "Ambiguous names encountered while load the HUD overlays" << std::endl;
+        }
+        else
+            hudElements_[element->getName()] = element;
+    }
+
+    //! Returns a different element as long as index < hudElements_.size().
+    OrxonoxOverlay* OverlayGroup::getElement(unsigned int index)
+    {
+        if (index < this->hudElements_.size())
+        {
+            std::map<std::string, OrxonoxOverlay*>::const_iterator it = hudElements_.begin();
+            for (unsigned int i = 0; i != index; ++it, ++i)
+                ;
+            return (*it).second;
+        }
+        else
+            return 0;
+    }
+
+
+    //########### Console commands ############
+
+    /**
+    @brief
+        Hides/shows an overlay group by its name.
+    @param name
+        The name of the group defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OverlayGroup::toggleVisibility(const std::string& name)
+    {
+        for (Iterator<OverlayGroup> it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        {
+            if ((*it)->getName() == name)
+                (*it)->setVisible(!((*it)->isVisible()));
+        }
+    }
+
+    /**
+    @brief
+        Scales an overlay group by its name.
+    @param name
+        The name of the group defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale)
+    {
+        for (Iterator<OverlayGroup> it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        {
+            if ((*it)->getName() == name)
+                (*it)->scale(Vector2(scale, scale));
+        }
+    }
+
+    /**
+    @brief
+        Scrolls an overlay group by its name.
+    @param name
+        The name of the group defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll)
+    {
+        for (Iterator<OverlayGroup> it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        {
+            if ((*it)->getName() == name)
+                (*it)->scroll(scroll);
+        }
+    }
+}
Index: code/branches/input/src/orxonox/overlays/OverlayGroup.h
===================================================================
--- code/branches/input/src/orxonox/overlays/OverlayGroup.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/OverlayGroup.h	(revision 1629)
@@ -0,0 +1,88 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief Declaration of the OverlayGroup class.
+*/
+
+#ifndef _OverlayGroup_H__
+#define _OverlayGroup_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <OgrePrerequisites.h>
+#include "core/BaseObject.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        OverlayGroup does almost exactly what it says: It groups OrxonoxOverlays together.
+        You can scroll the entire group by a certain amount. Scale however works differently
+        than expected: Each OrxonoxOverlay scales individually. That's quite useful when you
+        create your HUD with an OverlayGroup and then want to alter its size.
+    */
+    class _OrxonoxExport OverlayGroup : public BaseObject
+    {
+    public:
+        OverlayGroup();
+        //! Empty destructor.
+        ~OverlayGroup() { }
+
+        void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        static void toggleVisibility(const std::string& name);
+        static void scaleGroup(const std::string& name, float scale);
+        static void scrollGroup(const std::string& name, const Vector2& scroll);
+
+    private:
+        //! Scales each OrxonoxOverlay individually by scale.
+        void scale(const Vector2& scale) { this->setScale(scale * this->scale_); }
+        void setScale(const Vector2& scale);
+        //! Returns the current size of the group.
+        Vector2 getScale() const { return this->scale_; }
+
+        //! Scrolls each OrxonoxOverlay individually by scroll.
+        void scroll(const Vector2& scroll) { this->setScroll(scroll + this->scroll_); }
+        void setScroll(const Vector2& scroll);
+        //! Returns the current scrolling offset of the group.
+        Vector2 getScroll() const { return this->scale_; }
+
+        void addElement(OrxonoxOverlay* element);
+        OrxonoxOverlay* getElement(unsigned int index);
+
+        std::map<std::string, OrxonoxOverlay*> hudElements_;    //!< Contains all the OrxonoxOverlays of the this group.
+        Vector2 scale_;                                         //!< Current scale (independant of the elements).
+        Vector2 scroll_;                                        //!< Current scrolling offset.
+    };
+}
+
+#endif /* _OverlayGroup_H__ */
Index: code/branches/input/src/orxonox/overlays/OverlayText.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/OverlayText.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/OverlayText.cc	(revision 1629)
@@ -0,0 +1,96 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "OverlayText.h"
+
+#include <OgreOverlayManager.h>
+#include <OgreTextAreaOverlayElement.h>
+#include <OgrePanelOverlayElement.h>
+
+#include "util/Convert.h"
+#include "util/String.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(OverlayText);
+
+    OverlayText::OverlayText()
+        : text_(0)
+    {
+        RegisterObject(OverlayText);
+    }
+
+    OverlayText::~OverlayText()
+    {
+        if (this->text_)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->text_);
+    }
+
+    void OverlayText::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        OrxonoxOverlay::XMLPort(xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            this->text_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                .createOverlayElement("TextArea", "OverlayText_text_" + getUniqueNumberStr()));
+
+            this->background_->addChild(this->text_);
+        }
+
+        XMLPortParam(OverlayText, "font",     setFont,     getFont,     xmlElement, mode).defaultValues("Monofur");
+        XMLPortParam(OverlayText, "caption",  setCaption,  getCaption,  xmlElement, mode).defaultValues("");
+        XMLPortParam(OverlayText, "textSize", setTextSize, getTextSize, xmlElement, mode).defaultValues(1.0f);
+    }
+
+    void OverlayText::setFont(const std::string& font)
+    {
+        if (this->text_ && font != "")
+            this->text_->setFontName(font);
+    }
+
+    const std::string& OverlayText::getFont() const
+    {
+        if (this->text_)
+            return this->text_->getFontName();
+        else
+            return blankString;
+    }
+
+    void OverlayText::sizeChanged()
+    {
+        if (!this->overlay_)
+            return;
+
+        this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y);
+        positionChanged();
+    }
+}
Index: code/branches/input/src/orxonox/overlays/OverlayText.h
===================================================================
--- code/branches/input/src/orxonox/overlays/OverlayText.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/OverlayText.h	(revision 1629)
@@ -0,0 +1,66 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _OverlayText_H__
+#define _OverlayText_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <OgrePrerequisites.h>
+#include "OrxonoxOverlay.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport OverlayText : public OrxonoxOverlay
+    {
+    public:
+        OverlayText();
+        virtual ~OverlayText();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+    protected:
+        virtual void sizeChanged();
+
+        void setCaption(const std::string& caption) { this->caption_ = caption; }
+        const std::string& getCaption() const       { return this->caption_; }
+
+        void setFont(const std::string& font);
+        const std::string& getFont() const;
+
+        void setTextSize(float size) { this->setSize(Vector2(size, size)); }
+        float getTextSize() const    { return this->getSize().y; }
+
+        Ogre::TextAreaOverlayElement* text_;
+
+    private:
+        std::string caption_;
+    };
+}
+#endif /* _OverlayText_H__ */
Index: code/branches/input/src/orxonox/overlays/console/InGameConsole.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/console/InGameConsole.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/console/InGameConsole.cc	(revision 1629)
@@ -0,0 +1,585 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+
+#include "InGameConsole.h"
+
+#include <string>
+#include <OgreOverlay.h>
+#include <OgreOverlayElement.h>
+#include <OgreOverlayManager.h>
+#include <OgreOverlayContainer.h>
+#include <OgreStringConverter.h>
+
+#include "core/Debug.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "core/input/InputManager.h"
+#include "util/Math.h"
+#include "GraphicsEngine.h"
+
+#define LINES 30
+#define CHAR_WIDTH 7.45 // fix this please - determine the char-width dynamically
+
+namespace orxonox
+{
+    SetConsoleCommand(InGameConsole, openConsole, true);
+    SetConsoleCommand(InGameConsole, closeConsole, true);
+
+    /**
+        @brief Constructor: Creates and initializes the InGameConsole.
+    */
+    InGameConsole::InGameConsole() :
+        consoleOverlay_(0), consoleOverlayContainer_(0),
+        consoleOverlayNoise_(0), consoleOverlayCursor_(0), consoleOverlayBorder_(0),
+        consoleOverlayTextAreas_(0)
+    {
+        RegisterObject(InGameConsole);
+
+        this->bActive_ = false;
+        this->cursor_ = 0.0f;
+        this->cursorSymbol_ = '|';
+        this->inputWindowStart_ = 0;
+        this->numLinesShifted_ = LINES - 1;
+        // for the beginning, don't scroll
+        this->scroll_ = 0;
+
+        this->setConfigValues();
+    }
+
+    /**
+        @brief Destructor: Destroys the TextAreas.
+    */
+    InGameConsole::~InGameConsole(void)
+    {
+        this->destroy();
+    }
+
+    /**
+        @brief Returns a reference to the only existing instance of InGameConsole.
+    */
+    InGameConsole& InGameConsole::getInstance()
+    {
+        static InGameConsole instance;
+        return instance;
+    }
+
+    /**
+        @brief Sets the config values, describing the size of the console.
+    */
+    void InGameConsole::setConfigValues()
+    {
+        SetConfigValue(relativeWidth, 0.8);
+        SetConfigValue(relativeHeight, 0.4);
+        SetConfigValue(blinkTime, 0.5);
+        SetConfigValue(scrollSpeed_, 3.0f);
+        SetConfigValue(noiseSize_, 1.0f);
+        SetConfigValue(cursorSymbol_, '|');
+    }
+
+    /**
+        @brief Initializes the InGameConsole.
+    */
+    void InGameConsole::initialise()
+    {
+        // create overlay and elements
+        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
+
+        // create actual overlay
+        this->consoleOverlay_ = ovMan->create("InGameConsoleConsole");
+
+        // create a container
+        this->consoleOverlayContainer_ = static_cast<Ogre::OverlayContainer*>(ovMan->createOverlayElement("Panel", "InGameConsoleContainer"));
+        this->consoleOverlayContainer_->setMetricsMode(Ogre::GMM_RELATIVE);
+        this->consoleOverlayContainer_->setPosition((1 - this->relativeWidth) / 2, 0);
+        this->consoleOverlayContainer_->setDimensions(this->relativeWidth, this->relativeHeight);
+        this->consoleOverlay_->add2D(this->consoleOverlayContainer_);
+
+        // create BorderPanel
+        this->consoleOverlayBorder_ = static_cast<Ogre::BorderPanelOverlayElement*>(ovMan->createOverlayElement("BorderPanel", "InGameConsoleBorderPanel"));
+        this->consoleOverlayBorder_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayBorder_->setMaterialName("ConsoleCenter");
+        this->consoleOverlayBorder_->setBorderSize(16, 16, 0, 16);
+        this->consoleOverlayBorder_->setBorderMaterialName("ConsoleBorder");
+        this->consoleOverlayBorder_->setLeftBorderUV(0.0, 0.49, 0.5, 0.51);
+        this->consoleOverlayBorder_->setRightBorderUV(0.5, 0.49, 1.0, 0.5);
+        this->consoleOverlayBorder_->setBottomBorderUV(0.49, 0.5, 0.51, 1.0);
+        this->consoleOverlayBorder_->setBottomLeftBorderUV(0.0, 0.5, 0.5, 1.0);
+        this->consoleOverlayBorder_->setBottomRightBorderUV(0.5, 0.5, 1.0, 1.0);
+        this->consoleOverlayContainer_->addChild(this->consoleOverlayBorder_);
+
+        // create the text lines
+        this->consoleOverlayTextAreas_ = new Ogre::TextAreaOverlayElement*[LINES];
+        for (int i = 0; i < LINES; i++)
+        {
+            this->consoleOverlayTextAreas_[i] = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleTextArea" + Ogre::StringConverter::toString(i)));
+            this->consoleOverlayTextAreas_[i]->setMetricsMode(Ogre::GMM_PIXELS);
+            this->consoleOverlayTextAreas_[i]->setFontName("Monofur");
+            this->consoleOverlayTextAreas_[i]->setCharHeight(18);
+            this->consoleOverlayTextAreas_[i]->setParameter("colour_top", "0.21 0.69 0.21");
+            this->consoleOverlayTextAreas_[i]->setLeft(8);
+            this->consoleOverlayTextAreas_[i]->setCaption("");
+            this->consoleOverlayContainer_->addChild(this->consoleOverlayTextAreas_[i]);
+        }
+
+        // create cursor (also a text area overlay element)
+        this->consoleOverlayCursor_ = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleCursor"));
+        this->consoleOverlayCursor_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayCursor_->setFontName("Monofur");
+        this->consoleOverlayCursor_->setCharHeight(18);
+        this->consoleOverlayCursor_->setParameter("colour_top", "0.21 0.69 0.21");
+        this->consoleOverlayCursor_->setLeft(7);
+        this->consoleOverlayCursor_->setCaption(std::string(this->cursorSymbol_, 1));
+        this->consoleOverlayContainer_->addChild(this->consoleOverlayCursor_);
+
+        // create noise
+        this->consoleOverlayNoise_ = static_cast<Ogre::PanelOverlayElement*>(ovMan->createOverlayElement("Panel", "InGameConsoleNoise"));
+        this->consoleOverlayNoise_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayNoise_->setPosition(5,0);
+        this->consoleOverlayNoise_->setMaterialName("ConsoleNoiseSmall");
+        // comment following line to disable noise
+        this->consoleOverlayContainer_->addChild(this->consoleOverlayNoise_);
+
+        this->windowResized(GraphicsEngine::getSingleton().getWindowWidth(), GraphicsEngine::getSingleton().getWindowHeight());
+
+        // move overlay "above" the top edge of the screen
+        // we take -1.2 because the border makes the panel bigger
+        this->consoleOverlayContainer_->setTop(-1.2 * this->relativeHeight);
+
+        Shell::getInstance().addOutputLevel(true);
+
+        COUT(4) << "Info: InGameConsole initialized" << std::endl;
+    }
+
+    /**
+        @brief Destroys all the elements if necessary.
+    */
+    void InGameConsole::destroy()
+    {
+        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
+        if (ovMan)
+        {
+            if (this->consoleOverlayNoise_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayNoise_);
+            if (this->consoleOverlayCursor_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayCursor_);
+            if (this->consoleOverlayBorder_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayBorder_);
+            if (this->consoleOverlayTextAreas_)
+            {
+                for (int i = 0; i < LINES; i++)
+                {
+                    if (this->consoleOverlayTextAreas_[i])
+                      Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayTextAreas_[i]);
+                    this->consoleOverlayTextAreas_[i] = 0;
+                }
+
+            }
+            if (this->consoleOverlayContainer_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayContainer_);
+        }
+        if (this->consoleOverlayTextAreas_)
+        {
+            delete[] this->consoleOverlayTextAreas_;
+            this->consoleOverlayTextAreas_ = 0;
+        }
+    }
+
+    // ###############################
+    // ###  ShellListener methods  ###
+    // ###############################
+
+    /**
+        @brief Called if all output-lines have to be redrawn.
+    */
+    void InGameConsole::linesChanged()
+    {
+        std::list<std::string>::const_iterator it = Shell::getInstance().getNewestLineIterator();
+        int max = 0;
+        for (int i = 1; i < LINES; ++i)
+        {
+            if (it != Shell::getInstance().getEndIterator())
+            {
+                ++it;
+                max = i;
+            }
+            else
+                break;
+        }
+
+        for (int i = LINES - 1; i > max; --i)
+            this->print("", i, true);
+
+        for (int i = max; i >= 1; --i)
+        {
+            --it;
+            this->print(*it, i, true);
+        }
+    }
+
+    /**
+        @brief Called if only the last output-line has changed.
+    */
+    void InGameConsole::onlyLastLineChanged()
+    {
+        if (LINES > 1)
+            this->print(*Shell::getInstance().getNewestLineIterator(), 1);
+    }
+
+    /**
+        @brief Called if a new output-line was added.
+    */
+    void InGameConsole::lineAdded()
+    {
+        this->numLinesShifted_ = 0;
+        this->shiftLines();
+        this->onlyLastLineChanged();
+    }
+
+    /**
+        @brief Called if the text in the input-line has changed.
+    */
+    void InGameConsole::inputChanged()
+    {
+        if (LINES > 0)
+            this->print(Shell::getInstance().getInput(), 0);
+
+        if (Shell::getInstance().getInput() == "" || Shell::getInstance().getInput().size() == 0)
+            this->inputWindowStart_ = 0;
+    }
+
+    /**
+        @brief Called if the position of the cursor in the input-line has changed.
+    */
+    void InGameConsole::cursorChanged()
+    {
+        unsigned int pos = Shell::getInstance().getCursorPosition() - inputWindowStart_;
+        if (pos > maxCharsPerLine_)
+            pos = maxCharsPerLine_;
+        else if (pos < 0)
+            pos = 0;
+
+        this->consoleOverlayCursor_->setCaption(std::string(pos,' ') + cursorSymbol_);
+        this->consoleOverlayCursor_->setTop((int) this->windowH_ * this->relativeHeight - 24);
+    }
+
+    /**
+        @brief Called if the console gets closed.
+    */
+    void InGameConsole::exit()
+    {
+        this->deactivate();
+    }
+
+    // ###############################
+    // ###  other external calls   ###
+    // ###############################
+
+    /**
+        @brief Used to control the actual scrolling and the cursor.
+    */
+    void InGameConsole::tick(float dt)
+    {
+        if (this->scroll_ != 0)
+        {
+            float oldTop = this->consoleOverlayContainer_->getTop();
+
+            if (this->scroll_ > 0)
+            {
+                // scrolling down
+                // enlarge oldTop a little bit so that this exponential function
+                // reaches 0 before infinite time has passed...
+                float deltaScroll = (oldTop - 0.01) * dt * this->scrollSpeed_;
+                if (oldTop - deltaScroll >= 0)
+                {
+                    // window has completely scrolled down
+                    this->consoleOverlayContainer_->setTop(0);
+                    this->scroll_ = 0;
+                }
+                else
+                    this->consoleOverlayContainer_->setTop(oldTop - deltaScroll);
+            }
+
+            else
+            {
+                // scrolling up
+                // note: +0.01 for the same reason as when scrolling down
+                float deltaScroll = (1.2 * this->relativeHeight + 0.01 + oldTop) * dt * this->scrollSpeed_;
+                if (oldTop - deltaScroll <= -1.2 * this->relativeHeight)
+                {
+                    // window has completely scrolled up
+                    this->consoleOverlayContainer_->setTop(-1.2 * this->relativeHeight);
+                    this->scroll_ = 0;
+                    this->consoleOverlay_->hide();
+                }
+                else
+                    this->consoleOverlayContainer_->setTop(oldTop - deltaScroll);
+            }
+        }
+
+        if (this->bActive_)
+        {
+            this->cursor_ += dt;
+            if (this->cursor_ >= this->blinkTime)
+            {
+                this->cursor_ = 0;
+                bShowCursor_ = !bShowCursor_;
+                if (bShowCursor_)
+                    this->consoleOverlayCursor_->show();
+                else
+                    this->consoleOverlayCursor_->hide();
+            }
+
+            // this creates a flickering effect (extracts exactly 80% of the texture at a random location)
+            float uRand = (rand() & 1023) / 1023.0f * 0.2f;
+            float vRand = (rand() & 1023) / 1023.0f * 0.2f;
+            this->consoleOverlayNoise_->setUV(uRand, vRand, 0.8f + uRand, 0.8f + vRand);
+        }
+    }
+
+    /**
+        @brief Resizes the console elements. Call if window size changes.
+    */
+    void InGameConsole::windowResized(int newWidth, int newHeight)
+    {
+        this->windowW_ = newWidth;
+        this->windowH_ = newHeight;
+        this->consoleOverlayBorder_->setWidth((int) this->windowW_* this->relativeWidth);
+        this->consoleOverlayBorder_->setHeight((int) this->windowH_ * this->relativeHeight);
+        this->consoleOverlayNoise_->setWidth((int) this->windowW_ * this->relativeWidth - 10);
+        this->consoleOverlayNoise_->setHeight((int) this->windowH_ * this->relativeHeight - 5);
+        this->consoleOverlayNoise_->setTiling(consoleOverlayNoise_->getWidth() / (50.0f * this->noiseSize_), consoleOverlayNoise_->getHeight() / (50.0f * this->noiseSize_));
+
+        // now adjust the text lines...
+        this->desiredTextWidth_ = (int) (this->windowW_ * this->relativeWidth) - 12;
+
+        if (LINES > 0)
+            this->maxCharsPerLine_ = max((unsigned int)10, (unsigned int) ((float)this->desiredTextWidth_ / CHAR_WIDTH));
+        else
+            this->maxCharsPerLine_ = 10;
+
+        for (int i = 0; i < LINES; i++)
+        {
+            this->consoleOverlayTextAreas_[i]->setWidth(this->desiredTextWidth_);
+            this->consoleOverlayTextAreas_[i]->setTop((int) this->windowH_ * this->relativeHeight - 24 - 14*i);
+        }
+
+        this->linesChanged();
+        this->cursorChanged();
+    }
+
+    // ###############################
+    // ###    internal methods     ###
+    // ###############################
+
+    /**
+        @brief Prints string to bottom line.
+        @param s String to be printed
+    */
+    void InGameConsole::print(const std::string& text, int index, bool alwaysShift)
+    {
+        char level = 0;
+        if (text.size() > 0)
+            level = text[0];
+
+        std::string output = text;
+
+        if (level >= -1 && level <= 5)
+            output.erase(0, 1);
+
+        if (LINES > index)
+        {
+            this->colourLine(level, index);
+
+            if (index > 0)
+            {
+                unsigned int linesUsed = 1;
+                while (output.size() > this->maxCharsPerLine_)
+                {
+                    ++linesUsed;
+                    this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output.substr(0, this->maxCharsPerLine_)));
+                    output.erase(0, this->maxCharsPerLine_);
+                    output.insert(0, 1, ' ');
+                    if (linesUsed > numLinesShifted_ || alwaysShift)
+                        this->shiftLines();
+                    this->colourLine(level, index);
+                }
+                this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output));
+                this->displayedText_ = output;
+                this->numLinesShifted_ = linesUsed;
+            }
+            else
+            {
+                if (output.size() > this->maxCharsPerLine_)
+                {
+                    if (Shell::getInstance().getInputBuffer().getCursorPosition() < this->inputWindowStart_)
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition();
+                    else if (Shell::getInstance().getInputBuffer().getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition() - this->maxCharsPerLine_ + 1;
+
+                    output = output.substr(this->inputWindowStart_, this->maxCharsPerLine_);
+                }
+                else
+                  this->inputWindowStart_ = 0;
+                this->displayedText_ = output;
+                this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output));
+            }
+        }
+    }
+
+    /**
+        @brief Shows the InGameConsole.
+    */
+    void InGameConsole::activate()
+    {
+        if (!this->bActive_)
+        {
+            this->bActive_ = true;
+            InputManager::setInputState(InputManager::IS_CONSOLE);
+            Shell::getInstance().registerListener(this);
+
+            this->windowResized(this->windowW_, this->windowH_);
+            this->linesChanged();
+            this->cursorChanged();
+            this->consoleOverlay_->show();
+
+            // scroll down
+            this->scroll_ = 1;
+            // the rest is done by tick
+        }
+    }
+
+    /**
+    @brief Hides the InGameConsole.
+    */
+    void InGameConsole::deactivate()
+    {
+        if (this->bActive_)
+        {
+            this->bActive_ = false;
+            InputManager::setInputState(InputManager::IS_NORMAL);
+            Shell::getInstance().unregisterListener(this);
+
+            // scroll up
+            this->scroll_ = -1;
+            // the rest is done by tick
+        }
+    }
+
+    /**
+        @brief Shifts all output lines one line up
+    */
+    void InGameConsole::shiftLines()
+    {
+        for (unsigned int i = LINES - 1; i > 1; --i)
+        {
+            this->consoleOverlayTextAreas_[i]->setCaption(this->consoleOverlayTextAreas_[i - 1]->getCaption());
+            this->consoleOverlayTextAreas_[i]->setColourTop(this->consoleOverlayTextAreas_[i - 1]->getColourTop());
+            this->consoleOverlayTextAreas_[i]->setColourBottom(this->consoleOverlayTextAreas_[i - 1]->getColourBottom());
+        }
+    }
+
+    void InGameConsole::colourLine(int colourcode, int index)
+    {
+        if (colourcode == -1)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.90, 0.90, 0.90, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 1.00, 1.00, 1.00));
+        }
+        else if (colourcode == 1)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.25, 0.25, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.50, 0.50, 1.00));
+        }
+        else if (colourcode == 2)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.50, 0.20, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.70, 0.50, 1.00));
+        }
+        else if (colourcode == 3)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.50, 0.50, 0.95, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.80, 1.00, 1.00));
+        }
+        else if (colourcode == 4)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.65, 0.48, 0.44, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.90, 0.90, 1.00));
+        }
+        else if (colourcode == 5)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.40, 0.20, 0.40, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.60, 0.80, 1.00));
+        }
+        else
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.21, 0.69, 0.21, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 1.00, 0.80, 1.00));
+        }
+    }
+
+    // ###############################
+    // ###      satic methods      ###
+    // ###############################
+
+    /**
+        @brief Activates the console.
+    */
+    /*static*/ void InGameConsole::openConsole()
+    {
+        InGameConsole::getInstance().activate();
+    }
+
+    /**
+        @brief Deactivates the console.
+    */
+    /*static*/ void InGameConsole::closeConsole()
+    {
+        InGameConsole::getInstance().deactivate();
+    }
+
+    /**
+        @brief Converts a string into an Ogre::UTFString.
+        @param s The string to convert
+        @return The converted string
+    */
+    /*static*/ Ogre::UTFString InGameConsole::convert2UTF(std::string s)
+    {
+        Ogre::UTFString utf;
+        Ogre::UTFString::code_point cp;
+        for (unsigned int i = 0; i < s.size(); ++i)
+        {
+          cp = s[i];
+          cp &= 0xFF;
+          utf.append(1, cp);
+        }
+        return utf;
+    }
+}
Index: code/branches/input/src/orxonox/overlays/console/InGameConsole.h
===================================================================
--- code/branches/input/src/orxonox/overlays/console/InGameConsole.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/console/InGameConsole.h	(revision 1629)
@@ -0,0 +1,112 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+#ifndef _InGameConsole_H__
+#define _InGameConsole_H__
+
+
+#include "OrxonoxPrereqs.h"
+#include <OgrePrerequisites.h>
+#include <OgreBorderPanelOverlayElement.h>
+#include <OgreTextAreaOverlayElement.h>
+
+#include "core/Shell.h"
+#include "objects/Tickable.h"
+#include "tools/WindowEventListener.h"
+
+
+namespace orxonox
+{
+    class _OrxonoxExport InGameConsole : public TickableReal, public ShellListener, public WindowEventListener
+    {
+        public: // functions
+            void initialise();
+            void destroy();
+            void setConfigValues();
+
+            void tick(float dt);
+
+            static InGameConsole& getInstance();
+
+            static void openConsole();
+            static void closeConsole();
+
+        private: // functions
+            InGameConsole();
+            InGameConsole(const InGameConsole& other) {}
+            ~InGameConsole();
+
+            void activate();
+            void deactivate();
+
+            void linesChanged();
+            void onlyLastLineChanged();
+            void lineAdded();
+            void inputChanged();
+            void cursorChanged();
+            void exit();
+
+            void shiftLines();
+            void colourLine(int colourcode, int index);
+            void setCursorPosition(unsigned int pos);
+            void print(const std::string& text, int index, bool alwaysShift = false);
+
+            void windowResized(int newWidth, int newHeight);
+
+            static Ogre::UTFString convert2UTF(std::string s);
+
+        private: // variables
+            bool bActive_;
+            int windowW_;
+            int windowH_;
+            int desiredTextWidth_;
+            unsigned int maxCharsPerLine_;
+            unsigned int numLinesShifted_;
+            int scroll_;
+            float cursor_;
+            unsigned int inputWindowStart_;
+            bool bShowCursor_;
+            std::string displayedText_;
+            Ogre::Overlay* consoleOverlay_;
+            Ogre::OverlayContainer* consoleOverlayContainer_;
+            Ogre::PanelOverlayElement* consoleOverlayNoise_;
+            Ogre::TextAreaOverlayElement* consoleOverlayCursor_;
+            Ogre::BorderPanelOverlayElement* consoleOverlayBorder_;
+            Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_;
+
+            // config values
+            float relativeWidth;
+            float relativeHeight;
+            float blinkTime;
+            float scrollSpeed_;
+            float noiseSize_;
+            char cursorSymbol_;
+    };
+}
+
+#endif /* _InGameConsole_H__ */
Index: code/branches/input/src/orxonox/overlays/debug/DebugFPSText.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/debug/DebugFPSText.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/debug/DebugFPSText.cc	(revision 1629)
@@ -0,0 +1,54 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "DebugFPSText.h"
+#include <OgreTextAreaOverlayElement.h>
+#include "core/CoreIncludes.h"
+#include "GraphicsEngine.h"
+#include "util/Convert.h"
+
+namespace orxonox
+{
+    CreateFactory(DebugFPSText);
+
+    DebugFPSText::DebugFPSText()
+    {
+        RegisterObject(DebugFPSText);
+    }
+
+    DebugFPSText::~DebugFPSText()
+    {
+    }
+
+    void DebugFPSText::tick(float dt)
+    {
+        float fps = GraphicsEngine::getSingleton().getAverageFramesPerSecond();
+        this->text_->setCaption(this->getCaption() + convertToString(fps));
+    }
+}
Index: code/branches/input/src/orxonox/overlays/debug/DebugFPSText.h
===================================================================
--- code/branches/input/src/orxonox/overlays/debug/DebugFPSText.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/debug/DebugFPSText.h	(revision 1629)
@@ -0,0 +1,51 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _DebugFPSText_H__
+#define _DebugFPSText_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "overlays/OverlayText.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport DebugFPSText : public OverlayText, public Tickable
+    {
+    public:
+        DebugFPSText();
+        ~DebugFPSText();
+
+    private:
+        void tick(float dt);
+
+    private:
+    };
+}
+#endif /* _DebugFPSText_H__ */
Index: code/branches/input/src/orxonox/overlays/debug/DebugRTRText.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/debug/DebugRTRText.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/debug/DebugRTRText.cc	(revision 1629)
@@ -0,0 +1,54 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "DebugRTRText.h"
+#include <OgreTextAreaOverlayElement.h>
+#include "core/CoreIncludes.h"
+#include "util/Convert.h"
+#include "GraphicsEngine.h"
+
+namespace orxonox
+{
+    CreateFactory(DebugRTRText);
+
+    DebugRTRText::DebugRTRText()
+    {
+        RegisterObject(DebugRTRText);
+    }
+
+    DebugRTRText::~DebugRTRText()
+    {
+    }
+
+    void DebugRTRText::tick(float dt)
+    {
+        float rtr = GraphicsEngine::getSingleton().getAverageTickTime();
+        this->text_->setCaption(this->getCaption() + convertToString(rtr));
+    }
+}
Index: code/branches/input/src/orxonox/overlays/debug/DebugRTRText.h
===================================================================
--- code/branches/input/src/orxonox/overlays/debug/DebugRTRText.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/debug/DebugRTRText.h	(revision 1629)
@@ -0,0 +1,49 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _DebugRTRText_H__
+#define _DebugRTRText_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "overlays/OverlayText.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport DebugRTRText : public OverlayText, public Tickable
+    {
+    public:
+        DebugRTRText();
+        ~DebugRTRText();
+
+    private:
+        void tick(float dt);
+    };
+}
+#endif /* _DebugRTRText_H__ */
Index: code/branches/input/src/orxonox/overlays/hud/HUDBar.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/hud/HUDBar.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/hud/HUDBar.cc	(revision 1629)
@@ -0,0 +1,179 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Yuning Chai
+ *   Co-authors:
+ *      Felix Schulthess
+ *      Fabian 'x3n' Landau
+ *      Reto Grieder
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "HUDBar.h"
+
+#include <OgreOverlayManager.h>
+#include <OgreMaterialManager.h>
+#include <OgreTechnique.h>
+#include <OgrePanelOverlayElement.h>
+
+#include "util/Convert.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(BarColour);
+
+    BarColour::BarColour()
+        : position_(0.0)
+    {
+        RegisterObject(BarColour);
+    }
+
+    void BarColour::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        BaseObject::XMLPort(xmlElement, mode);
+
+        XMLPortParam(BarColour, "colour", setColour, getColour, xmlElement, mode)
+            .defaultValues(ColourValue(1.0, 1.0, 1.0, 1.0));
+        XMLPortParam(BarColour, "position", setPosition, getPosition, xmlElement, mode).defaultValues(0.0f);
+    }
+
+
+    unsigned int HUDBar::materialcount_s = 0;
+
+    HUDBar::HUDBar()
+        : bar_(0)
+        , textureUnitState_(0)
+    {
+        RegisterObject(HUDBar);
+    }
+
+    HUDBar::~HUDBar()
+    {
+        if (this->bar_)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->bar_);
+    }
+
+    void HUDBar::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        OrxonoxOverlay::XMLPort(xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            // create new material
+            std::string materialname = "barmaterial" + getConvertedValue<unsigned int, std::string>(materialcount_s++);
+            Ogre::MaterialPtr material = (Ogre::MaterialPtr)Ogre::MaterialManager::getSingleton().create(materialname, "General");
+            material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
+            this->textureUnitState_ = material->getTechnique(0)->getPass(0)->createTextureUnitState();
+            this->textureUnitState_->setTextureName("bar2.tga");
+            // use the default colour
+            this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, ColourValue(0.2, 0.7, 0.2));
+
+            this->bar_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                .createOverlayElement("Panel", "HUDBar_bar_" + getUniqueNumberStr()));
+            this->bar_->setMaterialName(materialname);
+            this->background_->addChild(bar_);
+        }
+
+        XMLPortParam(HUDBar, "initialValue", setValue,       getValue,       xmlElement, mode).defaultValues(0.4567654f);
+        XMLPortParam(HUDBar, "rightToLeft",  setRightToLeft, getRightToLeft, xmlElement, mode).defaultValues(false);
+        XMLPortParam(HUDBar, "autoColour",   setAutoColour,  getAutoColour,  xmlElement, mode).defaultValues(true);
+        XMLPortObject(HUDBar, BarColour, "", addColour, getColour, xmlElement, mode, false, true);
+    }
+
+    void HUDBar::valueChanged()
+    {
+        if (this->autoColour_ && this->textureUnitState_)
+        {
+            // set colour
+            if (this->colours_.size() > 0)
+            {
+                ColourValue colour1, colour2 = (*this->colours_.rbegin()).second;
+                float value1, value2 = (*this->colours_.rbegin()).first;
+                for (std::map<float, ColourValue>::reverse_iterator it = this->colours_.rbegin(); it != this->colours_.rend(); ++it)
+                {
+                    colour1 = colour2;
+                    value1 = value2;
+                    colour2 = (*it).second;
+                    value2 = (*it).first;
+
+                    if (value2 < this->value_)
+                        break;
+                }
+
+                if (value2 > this->value_)
+                {
+                    this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour2);
+                }
+                else if (value1 < this->value_)
+                {
+                    this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour1);
+                }
+                else
+                {
+                    //float interpolationfactor = (this->value_ - value2) / (value1 - value2);
+                    float interpolationfactor = interpolateSmooth((this->value_ - value2) / (value1 - value2), 0.0f, 1.0f);
+                    this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour1 * interpolationfactor + colour2 * (1 - interpolationfactor));
+                }
+            }
+        }
+
+        // set value
+        if (this->right2Left_)
+        {
+            // backward casew
+            this->bar_->setPosition(0.06f + 0.88f * (1 - this->value_), 0.0f);
+            this->bar_->setDimensions(0.88f * this->value_, 1.0f);
+        }
+        else
+        {
+            // default case
+            this->bar_->setPosition(0.06f, 0.0f);
+            this->bar_->setDimensions(0.88f * this->value_, 1.0f);
+        }
+        if (this->value_ != 0)
+            this->bar_->setTiling(this->value_, 1.0);
+    }
+
+    void HUDBar::addColour(BarColour* colour)
+    {
+        float value = clamp<float>(colour->getPosition(), 0.0, 1.0);
+        this->colours_[value] = colour->getColour();
+
+        this->barColours_.push_back(colour);
+    }
+
+    BarColour* HUDBar::getColour(unsigned int index)
+    {
+        if (index < this->barColours_.size())
+            return barColours_[index];
+        else
+            return 0;
+    }
+
+    void HUDBar::clearColours()
+    {
+        this->colours_.clear();
+    }
+}
Index: code/branches/input/src/orxonox/overlays/hud/HUDBar.h
===================================================================
--- code/branches/input/src/orxonox/overlays/hud/HUDBar.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/hud/HUDBar.h	(revision 1629)
@@ -0,0 +1,101 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Yuning Chai
+ *   Co-authors:
+ *      Felix Schulthess
+ *      Fabian 'x3n' Landau
+ *      Reto Grieder
+ *
+ */
+
+#ifndef _HUDBar_H__
+#define _HUDBar_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <OgrePrerequisites.h>
+#include "util/Math.h"
+#include "overlays/OrxonoxOverlay.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport BarColour : public BaseObject
+    {
+    public:
+        BarColour();
+        ~BarColour() { }
+
+        void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        void setColour(const ColourValue& colour) { this->colour_ = colour; }
+        const ColourValue& getColour() const { return this->colour_; }
+
+        void setPosition(float pos) { this->position_ = pos; }
+        float getPosition() const    { return this->position_; }
+
+    private:
+        ColourValue colour_;
+        float position_;
+    };
+
+
+    class _OrxonoxExport HUDBar : public OrxonoxOverlay
+    {
+    public:
+        HUDBar();
+        virtual ~HUDBar();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        void clearColours();
+
+        void setRightToLeft(bool r2l) { this->right2Left_ = r2l; this->valueChanged(); }
+        bool getRightToLeft() const   { return this->right2Left_; }
+
+        void setValue(float value)    { this->value_ = clamp(value, 0.0f, 1.0f); this->valueChanged(); }
+        float getValue() const        { return this->value_; }
+
+        void setAutoColour(bool val)  { this->autoColour_ = val; this->valueChanged(); }
+        bool getAutoColour() const    { return this->autoColour_; }
+
+    protected:
+        virtual void valueChanged();
+
+    private:
+        void addColour(BarColour* colour);
+        BarColour* getColour(unsigned int index);
+
+        bool right2Left_;
+        bool autoColour_;                   //!< whether bar changes colour automatically
+        float value_;                       //!< progress of bar
+
+        Ogre::PanelOverlayElement* bar_;
+        Ogre::TextureUnitState* textureUnitState_;
+        std::map<float, ColourValue> colours_;
+        std::vector<BarColour*> barColours_;
+
+        static unsigned int materialcount_s;
+    };
+}
+#endif /* _HUDBar_H__ */
Index: code/branches/input/src/orxonox/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/hud/HUDNavigation.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/hud/HUDNavigation.cc	(revision 1629)
@@ -0,0 +1,274 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "HUDNavigation.h"
+
+#include <OgreOverlayManager.h>
+#include <OgreTextAreaOverlayElement.h>
+#include <OgrePanelOverlayElement.h>
+
+#include "util/Math.h"
+#include "util/String.h"
+#include "util/Convert.h"
+#include "core/ConsoleCommand.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/SpaceShip.h"
+#include "objects/Projectile.h"
+#include "objects/CameraHandler.h"
+#include "Radar.h"
+
+namespace orxonox
+{
+    CreateFactory(HUDNavigation);
+
+    HUDNavigation::HUDNavigation()
+        : navMarker_(0)
+        , aimMarker_(0)
+        , navText_(0)
+    {
+        RegisterObject(HUDNavigation);
+    }
+
+    HUDNavigation::~HUDNavigation()
+    {
+        if (this->navMarker_)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navMarker_);
+        if (this->navText_)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navText_);
+        if (this->aimMarker_)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->aimMarker_);
+    }
+
+    void HUDNavigation::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        OrxonoxOverlay::XMLPort(xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            // create nav text
+            navText_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberStr()));
+
+            // create nav marker
+            navMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberStr()));
+            navMarker_->setMaterialName("Orxonox/NavArrows");
+            wasOutOfView_ = true; // just to ensure the material is changed right the first time..
+
+            // create aim marker
+            aimMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                .createOverlayElement("Panel", "HUDNavigation_aimMarker_" + getUniqueNumberStr()));
+            aimMarker_->setMaterialName("Orxonox/NavCrosshair");
+            
+            background_->addChild(navMarker_);
+            background_->addChild(aimMarker_);
+            background_->addChild(navText_);
+
+            // hide at first
+            this->setVisible(false);
+        }
+
+        XMLPortParam(HUDNavigation, "font",     setFont,     getFont,     xmlElement, mode).defaultValues("Monofur");
+        XMLPortParam(HUDNavigation, "textSize", setTextSize, getTextSize, xmlElement, mode).defaultValues(0.05f);
+        XMLPortParam(HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlElement, mode)
+            .defaultValues(0.05f);
+        XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode)
+            .defaultValues(0.04f);
+    }
+
+    void HUDNavigation::setFont(const std::string& font)
+    {
+        if (this->navText_ && font != "")
+            this->navText_->setFontName(font);
+    }
+
+    const std::string& HUDNavigation::getFont() const
+    {
+        if (this->navText_)
+            return this->navText_->getFontName();
+        else
+            return blankString;
+    }
+
+    void HUDNavigation::setTextSize(float size)
+    {
+        if (this->navText_ && size >= 0.0f)
+            this->navText_->setCharHeight(size);
+    }
+
+    float HUDNavigation::getTextSize() const
+    {
+        if (this->navText_)
+            return this->navText_->getCharHeight();
+        else
+            return 0.0f;
+    }
+
+    void HUDNavigation::tick(float dt)
+    {
+        if (!Radar::getInstance().getFocus())
+        {
+            this->overlay_->hide();
+            return;
+        }
+        else
+        {
+            this->overlay_->show();
+        }
+
+        // set text
+        int dist = (int) getDist2Focus();
+        navText_->setCaption(convertToString(dist));
+        float textLength = convertToString(dist).size() * navText_->getCharHeight() * 0.3;
+
+        Ogre::Camera* navCam = SpaceShip::getLocalShip()->getCamera()->cam_;
+        Matrix4 transformationMatrix = navCam->getProjectionMatrix() * navCam->getViewMatrix();
+        // transform to screen coordinates
+        Vector3 pos = transformationMatrix * Radar::getInstance().getFocus()->getWorldPosition();
+
+        bool outOfView;
+        if (pos.z > 1.0)
+        {
+            // z > 1.0 means that the object is behind the camera
+            outOfView = true;
+            // we have to switch all coordinates (if you don't know why,
+            // try linear algebra lectures, because I can't explain..)
+            pos.x = -pos.x;
+            pos.y = -pos.y;
+        }
+        else
+            outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
+
+        if (outOfView)
+        {
+            // object is not in view
+            aimMarker_->hide();
+
+            if (!wasOutOfView_)
+            {
+                navMarker_->setMaterialName("Orxonox/NavArrows");
+                wasOutOfView_ = true;
+            }
+
+            if (pos.x < pos.y)
+            {
+                if (pos.y > -pos.x)
+                {
+                    // up
+                    float position = pos.x / pos.y + 1.0;
+                    navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5, 0.0);
+                    navMarker_->setUV(0.5, 0.0, 1.0, 0.5);
+                    navText_->setLeft((position - textLength) * 0.5);
+                    navText_->setTop(navMarker_->getHeight());
+                }
+                else
+                {
+                    // left
+                    float position = pos.y / pos.x + 1.0;
+                    navMarker_->setPosition(0.0, (position - navMarker_->getWidth()) * 0.5);
+                    navMarker_->setUV(0.0, 0.0, 0.5, 0.5);
+                    navText_->setLeft(navMarker_->getWidth() + 0.01);
+                    navText_->setTop((position - navText_->getCharHeight()) * 0.5);
+                }
+            }
+            else
+            {
+                if (pos.y < -pos.x)
+                {
+                    // down
+                    float position = -pos.x / pos.y + 1.0;
+                    navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5, 1.0 - navMarker_->getHeight());
+                    navMarker_->setUV(0.0, 0.5, 0.5, 1.0);
+                    navText_->setLeft((position - textLength) * 0.5);
+                    navText_->setTop(1.0 - navMarker_->getHeight() - navText_->getCharHeight());
+                }
+                else
+                {
+                    // right
+                    float position = -pos.y / pos.x + 1.0;
+                    navMarker_->setPosition(1.0 - navMarker_->getWidth(), (position - navMarker_->getHeight()) * 0.5);
+                    navMarker_->setUV(0.5, 0.5, 1.0, 1.0);
+                    navText_->setLeft(1.0 - navMarker_->getWidth() - textLength - 0.01);
+                    navText_->setTop((position - navText_->getCharHeight()) * 0.5);
+                }
+            }
+        }
+        else
+        {
+            // object is in view
+
+            Vector3 aimpos = transformationMatrix * getPredictedPosition(SpaceShip::getLocalShip()->getPosition(),
+                    Projectile::getSpeed(), Radar::getInstance().getFocus()->getWorldPosition(), Radar::getInstance().getFocus()->getOrientedVelocity());
+
+            if (wasOutOfView_)
+            {
+                navMarker_->setMaterialName("Orxonox/NavTDC");
+                wasOutOfView_ = false;
+            }
+
+            // object is in view
+            navMarker_->setUV(0.0, 0.0, 1.0, 1.0);
+            navMarker_->setLeft((pos.x + 1.0 - navMarker_->getWidth()) * 0.5);
+            navMarker_->setTop((-pos.y + 1.0 - navMarker_->getHeight()) * 0.5);
+
+            aimMarker_->show();
+            aimMarker_->setLeft((aimpos.x + 1.0 - aimMarker_->getWidth()) * 0.5);
+            aimMarker_->setTop((-aimpos.y + 1.0 - aimMarker_->getHeight()) * 0.5);
+
+            navText_->setLeft((pos.x + 1.0 + navMarker_->getWidth()) * 0.5);
+            navText_->setTop((-pos.y + 1.0 + navMarker_->getHeight()) * 0.5);
+        }
+    }
+
+    float HUDNavigation::getDist2Focus() const
+    {
+        if (Radar::getInstance().getFocus())
+            return (Radar::getInstance().getFocus()->getWorldPosition() - SpaceShip::getLocalShip()->getPosition()).length();
+        else
+            return 0;
+    }
+
+    /**
+    @brief Overridden method of OrxonoxOverlay. Usually the entire overlay
+           scales with scale(). Here we obviously have to adjust this.
+    */
+    void HUDNavigation::sizeChanged()
+    {
+        // use size to compensate for apspect ratio if enabled.
+        float xScale = this->getActualSize().x;
+        float yScale = this->getActualSize().y;
+        if (this->navMarker_)
+            navMarker_->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale);
+        if (this->aimMarker_)
+            aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale);
+        if (this->navText_)
+            navText_->setCharHeight(navText_->getCharHeight() * yScale);
+    }
+}
Index: code/branches/input/src/orxonox/overlays/hud/HUDNavigation.h
===================================================================
--- code/branches/input/src/orxonox/overlays/hud/HUDNavigation.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/hud/HUDNavigation.h	(revision 1629)
@@ -0,0 +1,81 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+#ifndef _HUDNavigation_H__
+#define _HUDNavigation_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgrePrerequisites.h>
+#include "overlays/OrxonoxOverlay.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HUDNavigation : public OrxonoxOverlay, public Tickable
+    {
+    public:
+        HUDNavigation();
+        ~HUDNavigation();
+
+        void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+    private:
+        void sizeChanged();
+        void angleChanged() { }
+        void positionChanged() { }
+
+        void tick(float dt);
+
+        // XMLPort accessors
+        void setNavMarkerSize(float size) { this->navMarkerSize_ = size; this->sizeChanged(); }
+        float getNavMarkerSize() const    { return this->navMarkerSize_; }
+
+        void setAimMarkerSize(float size) { this->aimMarkerSize_ = size; this->sizeChanged(); }
+        float getAimMarkerSize() const    { return this->aimMarkerSize_; }
+
+        void setTextSize(float size);
+        float getTextSize() const;
+
+        void setFont(const std::string& font);
+        const std::string& getFont() const;
+
+        void updateMarker();
+        void updateFocus();
+        float getDist2Focus() const;
+
+        Ogre::PanelOverlayElement* navMarker_;      //!< the panel used to show the arrow and the target marker
+        float navMarkerSize_;                       //!< One paramter size of the navigation marker
+        Ogre::PanelOverlayElement* aimMarker_;      //!< Panel used to show the aim Marker
+        float aimMarkerSize_;                       //!< One paramter size of the aim marker
+        Ogre::TextAreaOverlayElement* navText_;     //!< Text overlay to display the target distance
+        bool wasOutOfView_;                         //!< Performance booster variable: setMaterial is not cheap
+    };
+}
+
+#endif /* _HUDNavigation_H__ */
Index: code/branches/input/src/orxonox/overlays/hud/HUDRadar.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/hud/HUDRadar.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/hud/HUDRadar.cc	(revision 1629)
@@ -0,0 +1,152 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Yuning Chai
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "HUDRadar.h"
+
+#include <OgreOverlayManager.h>
+#include <OgrePanelOverlayElement.h>
+
+#include "util/Math.h"
+#include "core/ConsoleCommand.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/SpaceShip.h"
+#include "objects/WorldEntity.h"
+#include "tools/TextureGenerator.h"
+#include "Radar.h"
+
+namespace orxonox
+{
+    CreateFactory(HUDRadar);
+
+    HUDRadar::HUDRadar()
+        : marker_(0)
+    {
+        RegisterObject(HUDRadar);
+    }
+
+    HUDRadar::~HUDRadar()
+    {
+        if (this->marker_)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->marker_);
+        for (std::vector<Ogre::PanelOverlayElement*>::iterator it = this->radarDots_.begin();
+            it != this->radarDots_.end(); ++it)
+        {
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(*it);
+        }
+    }
+
+    void HUDRadar::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        OrxonoxOverlay::XMLPort(xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            marker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                .createOverlayElement("Panel", "HUDRadar_marker_" + getUniqueNumberStr()));
+            marker_->setMaterialName("Orxonox/RadarMarker");
+            overlay_->add2D(marker_);
+            marker_->hide();
+        }
+
+        XMLPortParam(HUDRadar, "sensitivity", setRadarSensitivity, getRadarSensitivity, xmlElement, mode)
+            .defaultValues(1.0f);
+        XMLPortParam(HUDRadar, "halfDotSizeDistance", setHalfDotSizeDistance, getHalfDotSizeDistance,
+            xmlElement, mode).defaultValues(3000.0f);
+        XMLPortParam(HUDRadar, "maximumDotSize", setMaximumDotSize, getMaximumDotSize, xmlElement, mode)
+            .defaultValues(0.1f);
+
+        shapeMaterials_[RadarViewable::Dot]      = "RadarSquare.tga";
+        shapeMaterials_[RadarViewable::Triangle] = "RadarSquare.tga";
+        shapeMaterials_[RadarViewable::Square]   = "RadarSquare.tga";
+    }
+
+    void HUDRadar::displayObject(RadarViewable* object, bool bIsMarked)
+    {
+        const WorldEntity* wePointer = object->getWorldEntity();
+
+        // Just to be sure that we actually have a WorldEntity
+        // We could do a dynamic_cast, but that's a lot slower
+        if (!wePointer)
+        {
+            CCOUT(4) << "Cannot display a non-WorldEntitiy on the radar" << std::endl;
+            return;
+        }
+
+        // try to find a panel already created
+        Ogre::PanelOverlayElement* panel;
+        //std::map<RadarViewable*, Ogre::PanelOverlayElement*>::iterator it = this->radarDots_.find(object);
+        if (itRadarDots_ == this->radarDots_.end())
+        {
+            // we have to create a new entry
+            panel = static_cast<Ogre::PanelOverlayElement*>(
+                Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "RadarDot" + getUniqueNumberStr()));
+            radarDots_.push_back(panel);
+            // get right material
+            panel->setMaterialName(TextureGenerator::getMaterialName(
+                shapeMaterials_[object->getRadarObjectType()], object->getRadarObjectColour()));
+            this->overlay_->add2D(panel);
+            this->itRadarDots_ = this->radarDots_.end();
+        }
+        else
+        {
+            panel = *itRadarDots_;
+            ++itRadarDots_;
+            std::string materialName = TextureGenerator::getMaterialName(
+                shapeMaterials_[object->getRadarObjectType()], object->getRadarObjectColour());
+            if (materialName != panel->getMaterialName())
+                panel->setMaterialName(materialName);
+        }
+
+        // set size to fit distance...
+        float distance = (wePointer->getWorldPosition() - SpaceShip::getLocalShip()->getPosition()).length();
+        // calculate the size with 1/distance dependency for simplicity (instead of exp(-distance * lambda)
+        float size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance);
+        panel->setDimensions(size, size);
+
+        // calc position on radar...
+        Vector2 coord = get2DViewcoordinates(SpaceShip::getLocalShip()->getPosition(), SpaceShip::getLocalShip()->getDir(), SpaceShip::getLocalShip()->getOrth(), wePointer->getWorldPosition());
+        coord *= Ogre::Math::PI / 3.5; // small adjustment to make it fit the texture
+        panel->setPosition((1.0 + coord.x - size) * 0.5, (1.0 - coord.y - size) * 0.5);
+
+        if (bIsMarked)
+        {
+            this->marker_->show();
+            this->marker_->setDimensions(size * 1.5, size * 1.5);
+            this->marker_->setPosition((1.0 + coord.x - size * 1.5) * 0.5, (1.0 - coord.y - size * 1.5) * 0.5);
+        }
+    }
+
+    void HUDRadar::radarTick(float dt)
+    {
+        this->itRadarDots_ = this->radarDots_.begin();
+        this->marker_->hide();
+    }
+}
Index: code/branches/input/src/orxonox/overlays/hud/HUDRadar.h
===================================================================
--- code/branches/input/src/orxonox/overlays/hud/HUDRadar.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/hud/HUDRadar.h	(revision 1629)
@@ -0,0 +1,81 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Yuning Chai
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+#ifndef _HUDRadar_H__
+#define _HUDRadar_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <vector>
+#include <map>
+#include <OgrePrerequisites.h>
+#include "overlays/OrxonoxOverlay.h"
+#include "RadarListener.h"
+#include "RadarViewable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HUDRadar : public OrxonoxOverlay, public RadarListener
+    {
+    public:
+        HUDRadar();
+        ~HUDRadar();
+
+        void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+    private:
+        // XML accessors
+        float getHalfDotSizeDistance() const { return this->halfDotSizeDistance_; }
+        void setHalfDotSizeDistance(float distance) { this->halfDotSizeDistance_ = distance; }
+
+        float getMaximumDotSize() const { return this->maximumDotSize_; }
+        void setMaximumDotSize(float size) { this->maximumDotSize_ = size; }
+
+        float getRadarSensitivity() const { return this->sensitivity_; }
+        // used also by RadarListener interface!
+        void setRadarSensitivity(float sensitivity) { this->sensitivity_ = sensitivity; }
+
+        // RadarListener interface
+        void displayObject(RadarViewable* viewable, bool bIsMarked);
+        void radarTick(float dt);
+
+        std::map<RadarViewable::Shape, std::string> shapeMaterials_;
+
+        std::vector<Ogre::PanelOverlayElement*> radarDots_;
+        std::vector<Ogre::PanelOverlayElement*>::iterator itRadarDots_;
+        Ogre::PanelOverlayElement* marker_;
+
+        float halfDotSizeDistance_;
+        float maximumDotSize_;
+
+        float sensitivity_;
+    };
+}
+
+#endif /* _HUDRadar_H__ */
Index: code/branches/input/src/orxonox/overlays/hud/HUDSpeedBar.cc
===================================================================
--- code/branches/input/src/orxonox/overlays/hud/HUDSpeedBar.cc	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/hud/HUDSpeedBar.cc	(revision 1629)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Felix Schulthess
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "HUDSpeedBar.h"
+#include "core/CoreIncludes.h"
+#include "objects/SpaceShip.h"
+
+namespace orxonox
+{
+    CreateFactory(HUDSpeedBar);
+
+    HUDSpeedBar::HUDSpeedBar()
+    {
+        RegisterObject(HUDSpeedBar);
+
+    }
+
+    HUDSpeedBar::~HUDSpeedBar()
+    {
+    }
+
+    void HUDSpeedBar::tick(float dt)
+    {
+        SpaceShip* ship = SpaceShip::getLocalShip();
+        if (ship)
+        {
+            float v = ship->getVelocity().length();
+            float value = v / ship->getMaxSpeed();
+			if (value != this->getValue())
+                this->setValue(value);
+        }
+    }
+}
Index: code/branches/input/src/orxonox/overlays/hud/HUDSpeedBar.h
===================================================================
--- code/branches/input/src/orxonox/overlays/hud/HUDSpeedBar.h	(revision 1629)
+++ code/branches/input/src/orxonox/overlays/hud/HUDSpeedBar.h	(revision 1629)
@@ -0,0 +1,50 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Felix Schulthess
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HUDSpeedBar_H__
+#define _HUDSpeedBar_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "HUDBar.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HUDSpeedBar : public HUDBar, public Tickable
+    {
+    public:
+        HUDSpeedBar();
+        ~HUDSpeedBar();
+
+    private:
+        void tick(float dt);
+    };
+}
+#endif /* _HUDSpeedBar_H__ */
Index: code/branches/input/src/orxonox/tools/BillboardSet.cc
===================================================================
--- code/branches/input/src/orxonox/tools/BillboardSet.cc	(revision 1623)
+++ code/branches/input/src/orxonox/tools/BillboardSet.cc	(revision 1629)
@@ -46,5 +46,32 @@
     }
 
-    void BillboardSet::setBillboardSet(const std::string& file, const ColourValue& colour, int count, const Vector3& position)
+    void BillboardSet::setBillboardSet(const std::string& file, int count)
+    {
+        std::ostringstream name;
+        name << (BillboardSet::billboardSetCounter_s++);
+        this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
+        this->billboardSet_->createBillboard(Vector3::ZERO);
+        this->billboardSet_->setMaterialName(file);
+    }
+
+    void BillboardSet::setBillboardSet(const std::string& file, const ColourValue& colour, int count)
+    {
+        std::ostringstream name;
+        name << (BillboardSet::billboardSetCounter_s++);
+        this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
+        this->billboardSet_->createBillboard(Vector3::ZERO, colour);
+        this->billboardSet_->setMaterialName(file);
+    }
+
+    void BillboardSet::setBillboardSet(const std::string& file, const Vector3& position, int count)
+    {
+        std::ostringstream name;
+        name << (BillboardSet::billboardSetCounter_s++);
+        this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
+        this->billboardSet_->createBillboard(position);
+        this->billboardSet_->setMaterialName(file);
+    }
+
+    void BillboardSet::setBillboardSet(const std::string& file, const ColourValue& colour, const Vector3& position, int count)
     {
         std::ostringstream name;
Index: code/branches/input/src/orxonox/tools/BillboardSet.h
===================================================================
--- code/branches/input/src/orxonox/tools/BillboardSet.h	(revision 1623)
+++ code/branches/input/src/orxonox/tools/BillboardSet.h	(revision 1629)
@@ -33,6 +33,6 @@
 
 #include <string>
+#include <OgreBillboardSet.h>
 
-#include <OgreBillboardSet.h>
 #include "util/Math.h"
 
@@ -44,5 +44,8 @@
             BillboardSet();
             ~BillboardSet();
-            void setBillboardSet(const std::string& file, const ColourValue& colour = ColourValue(1.0, 1.0, 1.0), int count = 1, const Vector3& position = Vector3::ZERO);
+            void setBillboardSet(const std::string& file, int count = 1);
+            void setBillboardSet(const std::string& file, const ColourValue& colour, int count = 1);
+            void setBillboardSet(const std::string& file, const Vector3& position, int count = 1);
+            void setBillboardSet(const std::string& file, const ColourValue& colour, const Vector3& position, int count = 1);
 
             inline Ogre::BillboardSet* getBillboardSet()
@@ -51,4 +54,9 @@
             inline const std::string& getName() const
                 { return this->billboardSet_->getName(); }
+
+            inline void setVisible(bool visible)
+                { this->billboardSet_->setVisible(visible); }
+            inline bool getVisible() const
+                { return this->billboardSet_->getVisible(); }
 
         private:
Index: code/branches/input/src/orxonox/tools/Mesh.h
===================================================================
--- code/branches/input/src/orxonox/tools/Mesh.h	(revision 1623)
+++ code/branches/input/src/orxonox/tools/Mesh.h	(revision 1629)
@@ -51,4 +51,9 @@
                 { return this->entity_->getName(); }
 
+            inline void setVisible(bool visible)
+                { if (this->entity_) this->entity_->setVisible(visible); }
+            inline bool getVisible() const
+                { if (this->entity_) return this->entity_->getVisible(); else return false; }
+
         private:
             static unsigned int meshCounter_s;
Index: code/branches/input/src/orxonox/tools/ParticleInterface.cc
===================================================================
--- code/branches/input/src/orxonox/tools/ParticleInterface.cc	(revision 1629)
+++ code/branches/input/src/orxonox/tools/ParticleInterface.cc	(revision 1629)
@@ -0,0 +1,188 @@
+/*
+*   ORXONOX - the hottest 3D action shooter ever to exist
+*
+*
+*   License notice:
+*
+*   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
+*   of the License, or (at your option) any later version.
+*
+*   This program is distributed in the hope that it will be useful,
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*   GNU General Public License for more details.
+*
+*   You should have received a copy of the GNU General Public License
+*   along with this program; if not, write to the Free Software
+*   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+*
+*   Author:
+*      ...
+*   Co-authors:
+*      ...
+*
+*/
+
+/**
+* @file ParticleInterface.cc
+* @brief class to control praticle effects
+*/
+
+#include "OrxonoxStableHeaders.h"
+#include "ParticleInterface.h"
+
+#include <OgreParticleSystem.h>
+#include <OgreParticleEmitter.h>
+#include <OgreSceneManager.h>
+
+#include "GraphicsEngine.h"
+#include "Orxonox.h"
+#include "core/CoreIncludes.h"
+#include "util/Convert.h"
+
+namespace orxonox
+{
+  unsigned int ParticleInterface::counter_s = 0;
+  ParticleInterface* ParticleInterface::currentParticleInterface_s = 0;
+
+  ParticleInterface::ParticleInterface(const std::string& templateName, LODParticle::LOD detaillevel)
+  {
+    RegisterRootObject(ParticleInterface);
+
+    this->sceneNode_ = 0;
+    this->bEnabled_ = true;
+    this->detaillevel_ = (unsigned int)detaillevel;
+    this->particleSystem_ = GraphicsEngine::getSingleton().getSceneManager()->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
+    this->particleSystem_->setSpeedFactor(Orxonox::getSingleton()->getTimeFactor());
+
+    if (GraphicsEngine::getSingleton().getDetailLevelParticle() < (unsigned int)this->detaillevel_)
+    {
+      this->bVisible_ = false;
+      this->updateVisibility();
+    }
+    else
+    {
+      this->bVisible_ = true;
+    }
+  }
+
+  ParticleInterface::~ParticleInterface()
+  {
+    this->particleSystem_->removeAllEmitters();
+    GraphicsEngine::getSingleton().getSceneManager()->destroyParticleSystem(particleSystem_);
+  }
+
+  void ParticleInterface::addToSceneNode(Ogre::SceneNode* sceneNode)
+  {
+    this->sceneNode_ = sceneNode;
+    this->sceneNode_->attachObject(this->particleSystem_);
+  }
+
+  void ParticleInterface::detachFromSceneNode()
+  {
+    if (this->sceneNode_)
+    {
+      this->sceneNode_->detachObject(this->particleSystem_);
+      this->sceneNode_ = 0;
+    }
+  }
+
+  Ogre::ParticleEmitter* ParticleInterface::createNewEmitter()
+  {
+    if (this->particleSystem_->getNumEmitters() > 0)
+    {
+      Ogre::ParticleEmitter* newemitter = this->particleSystem_->addEmitter(this->particleSystem_->getEmitter(0)->getType());
+      this->particleSystem_->getEmitter(0)->copyParametersTo(newemitter);
+      return newemitter;
+    }
+    else
+      return 0;
+  }
+  Ogre::ParticleEmitter* ParticleInterface::getEmitter(unsigned int emitterNr) const
+  {
+    if (emitterNr < this->particleSystem_->getNumEmitters())
+      return this->particleSystem_->getEmitter(emitterNr);
+    else
+      return 0;
+  }
+  void ParticleInterface::removeEmitter(unsigned int emitterNr)
+  {
+    if (emitterNr < this->particleSystem_->getNumEmitters())
+      this->particleSystem_->removeEmitter(emitterNr);
+  }
+  void ParticleInterface::removeAllEmitters()
+  {
+    this->particleSystem_->removeAllEmitters();
+  }
+  unsigned int ParticleInterface::getNumEmitters() const
+  {
+    return this->particleSystem_->getNumEmitters();
+  }
+
+  Ogre::ParticleAffector* ParticleInterface::addAffector(const std::string& name)
+  {
+    return this->particleSystem_->addAffector(name);
+  }
+  Ogre::ParticleAffector* ParticleInterface::getAffector(unsigned int affectorNr) const
+  {
+    if (affectorNr < this->particleSystem_->getNumAffectors())
+      return this->particleSystem_->getAffector(affectorNr);
+    else
+      return 0;
+  }
+  void ParticleInterface::removeAffector(unsigned int affectorNr)
+  {
+    if (affectorNr < this->particleSystem_->getNumAffectors())
+      this->particleSystem_->removeAffector(affectorNr);
+  }
+  void ParticleInterface::removeAllAffectors()
+  {
+    this->particleSystem_->removeAllAffectors();
+  }
+  unsigned int ParticleInterface::getNumAffectors() const
+  {
+    return this->particleSystem_->getNumAffectors();
+  }
+
+  void ParticleInterface::setEnabled(bool enable)
+  {
+    this->bEnabled_ = enable;
+    this->updateVisibility();
+  }
+
+  void ParticleInterface::detailLevelChanged(unsigned int newlevel)
+  {
+    if (newlevel >= (unsigned int)this->detaillevel_)
+      this->bVisible_ = true;
+    else
+      this->bVisible_ = false;
+
+    this->updateVisibility();
+  }
+
+  void ParticleInterface::updateVisibility()
+  {
+    for (unsigned int i = 0; i < this->particleSystem_->getNumEmitters(); i++)
+      this->particleSystem_->getEmitter(i)->setEnabled(this->bEnabled_ && this->bVisible_);
+  }
+
+  void ParticleInterface::setSpeedFactor(float factor)
+  {
+    this->particleSystem_->setSpeedFactor(Orxonox::getSingleton()->getTimeFactor() * factor);
+  }
+  float ParticleInterface::getSpeedFactor() const
+  {
+    return (this->particleSystem_->getSpeedFactor() / Orxonox::getSingleton()->getTimeFactor());
+  }
+
+  bool ParticleInterface::getKeepParticlesInLocalSpace() const
+  {
+    return this->particleSystem_->getKeepParticlesInLocalSpace();
+  }
+  void ParticleInterface::setKeepParticlesInLocalSpace(bool keep)
+  {
+    this->particleSystem_->setKeepParticlesInLocalSpace(keep);
+  }
+}
Index: code/branches/input/src/orxonox/tools/ParticleInterface.h
===================================================================
--- code/branches/input/src/orxonox/tools/ParticleInterface.h	(revision 1629)
+++ code/branches/input/src/orxonox/tools/ParticleInterface.h	(revision 1629)
@@ -0,0 +1,97 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ParticleInterface_H__
+#define _ParticleInterface_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <OgreParticleEmitter.h>
+
+#include "core/OrxonoxClass.h"
+#include "util/Math.h"
+
+#define getAllEmitters() \
+  storeThisAsCurrentParticleInterface(); \
+  for (unsigned int i = 0; i < ParticleInterface::getCurrentParticleInterface()->getNumEmitters(); ++i) \
+    ParticleInterface::getCurrentParticleInterface()->getEmitter(i)
+
+namespace orxonox
+{
+  class _OrxonoxExport ParticleInterface : public OrxonoxClass
+  {
+    public:
+      ParticleInterface(const std::string& templateName, LODParticle::LOD detaillevel);
+      ~ParticleInterface();
+
+      inline Ogre::ParticleSystem* getParticleSystem() const
+        { return this->particleSystem_; }
+
+      void addToSceneNode(Ogre::SceneNode* sceneNode);
+      void detachFromSceneNode();
+
+      Ogre::ParticleEmitter* createNewEmitter();
+      Ogre::ParticleEmitter* getEmitter(unsigned int emitterNr) const;
+      void removeEmitter(unsigned int emitterNr);
+      void removeAllEmitters();
+      unsigned int getNumEmitters() const;
+
+      Ogre::ParticleAffector* addAffector(const std::string& name);
+      Ogre::ParticleAffector* getAffector(unsigned int affectorNr) const;
+      void removeAffector(unsigned int affectorNr);
+      void removeAllAffectors();
+      unsigned int getNumAffectors() const;
+
+      float getSpeedFactor() const;
+      void setSpeedFactor(float factor);
+      bool getKeepParticlesInLocalSpace() const;
+      void setKeepParticlesInLocalSpace(bool keep);
+
+      void setEnabled(bool enable);
+      void detailLevelChanged(unsigned int newlevel);
+
+      inline void storeThisAsCurrentParticleInterface()
+        { ParticleInterface::currentParticleInterface_s = this; }
+      inline static ParticleInterface* getCurrentParticleInterface()
+        { return ParticleInterface::currentParticleInterface_s; }
+
+    private:
+      void updateVisibility();
+
+      static ParticleInterface* currentParticleInterface_s;
+      static unsigned int counter_s;
+      Ogre::SceneNode* sceneNode_;
+      Ogre::ParticleSystem* particleSystem_;
+      bool bVisible_;
+      bool bEnabled_;
+      unsigned int detaillevel_;                            //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
+  };
+}
+
+#endif /* _ParticleInterface_H__ */
Index: code/branches/input/src/orxonox/tools/TextureGenerator.cc
===================================================================
--- code/branches/input/src/orxonox/tools/TextureGenerator.cc	(revision 1629)
+++ code/branches/input/src/orxonox/tools/TextureGenerator.cc	(revision 1629)
@@ -0,0 +1,86 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the TextureGenerator.
+*/
+
+#include "OrxonoxStableHeaders.h"
+#include "TextureGenerator.h"
+#include <OgreMaterialManager.h>
+#include <OgreTechnique.h>
+#include "util/Convert.h"
+
+namespace std
+{
+    template <>
+    bool less<orxonox::ColourValue>::operator()(const orxonox::ColourValue& __x, const orxonox::ColourValue& __y) const
+    {
+        if (__x.r == __y.r)
+        {
+            if (__x.g == __y.g)
+            {
+                if (__x.b == __y.b)
+                {
+                    return __x.a < __y.a;
+                }
+                return __x.b < __y.b;
+            }
+            return __x.g < __y.g;
+        }
+        return __x.r < __y.r;
+    }
+}
+
+namespace orxonox
+{
+    std::map<std::string, std::map<ColourValue, std::string> > TextureGenerator::materials_s;
+    unsigned int TextureGenerator::materialCount_s = 0;
+
+    /*static*/ const std::string& TextureGenerator::getMaterialName(std::string textureName, const ColourValue& colour)
+    {
+        std::map<ColourValue, std::string>& colourMap = materials_s[textureName];
+        std::map<ColourValue, std::string>::const_iterator it = colourMap.find(colour);
+
+        if (it == colourMap.end())
+        {
+            std::string materialName = textureName + "_Material_" + convertToString(materialCount_s++);
+            Ogre::MaterialPtr material = (Ogre::MaterialPtr)Ogre::MaterialManager::getSingleton().create(materialName, "General");
+            material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
+            Ogre::TextureUnitState* textureUnitState = material->getTechnique(0)->getPass(0)->createTextureUnitState();
+            textureUnitState->setTextureName(textureName);
+            textureUnitState->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour);
+            return (colourMap[colour] = materialName);
+        }
+        else
+        {
+            return (*it).second;
+        }
+    }
+}
Index: code/branches/input/src/orxonox/tools/TextureGenerator.h
===================================================================
--- code/branches/input/src/orxonox/tools/TextureGenerator.h	(revision 1629)
+++ code/branches/input/src/orxonox/tools/TextureGenerator.h	(revision 1629)
@@ -0,0 +1,59 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+/**
+    @file
+    @brief
+*/
+
+#ifndef _TextureGenerator_H__
+#define _TextureGenerator_H__
+
+#include "OrxonoxPrereqs.h"
+#include <string>
+#include <map>
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TextureGenerator
+    {
+    public:
+        static const std::string& getMaterialName(std::string textureName, const ColourValue& colour);
+
+    private:
+        TextureGenerator();
+        TextureGenerator(const TextureGenerator&);
+        ~TextureGenerator();
+
+        static std::map<std::string, std::map<ColourValue, std::string> > materials_s;
+        static unsigned int materialCount_s;
+    };
+}
+
+#endif /* _TextureGenerator_H__ */
Index: code/branches/input/src/orxonox/tools/Timer.cc
===================================================================
--- code/branches/input/src/orxonox/tools/Timer.cc	(revision 1623)
+++ code/branches/input/src/orxonox/tools/Timer.cc	(revision 1629)
@@ -102,6 +102,5 @@
     TimerBase::~TimerBase()
     {
-      if (this->executor_)
-          delete this->executor_;
+        this->deleteExecutor();
     }
 
@@ -112,4 +111,13 @@
     {
         (*this->executor_)();
+    }
+
+    /**
+        @brief Deletes the executor.
+    */
+    void TimerBase::deleteExecutor()
+    {
+      if (this->executor_)
+          delete this->executor_;
     }
 
Index: code/branches/input/src/orxonox/tools/Timer.h
===================================================================
--- code/branches/input/src/orxonox/tools/Timer.h	(revision 1623)
+++ code/branches/input/src/orxonox/tools/Timer.h	(revision 1629)
@@ -78,4 +78,5 @@
 
             void run() const;
+            void deleteExecutor();
 
             /** @brief Starts the Timer: Function-call after 'interval' seconds. */
@@ -94,4 +95,7 @@
             inline bool isActive() const
                 { return this->bActive_; }
+            /** @brief Returns the remaining time until the Timer calls the function. @return The remaining time */
+            inline float getRemainingTime() const
+                { return this->time_; }
             /** @brief Gives the Timer some extra time. @param time The amount of extra time in seconds */
             inline void addTime(float time)
@@ -149,4 +153,6 @@
             void setTimer(float interval, bool bLoop, T* object, ExecutorMember<T>* executor)
             {
+                this->deleteExecutor();
+
                 this->interval_ = interval;
                 this->bLoop_ = bLoop;
@@ -185,4 +191,6 @@
             void setTimer(float interval, bool bLoop, ExecutorStatic* executor)
             {
+                this->deleteExecutor();
+
                 this->interval_ = interval;
                 this->bLoop_ = bLoop;
Index: code/branches/input/src/orxonox/tools/WindowEventListener.cc
===================================================================
--- code/branches/input/src/orxonox/tools/WindowEventListener.cc	(revision 1629)
+++ code/branches/input/src/orxonox/tools/WindowEventListener.cc	(revision 1629)
@@ -0,0 +1,42 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "WindowEventListener.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor for the WindowEventListener.
+    */
+    WindowEventListener::WindowEventListener()
+    {
+        RegisterObject(WindowEventListener);
+    }
+}
Index: code/branches/input/src/orxonox/tools/WindowEventListener.h
===================================================================
--- code/branches/input/src/orxonox/tools/WindowEventListener.h	(revision 1629)
+++ code/branches/input/src/orxonox/tools/WindowEventListener.h	(revision 1629)
@@ -0,0 +1,58 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _WindowEventListener_H__
+#define _WindowEventListener_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+
+namespace orxonox
+{
+    /**
+        @brief Interface for receiving window events.
+    */
+    class _OrxonoxExport WindowEventListener : virtual public OrxonoxClass
+    {
+    public:
+        WindowEventListener();
+        virtual ~WindowEventListener() { }
+
+		    /** Window has moved position */
+		    virtual void windowMoved() { }
+
+		    /** Window has resized */
+		    virtual void windowResized(int newWidth, int newHeight) { }
+
+		    /** Window has lost/gained focus */
+		    virtual void windowFocusChanged() { }
+    };
+}
+
+#endif /* _WindowEventListener_H__ */
Index: code/branches/input/src/tinyxml/ticpp.cc
===================================================================
--- code/branches/input/src/tinyxml/ticpp.cc	(revision 1623)
+++ code/branches/input/src/tinyxml/ticpp.cc	(revision 1629)
@@ -23,4 +23,11 @@
 */
 
+/*
+Modifications by the orxonox team:
+In function: void Document::Parse( const std::string& xml, bool throwIfParseError, TiXmlEncoding encoding )
+     change: Added row and column number to the error description.
+     author: Reto Grieder
+*/
+
 #ifdef TIXML_USE_TICPP
 
@@ -853,5 +860,6 @@
 	if( throwIfParseError && m_tiXmlPointer->Error() )
 	{
-		TICPPTHROW( "Error parsing xml: " << m_tiXmlPointer->ErrorDesc() );
+		TICPPTHROW( "Error parsing xml: " << m_tiXmlPointer->ErrorDesc()
+            << " In row " << m_tiXmlPointer->ErrorRow() << ", column " << m_tiXmlPointer->ErrorCol() << ".");
 	}
 }
Index: code/branches/input/src/tolua/CMakeLists.txt
===================================================================
--- code/branches/input/src/tolua/CMakeLists.txt	(revision 1623)
+++ code/branches/input/src/tolua/CMakeLists.txt	(revision 1629)
@@ -7,5 +7,5 @@
 )
 
-ADD_LIBRARY (tolualib ${TOLUALIB_SRC_FILES})
+ADD_LIBRARY (tolualib SHARED ${TOLUALIB_SRC_FILES})
 
 TARGET_LINK_LIBRARIES (tolualib
Index: code/branches/input/src/util/Convert.h
===================================================================
--- code/branches/input/src/util/Convert.h	(revision 1623)
+++ code/branches/input/src/util/Convert.h	(revision 1629)
@@ -43,4 +43,5 @@
 #include "SubString.h"
 #include "MultiTypeMath.h"
+#include "String.h"
 
 // disable annoying warning about forcing value to boolean
@@ -299,4 +300,11 @@
 };
 
+// convert to string Shortcut
+template <class FromType>
+std::string convertToString(FromType value)
+{
+  return getConvertedValue<FromType, std::string>(value);
+}
+
 // convert from string
 template <class ToType>
@@ -313,4 +321,11 @@
     }
 };
+
+// convert from string Shortcut
+template <class ToType>
+ToType convertFromString(std::string str)
+{
+  return getConvertedValue<std::string, ToType>(str);
+}
 
 
@@ -404,4 +419,19 @@
 ////////////////////
 
+// bool to std::string
+template <>
+struct ConverterSpecialized<bool, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const bool& input)
+    {
+        if (input)
+          *output = "true";
+        else
+          *output = "false";
+        return false;
+    }
+};
+
 // Vector2 to std::string
 template <>
@@ -494,4 +524,31 @@
 ////////////////////
 
+// std::string to bool
+template <>
+struct ConverterSpecialized<std::string, bool, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(bool* output, const std::string& input)
+    {
+        std::string stripped = getLowercase(removeTrailingWhitespaces(input));
+        if (stripped == "true" || stripped == "on" || stripped == "yes")
+        {
+          *output = true;
+          return true;
+        }
+        else if (stripped == "false" || stripped == "off" || stripped == "no")
+        {
+          *output = false;
+          return true;
+        }
+
+        std::istringstream iss(input);
+        if (iss >> (*output))
+            return true;
+        else
+            return false;
+    }
+};
+
 // std::string to Vector2
 template <>
@@ -611,5 +668,5 @@
 
         SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
-        if (tokens.size() >= 4)
+        if (tokens.size() >= 3)
         {
             if (!ConvertValue(&(output->r), tokens[0]))
@@ -619,6 +676,11 @@
             if (!ConvertValue(&(output->b), tokens[2]))
                 return false;
-            if (!ConvertValue(&(output->a), tokens[3]))
-                return false;
+            if (tokens.size() >= 4)
+            {
+                if (!ConvertValue(&(output->a), tokens[3]))
+                    return false;
+            }
+            else
+                output->a = 1.0;
 
             return true;
Index: code/branches/input/src/util/Math.cc
===================================================================
--- code/branches/input/src/util/Math.cc	(revision 1623)
+++ code/branches/input/src/util/Math.cc	(revision 1629)
@@ -27,5 +27,8 @@
  */
 
+#include <OgrePlane.h>
+
 #include "Math.h"
+#include "Convert.h"
 
 /**
@@ -68,2 +71,79 @@
     return in;
 }
+
+
+float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition)
+{
+    orxonox::Vector3 distance = otherposition - myposition;
+    float distancelength = distance.length();
+    if (distancelength == 0)
+        return 0;
+    else
+        return acos(clamp<float>(mydirection.dotProduct(distance) / distancelength, -1, 1));
+}
+
+orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
+{
+    orxonox::Vector3 distance = otherposition - myposition;
+
+    // project difference vector on our plane
+    orxonox::Vector3 projection = Ogre::Plane(mydirection, myposition).projectVector(distance);
+
+    float projectionlength = projection.length();
+    if (projectionlength == 0) return orxonox::Vector2(0, 0);
+    float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1));
+
+    if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0)
+        return orxonox::Vector2(sin(angle), cos(angle));
+    else
+        return orxonox::Vector2(-sin(angle), cos(angle));
+}
+
+orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
+{
+    orxonox::Vector3 distance = otherposition - myposition;
+
+    // project difference vector on our plane
+    orxonox::Vector3 projection = Ogre::Plane(mydirection, myposition).projectVector(distance);
+
+    float projectionlength = projection.length();
+    if (projectionlength == 0) return orxonox::Vector2(0, 0);
+    float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1));
+
+    float distancelength = distance.length();
+    if (distancelength == 0) return orxonox::Vector2(0, 0);
+    float radius = acos(clamp<float>(mydirection.dotProduct(distance) / distancelength, -1, 1)) / Ogre::Math::PI;
+
+    if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0)
+        return orxonox::Vector2(sin(angle) * radius, cos(angle) * radius);
+    else
+        return orxonox::Vector2(-sin(angle) * radius, cos(angle) * radius);
+}
+
+orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity)
+{
+    float squaredProjectilespeed = projectilespeed * projectilespeed;
+    orxonox::Vector3 distance = targetposition - myposition;
+    float a = distance.squaredLength();
+    float b = 2 * (distance.x + distance.y + distance.z) * (targetvelocity.x + targetvelocity.y + targetvelocity.z);
+    float c = targetvelocity.squaredLength();
+
+    float temp = 4*squaredProjectilespeed*c + a*a - 4*b*c;
+    if (temp < 0)
+        return orxonox::Vector3::ZERO;
+
+    temp = sqrt(temp);
+    float time = (temp + a) / (2 * (squaredProjectilespeed - b));
+    return (targetposition + targetvelocity * time);
+}
+
+unsigned long getUniqueNumber()
+{
+    static unsigned long aNumber = 135;
+    return aNumber++;
+}
+
+std::string getUniqueNumberStr()
+{
+    return convertToString(getUniqueNumber());
+}
Index: code/branches/input/src/util/Math.h
===================================================================
--- code/branches/input/src/util/Math.h	(revision 1623)
+++ code/branches/input/src/util/Math.h	(revision 1629)
@@ -33,4 +33,5 @@
 
 #include <ostream>
+#include <string>
 
 #include <OgreMath.h>
@@ -39,4 +40,5 @@
 #include <OgreVector4.h>
 #include <OgreMatrix3.h>
+#include <OgreMatrix4.h>
 #include <OgreQuaternion.h>
 #include <OgreColourValue.h>
@@ -50,4 +52,5 @@
   typedef Ogre::Vector4 Vector4;
   typedef Ogre::Matrix3 Matrix3;
+  typedef Ogre::Matrix4 Matrix4;
   typedef Ogre::Quaternion Quaternion;
   typedef Ogre::ColourValue ColourValue;
@@ -58,4 +61,9 @@
 _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree);
 _UtilExport std::istream& operator>>(std::istream& in, orxonox::Degree& degree);
+
+_UtilExport float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition);
+_UtilExport orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
+_UtilExport orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
+_UtilExport orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity);
 
 template <typename T>
@@ -156,4 +164,7 @@
 }
 
+_UtilExport unsigned long getUniqueNumber();
+_UtilExport std::string getUniqueNumberStr();
+
 class _UtilExport IntVector2
 {
Index: code/branches/input/src/util/String.cc
===================================================================
--- code/branches/input/src/util/String.cc	(revision 1623)
+++ code/branches/input/src/util/String.cc	(revision 1629)
@@ -31,4 +31,10 @@
 #include <cctype>
 #include <iostream>
+
+/**
+    @brief Blank string as variable so you can use const std::string& even
+           if you have to return "".
+*/
+std::string blankString = "";
 
 /**
Index: code/branches/input/src/util/String.h
===================================================================
--- code/branches/input/src/util/String.h	(revision 1623)
+++ code/branches/input/src/util/String.h	(revision 1629)
@@ -35,4 +35,6 @@
 #include <sstream>
 
+extern _UtilExport std::string blankString;
+
 _UtilExport void         strip(std::string* str);
 _UtilExport std::string  getStripped(const std::string& str);
@@ -70,97 +72,3 @@
 _UtilExport unsigned int getNextCommentPosition(const std::string& str, unsigned int start = 0);
 
-//! The Convert class has some static member functions to convert strings to values and values to strings.
-class _UtilExport Convert
-{
-    public:
-        /**
-            @brief Converts a value of any type to a string.
-            @param output The string to write the result in
-            @param input The variable to convert
-            @return True if the conversion succeded
-
-            @example
-            float f = 3.14;
-            std::string output;
-            bool success = Convert::ToString(&output, f);
-        */
-        template <typename T>
-        static bool ToString(std::string* output, T input)
-        {
-            std::ostringstream oss;
-            if (oss << input)
-            {
-                (*output) = oss.str();
-                return true;
-            }
-
-            return false;
-        }
-
-        /**
-            @brief Converts a value of any type to a string and assigns a defaultvalue if the conversion fails.
-            @param output The string to write the result in
-            @param input The variable to convert
-            @param fallbackString The assigned string if the conversion fails.
-            @return True if the conversion succeeded
-
-            @example
-            float f = 3.14;
-            std::string output;
-            bool success = Convert::ToString(&output, f, "0.000000");
-        */
-        template <typename T>
-        static bool ToString(std::string* output, T input, const std::string& fallbackString)
-        {
-            if (Convert::ToString(output, input))
-                return true;
-
-            (*output) = fallbackString;
-            return false;
-        }
-
-        /**
-            @brief Converts a string to a value of any type.
-            @param output The variable to assign the result to
-            @param input The string to convert
-            @return True if the conversion succeeded
-
-            @example
-            std::string input = "3.14";
-            float f;
-            bool success = string2Number(&f, input);
-        */
-        template <typename T>
-        static bool FromString(T* output, const std::string& input)
-        {
-            std::istringstream iss(input);
-            if (iss >> (*output))
-                return true;
-
-            return false;
-        }
-
-        /**
-            @brief Converts a string to a value of any type.
-            @param output The variable to assign the result to
-            @param input The string to convert
-            @param fallbackValue The assigned value if the conversion fails
-            @return True if the conversion succeeded
-
-            @example
-            std::string input = "3.14";
-            float f;
-            bool success = string2Number(&f, input, 0.000000);
-        */
-        template <typename T>
-        static bool FromString(T* output, const std::string& input, T fallbackValue)
-        {
-            if (Convert::FromString(output, input))
-                return true;
-
-            (*output) = fallbackValue;
-            return false;
-        }
-};
-
 #endif /* _Util_String_H__ */
Index: code/branches/input/src/util/UtilPrereqs.h
===================================================================
--- code/branches/input/src/util/UtilPrereqs.h	(revision 1623)
+++ code/branches/input/src/util/UtilPrereqs.h	(revision 1629)
@@ -61,5 +61,4 @@
 //-----------------------------------------------------------------------
 class ArgReader;
-class Convert;
 class MultiTypePrimitive;
 class MultiTypeString;
Index: code/branches/input/visual_studio/audio_properties.vsprops
===================================================================
--- code/branches/input/visual_studio/audio_properties.vsprops	(revision 1623)
+++ code/branches/input/visual_studio/audio_properties.vsprops	(revision 1629)
@@ -13,5 +13,5 @@
 	<Tool
 		Name="VCLinkerTool"
-		AdditionalDependencies="libvorbisfile$(CSS).lib alut$(CS).lib OpenAL32$(CS).lib"
+		AdditionalDependencies="libvorbisfile-1.2.0$(CSS).lib alut$(CS).lib OpenAL32$(CS).lib"
 	/>
 </VisualStudioPropertySheet>
Index: code/branches/input/visual_studio/base_properties.vsprops
===================================================================
--- code/branches/input/visual_studio/base_properties.vsprops	(revision 1623)
+++ code/branches/input/visual_studio/base_properties.vsprops	(revision 1629)
@@ -8,5 +8,5 @@
 	<Tool
 		Name="VCCLCompilerTool"
-		AdditionalIncludeDirectories="&quot;$(RootDir)src&quot;;&quot;$(RootDir)src\orxonox&quot;;&quot;$(RootDir)src\tolua&quot;;&quot;$(RootDir)src\ois&quot;;&quot;$(DependencyDir)include&quot;"
+		AdditionalIncludeDirectories="&quot;$(RootDir)&quot;;&quot;$(RootDir)src&quot;;&quot;$(RootDir)src\orxonox&quot;;&quot;$(RootDir)src\tolua&quot;;&quot;$(RootDir)src\ois&quot;;&quot;$(LibDir)ogre-1.4.8\OgreMain\include&quot;;&quot;$(LibDir)boost-1.35.0&quot;;&quot;$(LibDir)enet-1.2\include&quot;;&quot;$(LibDir)libogg-1.1.3\include&quot;;&quot;$(LibDir)libvorbis-1.2.0\include&quot;;&quot;$(LibDir)lua-5.1.3\src&quot;;&quot;$(LibDir)openal-1.1\include&quot;;&quot;$(LibDir)openal-1.1\alut\include&quot;;&quot;$(LibDir)tcl-8.5.\generic&quot;;&quot;$(LibDir)zlib-1.2.3&quot;"
 		PreprocessorDefinitions="WIN32;__WIN32__;_WIN32;BOOST_ALL_DYN_LINK;OIS_DYNAMIC_LIB; ZLIB_WINAPI"
 		WarningLevel="3"
@@ -33,5 +33,5 @@
 	<UserMacro
 		Name="DependencyDir"
-		Value="$(RootDir)..\dependencies\"
+		Value="$(RootDir)..\lib_precompiled\"
 	/>
 	<UserMacro
@@ -43,3 +43,11 @@
 		Value=""
 	/>
+	<UserMacro
+		Name="LibDir"
+		Value="$(RootDir)..\lib_src\"
+	/>
+	<UserMacro
+		Name="libOgre"
+		Value="OgreMain$(CS).lib"
+	/>
 </VisualStudioPropertySheet>
Index: code/branches/input/visual_studio/base_properties_release.vsprops
===================================================================
--- code/branches/input/visual_studio/base_properties_release.vsprops	(revision 1623)
+++ code/branches/input/visual_studio/base_properties_release.vsprops	(revision 1629)
@@ -9,5 +9,4 @@
 		Name="VCCLCompilerTool"
 		Optimization="2"
-		WholeProgramOptimization="false"
 		PreprocessorDefinitions="NDEBUG"
 		RuntimeLibrary="2"
Index: code/branches/input/visual_studio/core_properties.vsprops
===================================================================
--- code/branches/input/visual_studio/core_properties.vsprops	(revision 1623)
+++ code/branches/input/visual_studio/core_properties.vsprops	(revision 1629)
@@ -12,5 +12,5 @@
 	<Tool
 		Name="VCLinkerTool"
-		AdditionalDependencies="OgreMain$(CSS).lib lua-5.1$(CS).lib tcl85t.lib"
+		AdditionalDependencies="OgreMain$(CSS).lib lua-5.1.3$(CS).lib tcl85t.lib"
 	/>
 </VisualStudioPropertySheet>
Index: code/branches/input/visual_studio/orxonox_properties.vsprops
===================================================================
--- code/branches/input/visual_studio/orxonox_properties.vsprops	(revision 1623)
+++ code/branches/input/visual_studio/orxonox_properties.vsprops	(revision 1629)
@@ -14,5 +14,5 @@
 	<Tool
 		Name="VCLinkerTool"
-		AdditionalDependencies="OgreMain$(CSS).lib tcl85t.lib enet$(CS).lib zlib$(CS).lib"
+		AdditionalDependencies="OgreMain$(CSS).lib tcl85t.lib enet-1.2$(CS).lib zlib-1.2.3$(CS).lib"
 		OutputFile="$(OutDir)$(ProjectName)$(CS).exe"
 		IgnoreDefaultLibraryNames="LIBCMT;LIBCMTD"
Index: code/branches/input/visual_studio/vc8/audio.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/audio.vcproj	(revision 1623)
+++ code/branches/input/visual_studio/vc8/audio.vcproj	(revision 1629)
@@ -82,5 +82,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\audio_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
Index: code/branches/input/visual_studio/vc8/core.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/core.vcproj	(revision 1623)
+++ code/branches/input/visual_studio/vc8/core.vcproj	(revision 1629)
@@ -82,5 +82,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\core_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
Index: code/branches/input/visual_studio/vc8/cpptcl.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/cpptcl.vcproj	(revision 1623)
+++ code/branches/input/visual_studio/vc8/cpptcl.vcproj	(revision 1629)
@@ -73,5 +73,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\cpptcl_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
Index: code/branches/input/visual_studio/vc8/network.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/network.vcproj	(revision 1623)
+++ code/branches/input/visual_studio/vc8/network.vcproj	(revision 1629)
@@ -73,5 +73,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\network_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
Index: code/branches/input/visual_studio/vc8/ois.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/ois.vcproj	(revision 1623)
+++ code/branches/input/visual_studio/vc8/ois.vcproj	(revision 1629)
@@ -24,4 +24,5 @@
 			InheritedPropertySheets="..\directory_properties.vsprops"
 			CharacterSet="2"
+			WholeProgramOptimization="0"
 			>
 			<Tool
@@ -76,5 +77,4 @@
 				EnableCOMDATFolding="2"
 				OptimizeForWindows98="1"
-				LinkTimeCodeGeneration="1"
 				ImportLibrary="$(RootDir)lib\$(TargetName).lib"
 			/>
Index: code/branches/input/visual_studio/vc8/orxonox.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/orxonox.vcproj	(revision 1623)
+++ code/branches/input/visual_studio/vc8/orxonox.vcproj	(revision 1629)
@@ -84,5 +84,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\orxonox_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
@@ -185,31 +185,37 @@
 			</File>
 			<File
+				RelativePath="..\..\src\orxonox\Radar.cc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\orxonox\RadarListener.cc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\orxonox\RadarViewable.cc"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)\$(InputName)1.obj"
+						XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)\$(InputName)1.obj"
+						XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
 				RelativePath="..\..\src\orxonox\Settings.cc"
 				>
 			</File>
-			<Filter
-				Name="hud"
-				>
-				<File
-					RelativePath="..\..\src\orxonox\hud\BarOverlayElement.cc"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\orxonox\hud\HUD.cc"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\orxonox\hud\Navigation.cc"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\orxonox\hud\RadarObject.cc"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\orxonox\hud\RadarOverlayElement.cc"
-					>
-				</File>
-			</Filter>
 			<Filter
 				Name="objects"
@@ -220,4 +226,12 @@
 				</File>
 				<File
+					RelativePath="..\..\src\orxonox\objects\Backlight.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\objects\BillboardProjectile.cc"
+					>
+				</File>
+				<File
 					RelativePath="..\..\src\orxonox\objects\Camera.cc"
 					>
@@ -228,8 +242,4 @@
 				</File>
 				<File
-					RelativePath="..\..\src\orxonox\objects\Explosion.cc"
-					>
-				</File>
-				<File
 					RelativePath="..\..\src\orxonox\objects\Model.cc"
 					>
@@ -237,4 +247,12 @@
 				<File
 					RelativePath="..\..\src\orxonox\objects\NPC.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\objects\ParticleProjectile.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\objects\ParticleSpawner.cc"
 					>
 				</File>
@@ -393,12 +411,4 @@
 			</Filter>
 			<Filter
-				Name="particle"
-				>
-				<File
-					RelativePath="..\..\src\orxonox\particle\ParticleInterface.cc"
-					>
-				</File>
-			</Filter>
-			<Filter
 				Name="tools"
 				>
@@ -416,13 +426,17 @@
 				</File>
 				<File
+					RelativePath="..\..\src\orxonox\tools\ParticleInterface.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\tools\TextureGenerator.cc"
+					>
+				</File>
+				<File
 					RelativePath="..\..\src\orxonox\tools\Timer.cc"
 					>
 				</File>
-			</Filter>
-			<Filter
-				Name="console"
-				>
-				<File
-					RelativePath="..\..\src\orxonox\console\InGameConsole.cc"
+				<File
+					RelativePath="..\..\src\orxonox\tools\WindowEventListener.cc"
 					>
 				</File>
@@ -452,4 +466,60 @@
 				</File>
 			</Filter>
+			<Filter
+				Name="overlays"
+				>
+				<File
+					RelativePath="..\..\src\orxonox\overlays\OrxonoxOverlay.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\overlays\OverlayGroup.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\overlays\OverlayText.cc"
+					>
+				</File>
+				<Filter
+					Name="console"
+					>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\console\InGameConsole.cc"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="hud"
+					>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\hud\HUDBar.cc"
+						>
+					</File>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\hud\HUDNavigation.cc"
+						>
+					</File>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\hud\HUDRadar.cc"
+						>
+					</File>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\hud\HUDSpeedBar.cc"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="debug"
+					>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\debug\DebugFPSText.cc"
+						>
+					</File>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\debug\DebugRTRText.cc"
+						>
+					</File>
+				</Filter>
+			</Filter>
 		</Filter>
 		<Filter
@@ -475,35 +545,19 @@
 			</File>
 			<File
+				RelativePath="..\..\src\orxonox\Radar.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\orxonox\RadarListener.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\orxonox\RadarViewable.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\orxonox\Settings.h"
 				>
 			</File>
-			<Filter
-				Name="hud"
-				>
-				<File
-					RelativePath="..\..\src\orxonox\hud\BarOverlayElement.h"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\orxonox\hud\HUD.h"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\orxonox\hud\Navigation.h"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\orxonox\hud\OverlayElementFactories.h"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\orxonox\hud\RadarObject.h"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\orxonox\hud\RadarOverlayElement.h"
-					>
-				</File>
-			</Filter>
 			<Filter
 				Name="objects"
@@ -514,4 +568,12 @@
 				</File>
 				<File
+					RelativePath="..\..\src\orxonox\objects\Backlight.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\objects\BillboardProjectile.h"
+					>
+				</File>
+				<File
 					RelativePath="..\..\src\orxonox\objects\Camera.h"
 					>
@@ -522,8 +584,4 @@
 				</File>
 				<File
-					RelativePath="..\..\src\orxonox\objects\Explosion.h"
-					>
-				</File>
-				<File
 					RelativePath="..\..\src\orxonox\objects\Model.h"
 					>
@@ -531,4 +589,12 @@
 				<File
 					RelativePath="..\..\src\orxonox\objects\NPC.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\objects\ParticleProjectile.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\objects\ParticleSpawner.h"
 					>
 				</File>
@@ -591,12 +657,4 @@
 			</Filter>
 			<Filter
-				Name="particle"
-				>
-				<File
-					RelativePath="..\..\src\orxonox\particle\ParticleInterface.h"
-					>
-				</File>
-			</Filter>
-			<Filter
 				Name="tools"
 				>
@@ -614,13 +672,17 @@
 				</File>
 				<File
+					RelativePath="..\..\src\orxonox\tools\ParticleInterface.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\tools\TextureGenerator.h"
+					>
+				</File>
+				<File
 					RelativePath="..\..\src\orxonox\tools\Timer.h"
 					>
 				</File>
-			</Filter>
-			<Filter
-				Name="console"
-				>
-				<File
-					RelativePath="..\..\src\orxonox\console\InGameConsole.h"
+				<File
+					RelativePath="..\..\src\orxonox\tools\WindowEventListener.h"
 					>
 				</File>
@@ -633,4 +695,60 @@
 					>
 				</File>
+			</Filter>
+			<Filter
+				Name="overlays"
+				>
+				<File
+					RelativePath="..\..\src\orxonox\overlays\OrxonoxOverlay.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\overlays\OverlayGroup.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\overlays\OverlayText.h"
+					>
+				</File>
+				<Filter
+					Name="hud"
+					>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\hud\HUDBar.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\hud\HUDNavigation.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\hud\HUDRadar.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\hud\HUDSpeedBar.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="console"
+					>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\console\InGameConsole.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="debug"
+					>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\debug\DebugFPSText.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\src\orxonox\overlays\debug\DebugRTRText.h"
+						>
+					</File>
+				</Filter>
 			</Filter>
 		</Filter>
Index: code/branches/input/visual_studio/vc8/tixml.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/tixml.vcproj	(revision 1623)
+++ code/branches/input/visual_studio/vc8/tixml.vcproj	(revision 1629)
@@ -73,5 +73,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\tixml_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
Index: code/branches/input/visual_studio/vc8/tolua.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/tolua.vcproj	(revision 1623)
+++ code/branches/input/visual_studio/vc8/tolua.vcproj	(revision 1629)
@@ -73,5 +73,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\tolua_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
Index: code/branches/input/visual_studio/vc8/util.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/util.vcproj	(revision 1623)
+++ code/branches/input/visual_studio/vc8/util.vcproj	(revision 1629)
@@ -82,5 +82,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\util_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
