Index: /code/trunk/bin/levels/sample.oxw
===================================================================
--- /code/trunk/bin/levels/sample.oxw	(revision 1624)
+++ /code/trunk/bin/levels/sample.oxw	(revision 1625)
@@ -9,5 +9,5 @@
   </audio--> 
 
-<Ambient colourvalue="0.5, 0.5, 0.5" />
+<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" />
Index: /code/trunk/src/asylum/orxonox/objects/weapon/AmmunitionDump.cc
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/AmmunitionDump.cc	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/AmmunitionDump.cc	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/AmmunitionDump.h
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/AmmunitionDump.h	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/AmmunitionDump.h	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/BarrelGun.cc
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/BarrelGun.cc	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/BarrelGun.cc	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/BarrelGun.h
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/BarrelGun.h	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/BarrelGun.h	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/BaseWeapon.cc
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/BaseWeapon.cc	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/BaseWeapon.cc	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/BaseWeapon.h
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/BaseWeapon.h	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/BaseWeapon.h	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/Bullet.cc
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/Bullet.cc	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/Bullet.cc	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/Bullet.h
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/Bullet.h	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/Bullet.h	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/BulletManager.cc
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/BulletManager.cc	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/BulletManager.cc	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/BulletManager.h
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/BulletManager.h	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/BulletManager.h	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/WeaponStation.cc
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/WeaponStation.cc	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/WeaponStation.cc	(revision 1625)
@@ -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/trunk/src/asylum/orxonox/objects/weapon/WeaponStation.h
===================================================================
--- /code/trunk/src/asylum/orxonox/objects/weapon/WeaponStation.h	(revision 1625)
+++ /code/trunk/src/asylum/orxonox/objects/weapon/WeaponStation.h	(revision 1625)
@@ -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/trunk/src/core/BaseObject.cc
===================================================================
--- /code/trunk/src/core/BaseObject.cc	(revision 1624)
+++ /code/trunk/src/core/BaseObject.cc	(revision 1625)
@@ -66,15 +66,4 @@
 
     /**
-        @brief load general xml paramters
-    */
-    void BaseObject::loadParams(TiXmlElement* xmlElem)
-    {
-        if (xmlElem->Attribute("name"))
-        {
-            this->setName(xmlElem->Attribute("name"));
-        }
-    }
-
-    /**
         @brief XML loading and saving.
         @param xmlelement The XML-element
@@ -85,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/trunk/src/core/BaseObject.h
===================================================================
--- /code/trunk/src/core/BaseObject.h	(revision 1624)
+++ /code/trunk/src/core/BaseObject.h	(revision 1625)
@@ -52,5 +52,4 @@
             BaseObject();
             virtual ~BaseObject();
-            virtual void loadParams(TiXmlElement* xmlElem);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
Index: /code/trunk/src/core/Executor.cc
===================================================================
--- /code/trunk/src/core/Executor.cc	(revision 1624)
+++ /code/trunk/src/core/Executor.cc	(revision 1625)
@@ -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/trunk/src/core/Iterator.h
===================================================================
--- /code/trunk/src/core/Iterator.h	(revision 1624)
+++ /code/trunk/src/core/Iterator.h	(revision 1625)
@@ -92,4 +92,5 @@
             {
                 this->element_ = element;
+                return *this;
             }
 
Index: /code/trunk/src/core/Loader.cc
===================================================================
--- /code/trunk/src/core/Loader.cc	(revision 1624)
+++ /code/trunk/src/core/Loader.cc	(revision 1625)
@@ -116,4 +116,5 @@
         Script::run();*/
         Script* lua = Script::getInstance();
+        lua->clearLuaOutput();
         lua->loadFile(level->getFile(), true);
         lua->run();
Index: /code/trunk/src/core/Script.h
===================================================================
--- /code/trunk/src/core/Script.h	(revision 1624)
+++ /code/trunk/src/core/Script.h	(revision 1625)
@@ -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/trunk/src/core/TclThreadManager.h
===================================================================
--- /code/trunk/src/core/TclThreadManager.h	(revision 1624)
+++ /code/trunk/src/core/TclThreadManager.h	(revision 1625)
@@ -45,6 +45,4 @@
 namespace orxonox
 {
-    class boost::thread;
-
     struct _CoreExport TclInterpreterBundle
     {
Index: /code/trunk/src/network/GameStateClient.cc
===================================================================
--- /code/trunk/src/network/GameStateClient.cc	(revision 1624)
+++ /code/trunk/src/network/GameStateClient.cc	(revision 1625)
@@ -34,4 +34,5 @@
 #include "core/BaseObject.h"
 #include "Synchronisable.h"
+#include "objects/SpaceShip.h"
 
 
Index: /code/trunk/src/network/GameStateClient.h
===================================================================
--- /code/trunk/src/network/GameStateClient.h	(revision 1624)
+++ /code/trunk/src/network/GameStateClient.h	(revision 1625)
@@ -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/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/CMakeLists.txt	(revision 1624)
+++ /code/trunk/src/orxonox/CMakeLists.txt	(revision 1625)
@@ -3,12 +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
+  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,5 +28,7 @@
   tools/Mesh.cc
   tools/ParticleInterface.cc
+  tools/TextureGenerator.cc
   tools/Timer.cc
+  tools/WindowEventListener.cc
 
   objects/Ambient.cc
@@ -36,11 +49,4 @@
   objects/RotatingProjectile.cc
   objects/ParticleProjectile.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
 )
 
Index: /code/trunk/src/orxonox/GraphicsEngine.cc
===================================================================
--- /code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1624)
+++ /code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1625)
@@ -50,13 +50,14 @@
 #include "core/CommandExecutor.h"
 #include "core/ConsoleCommand.h"
-#include "core/input/InputManager.h"
-
-#include "console/InGameConsole.h"
-#include "hud/HUD.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.
@@ -435,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();
   }
 
@@ -451,28 +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();
-    HUD::getSingleton().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/trunk/src/orxonox/GraphicsEngine.h
===================================================================
--- /code/trunk/src/orxonox/GraphicsEngine.h	(revision 1624)
+++ /code/trunk/src/orxonox/GraphicsEngine.h	(revision 1625)
@@ -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);
@@ -108,4 +113,6 @@
             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/trunk/src/orxonox/Orxonox.cc
===================================================================
--- /code/trunk/src/orxonox/Orxonox.cc	(revision 1624)
+++ /code/trunk/src/orxonox/Orxonox.cc	(revision 1625)
@@ -69,6 +69,6 @@
 
 // objects and tools
-#include "hud/HUD.h"
-#include "console/InGameConsole.h"
+#include "overlays/OverlayGroup.h"
+#include "overlays/console/InGameConsole.h"
 #include "objects/Tickable.h"
 #include "objects/Backlight.h"
@@ -77,4 +77,5 @@
 #include "GraphicsEngine.h"
 #include "Settings.h"
+#include "Radar.h"
 
 // globals for the server or client
@@ -96,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)
   {
   }
@@ -117,7 +118,16 @@
   {
     // keep in mind: the order of deletion is very important!
-    this->orxonoxHUD_->destroy();
+    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_;
@@ -125,4 +135,5 @@
     if (this->timer_)
       delete this->timer_;
+    InputManager::destroy();
     GraphicsEngine::getSingleton().destroy();
 
@@ -335,7 +346,10 @@
 
     // Load the HUD
-    COUT(3) << "Orxonox: Loading HUD..." << std::endl;
-    orxonoxHUD_ = &HUD::getSingleton();
-    orxonoxHUD_->initialise();
+    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;
@@ -398,6 +412,6 @@
   bool Orxonox::loadScene()
   {
-    Level* startlevel = new Level("levels/sample.oxw");
-    Loader::open(startlevel);
+    startLevel_ = new Level("levels/sample.oxw");
+    Loader::open(startLevel_);
 
     return true;
@@ -424,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)
@@ -494,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
@@ -499,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(500);
+      ogreRoot._fireFrameEnded(evt); // note: uses the same time as _fireFrameStarted
+
+      ++frameCount;
     }
 
@@ -518,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/trunk/src/orxonox/Orxonox.h
===================================================================
--- /code/trunk/src/orxonox/Orxonox.h	(revision 1624)
+++ /code/trunk/src/orxonox/Orxonox.h	(revision 1625)
@@ -62,5 +62,4 @@
 
       void abortRequest();
-      //inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
 
       static Orxonox* getSingleton();
@@ -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/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- /code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 1624)
+++ /code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 1625)
@@ -62,67 +62,69 @@
 namespace orxonox
 {
-  namespace LODParticle
-  {
-    enum LOD
+    namespace LODParticle
     {
-      off = 0,
-      low = 1,
-      normal = 2,
-      high = 3
-    };
-  }
+        enum LOD
+        {
+            off = 0,
+            low = 1,
+            normal = 2,
+            high = 3
+        };
+    }
 
-  class GraphicsEngine;
-  class Orxonox;
+    class GraphicsEngine;
+    class Orxonox;
 
-  // objects
-  class Ambient;
-  class Backlight;
-  class Camera;
-  class Fighter;
-  class Model;
-  class NPC;
-  class ParticleSpawner;
-  class Skybox;
-  class SpaceShip;
-  class SpaceShipAI;
-  class WorldEntity;
+    class RadarViewable;
+    class Radar;
+    class RadarListener;
 
-  class Projectile;
-  class BillboardProjectile;
-  class RotatingProjectile;
-  class ParticleProjectile;
+    // objects
+    class Ambient;
+    class Backlight;
+    class Camera;
+    class Fighter;
+    class Model;
+    class NPC;
+    class ParticleSpawner;
+    class Skybox;
+    class SpaceShip;
+    class SpaceShipAI;
+    class WorldEntity;
 
-  class AmmunitionDump;
-  class Bullet;
-  class BulletManager;
-  class BaseWeapon;
-  class BarrelGun;
-  class WeaponStation;
+    class Projectile;
+    class BillboardProjectile;
+    class RotatingProjectile;
+    class ParticleProjectile;
 
-  // tools
-  class BillboardSet;
-  class Light;
-  class Mesh;
-  template <class T>
-  class Timer;
-  class TimerBase;
+    // tools
+    class BillboardSet;
+    class Light;
+    class Mesh;
+    class ParticleInterface;
+    template <class T>
+    class Timer;
 
-  // particle
-  class ParticleInterface;
-
-  // hud
-  class BarOverlayElement;
-  class BarOverlayElementFactory;
-  class HUD;
-  class Navigation;
-  class RadarObject;
-  class RadarOverlayElement;
-  class RadarOverlayElementFactory;
-
-  //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/trunk/src/orxonox/Radar.cc
===================================================================
--- /code/trunk/src/orxonox/Radar.cc	(revision 1625)
+++ /code/trunk/src/orxonox/Radar.cc	(revision 1625)
@@ -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/trunk/src/orxonox/Radar.h
===================================================================
--- /code/trunk/src/orxonox/Radar.h	(revision 1625)
+++ /code/trunk/src/orxonox/Radar.h	(revision 1625)
@@ -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/trunk/src/orxonox/RadarListener.cc
===================================================================
--- /code/trunk/src/orxonox/RadarListener.cc	(revision 1625)
+++ /code/trunk/src/orxonox/RadarListener.cc	(revision 1625)
@@ -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/trunk/src/orxonox/RadarListener.h
===================================================================
--- /code/trunk/src/orxonox/RadarListener.h	(revision 1625)
+++ /code/trunk/src/orxonox/RadarListener.h	(revision 1625)
@@ -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/trunk/src/orxonox/RadarViewable.cc
===================================================================
--- /code/trunk/src/orxonox/RadarViewable.cc	(revision 1625)
+++ /code/trunk/src/orxonox/RadarViewable.cc	(revision 1625)
@@ -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/trunk/src/orxonox/RadarViewable.h
===================================================================
--- /code/trunk/src/orxonox/RadarViewable.h	(revision 1625)
+++ /code/trunk/src/orxonox/RadarViewable.h	(revision 1625)
@@ -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/trunk/src/orxonox/objects/Ambient.cc
===================================================================
--- /code/trunk/src/orxonox/objects/Ambient.cc	(revision 1624)
+++ /code/trunk/src/orxonox/objects/Ambient.cc	(revision 1625)
@@ -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/trunk/src/orxonox/objects/Ambient.h
===================================================================
--- /code/trunk/src/orxonox/objects/Ambient.h	(revision 1624)
+++ /code/trunk/src/orxonox/objects/Ambient.h	(revision 1625)
@@ -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/trunk/src/orxonox/objects/NPC.cc
===================================================================
--- /code/trunk/src/orxonox/objects/NPC.cc	(revision 1624)
+++ /code/trunk/src/orxonox/objects/NPC.cc	(revision 1625)
@@ -45,9 +45,4 @@
   NPC::~NPC()
   {
-  }
-
-  void NPC::loadParams(TiXmlElement* xmlElem)
-  {
-    Model::loadParams(xmlElem);
   }
 
Index: /code/trunk/src/orxonox/objects/NPC.h
===================================================================
--- /code/trunk/src/orxonox/objects/NPC.h	(revision 1624)
+++ /code/trunk/src/orxonox/objects/NPC.h	(revision 1625)
@@ -48,5 +48,4 @@
       NPC();
       virtual ~NPC();
-      virtual void loadParams(TiXmlElement* xmlElem);
       void tick(float dt);
       void update();
Index: /code/trunk/src/orxonox/objects/SpaceShip.cc
===================================================================
--- /code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1624)
+++ /code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1625)
@@ -43,9 +43,7 @@
 #include "core/XMLPort.h"
 #include "core/ConsoleCommand.h"
-#include "core/input/InputManager.h"
 
 #include "network/Client.h"
 
-#include "hud/HUD.h"
 #include "tools/ParticleInterface.h"
 
@@ -118,11 +116,8 @@
         this->timeToReload_ = 0;
 
-        this->setMouseEventCallback_ = false;
         this->bLMousePressed_ = false;
         this->bRMousePressed_ = false;
         this->mouseXRotation_ = 0;
         this->mouseYRotation_ = 0;
-        this->mouseX_ = 0;
-        this->mouseY_ = 0;
         this->myShip_ = false;
 
@@ -142,4 +137,6 @@
         this->teamNr_ = 0;
         this->health_ = 100;
+
+        this->radarObject_ = static_cast<WorldEntity*>(this);
     }
 
@@ -161,12 +158,6 @@
                 delete this->backlight_;
 
-            if (this->setMouseEventCallback_)
-                InputManager::removeMouseHandler("SpaceShip");
-
             if (this->cam_)
                 delete this->cam_;
-
-            if (!this->myShip_)
-                HUD::getSingleton().removeRadarObject(this);
         }
     }
@@ -177,5 +168,5 @@
           myShip_=true;
         else
-          HUD::getSingleton().addRadarObject(this, this->getProjectileColour());
+          this->setRadarObjectColour(this->getProjectileColour());
       }
       if(Model::create())
@@ -418,5 +409,5 @@
 
         currentDir_ = getOrientation()*initialDir_;
-		currentOrth_ = getOrientation()*initialOrth_;
+        currentOrth_ = getOrientation()*initialOrth_;
 
         if (this->cam_)
Index: /code/trunk/src/orxonox/objects/SpaceShip.h
===================================================================
--- /code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1624)
+++ /code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1625)
@@ -36,9 +36,10 @@
 #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:
@@ -131,5 +132,4 @@
             Vector3 currentOrth_;
             bool bInvertYAxis_;
-            bool setMouseEventCallback_;
             bool bLMousePressed_;
             bool bRMousePressed_;
Index: /code/trunk/src/orxonox/objects/WorldEntity.cc
===================================================================
--- /code/trunk/src/orxonox/objects/WorldEntity.cc	(revision 1624)
+++ /code/trunk/src/orxonox/objects/WorldEntity.cc	(revision 1625)
@@ -95,11 +95,4 @@
     }
 
-    void WorldEntity::loadParams(TiXmlElement* xmlElem)
-    {
-
-        BaseObject::loadParams(xmlElem);
-        create();
-    }
-
 
     void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
Index: /code/trunk/src/orxonox/objects/WorldEntity.h
===================================================================
--- /code/trunk/src/orxonox/objects/WorldEntity.h	(revision 1624)
+++ /code/trunk/src/orxonox/objects/WorldEntity.h	(revision 1625)
@@ -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(); }
@@ -74,4 +73,6 @@
             inline const Vector3& getPosition() const
                 { return this->node_->getPosition(); }
+            inline const Vector3& getWorldPosition() const
+                { return this->node_->getWorldPosition(); }
 
             inline void translate(const Vector3& d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
@@ -101,4 +102,6 @@
             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); }
Index: /code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 1625)
@@ -0,0 +1,329 @@
+/*
+ *   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)
+        {
+            // set some default values
+            this->windowAspectRatio_ = 1.0f;
+            this->bCorrectAspect_    = false;
+            this->size_              = Vector2(1.0f, 1.0f);
+            this->sizeCorrection_    = Vector2(1.0f, 1.0f);
+            this->position_          = Vector2(0.0f, 0.0f);
+            this->pickPoint_         = Vector2(0.0f, 0.0f);
+            this->angle_             = Radian(0.0f);
+
+            // 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 for the first. Afterwards windowResized() gets
+            // called automatically by the GraphicsEngine.
+            this->windowResized(GraphicsEngine::getSingleton().getWindowWidth(),
+                GraphicsEngine::getSingleton().getWindowHeight());
+        }
+
+        XMLPortParam(OrxonoxOverlay, "correctAspect", setAspectCorrection, getAspectCorrection, xmlElement, mode);
+        XMLPortParam(OrxonoxOverlay, "size", setSize, getSize, xmlElement, mode);
+        XMLPortParam(OrxonoxOverlay, "rotation", setRotation, getRotation, xmlElement, mode);
+        // see setPickPoint()
+        XMLPortParam(OrxonoxOverlay, "pickPoint", setPickPoint, getPickPoint, xmlElement, mode);
+        XMLPortParam(OrxonoxOverlay, "position", setPosition, getPosition, xmlElement, mode);
+        XMLPortParam(OrxonoxOverlay, "background", setBackgroundMaterial, getBackgroundMaterial, xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            // call all the virtual 'setters'
+            this->changedVisibility();
+            this->angleChanged();
+            this->sizeCorrectionChanged();
+            this->sizeChanged();
+            // probably gets called 4 times (by all the methods), but sizeChanged() could be overwritten.
+            this->positionChanged();
+        }
+    }
+
+    //! 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/trunk/src/orxonox/overlays/OrxonoxOverlay.h
===================================================================
--- /code/trunk/src/orxonox/overlays/OrxonoxOverlay.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/OrxonoxOverlay.h	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/OverlayGroup.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/OverlayGroup.cc	(revision 1625)
@@ -0,0 +1,175 @@
+/*
+ *   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);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            // set default values
+            this->scale_  = Vector2(1.0, 1.0);
+            this->scroll_ = Vector2(0.0, 0.0);
+        }
+
+        XMLPortParam(OverlayGroup, "scale", setScale, getScale, xmlElement, mode);
+        XMLPortParam(OverlayGroup, "scroll", setScroll, getScroll, xmlElement, mode);
+        // 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/trunk/src/orxonox/overlays/OverlayGroup.h
===================================================================
--- /code/trunk/src/orxonox/overlays/OverlayGroup.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/OverlayGroup.h	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/OverlayText.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/OverlayText.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/OverlayText.cc	(revision 1625)
@@ -0,0 +1,107 @@
+/*
+ *   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)
+    {
+        if (mode == XMLPort::LoadObject)
+        {
+            // setting this to true makes the text more readable when the
+            // resolution aspect is far from 1.0
+            this->bCorrectAspect_ = true; // can be overridden by xml
+        }
+
+        OrxonoxOverlay::XMLPort(xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            this->text_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                .createOverlayElement("TextArea", "OverlayText_text_" + getUniqueNumberStr()));
+            this->text_->setCharHeight(1.0f);
+            this->text_->setFontName("Monofur");
+
+            this->background_->addChild(this->text_);
+        }
+
+        XMLPortParam(OverlayText, "font", setFont, getFont, xmlElement, mode);
+        XMLPortParam(OverlayText, "caption", setCaption, getCaption, xmlElement, mode);
+        XMLPortParam(OverlayText, "textSize", setTextSize, getTextSize, xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            this->text_->setCaption(this->caption_);
+        }
+    }
+
+    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()
+    {
+        this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y);
+        positionChanged();
+    }
+}
Index: /code/trunk/src/orxonox/overlays/OverlayText.h
===================================================================
--- /code/trunk/src/orxonox/overlays/OverlayText.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/OverlayText.h	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/console/InGameConsole.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/console/InGameConsole.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/console/InGameConsole.cc	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/console/InGameConsole.h
===================================================================
--- /code/trunk/src/orxonox/overlays/console/InGameConsole.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/console/InGameConsole.h	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/debug/DebugFPSText.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/debug/DebugFPSText.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/debug/DebugFPSText.cc	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/debug/DebugFPSText.h
===================================================================
--- /code/trunk/src/orxonox/overlays/debug/DebugFPSText.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/debug/DebugFPSText.h	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/debug/DebugRTRText.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/debug/DebugRTRText.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/debug/DebugRTRText.cc	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/debug/DebugRTRText.h
===================================================================
--- /code/trunk/src/orxonox/overlays/debug/DebugRTRText.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/debug/DebugRTRText.h	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/hud/HUDBar.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/HUDBar.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/hud/HUDBar.cc	(revision 1625)
@@ -0,0 +1,191 @@
+/*
+ *   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);
+        XMLPortParam(BarColour, "position", setPosition, getPosition, xmlElement, mode);
+    }
+
+
+    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));
+
+            // create bar
+            barWidth_s = 0.88f;
+            barHeight_s = 1.0f;
+            barOffsetLeft_s = 0.06f;
+            barOffsetTop_s = 0.0f;
+
+            this->bar_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                .createOverlayElement("Panel", "HUDBar_bar_" + getUniqueNumberStr()));
+            this->bar_->setMaterialName(materialname);
+            this->background_->addChild(bar_);
+
+            this->setValue(0);
+            this->autoColour_ = true;
+            this->right2Left_ = false; // default is left to right progress
+        }
+
+        XMLPortParamLoadOnly(HUDBar, "value", setValue, xmlElement, mode);
+        XMLPortParam(HUDBar, "right2left", setRightToLeft, getRightToLeft, xmlElement, mode);
+        XMLPortObject(HUDBar, BarColour, "", addColour, getColour, xmlElement, mode, false, true);
+    }
+
+    void HUDBar::setValue(float value)
+    {
+        if (value == this->value_)
+            return;
+
+        this->value_ = clamp<float>(value, 0, 1);
+        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(barOffsetLeft_s + barWidth_s * (1 - this->value_), barOffsetTop_s);
+            this->bar_->setDimensions(barWidth_s * this->value_, barHeight_s);
+        }
+        else
+        {
+            // default case
+            this->bar_->setPosition(barOffsetLeft_s, barOffsetTop_s);
+            this->bar_->setDimensions(barWidth_s * this->value_, barHeight_s);
+        }
+        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/trunk/src/orxonox/overlays/hud/HUDBar.h
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/HUDBar.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/hud/HUDBar.h	(revision 1625)
@@ -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);
+
+        virtual void setValue(float value);
+        void clearColours();
+
+        inline void setRightToLeft(bool r2l)
+        { this->right2Left_ = r2l; }
+        inline bool getRightToLeft() const
+        { return this->right2Left_; }
+        inline float getValue() const
+        { return this->value_; }
+
+    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_;
+
+        float barWidth_s;
+        float barHeight_s;
+        float barOffsetLeft_s;
+        float barOffsetTop_s;
+
+        static unsigned int materialcount_s;
+    };
+}
+#endif /* _HUDBar_H__ */
Index: /code/trunk/src/orxonox/overlays/hud/HUDNavigation.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/HUDNavigation.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/hud/HUDNavigation.cc	(revision 1625)
@@ -0,0 +1,281 @@
+/*
+ *   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()));
+            navText_->setCharHeight(0.05f);
+            navText_->setFontName("Monofur");
+
+            // create nav marker
+            navMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberStr()));
+            navMarker_->setMaterialName("Orxonox/NavArrows");
+            navMarkerSize_ = 0.05; //default
+            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");
+            aimMarkerSize_ = 0.04; // default
+            
+            background_->addChild(navMarker_);
+            background_->addChild(aimMarker_);
+            background_->addChild(navText_);
+
+            // hide at first
+            this->setVisible(false);
+        }
+
+        XMLPortParam(HUDNavigation, "font", setFont, getFont, xmlElement, mode);
+        XMLPortParam(HUDNavigation, "textSize", setTextSize, getTextSize, xmlElement, mode);
+        XMLPortParam(HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlElement, mode);
+        XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            this->sizeChanged();
+        }
+    }
+
+    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/trunk/src/orxonox/overlays/hud/HUDNavigation.h
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/HUDNavigation.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/hud/HUDNavigation.h	(revision 1625)
@@ -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; }
+        float getNavMarkerSize() const    { return this->navMarkerSize_; }
+
+        void setAimMarkerSize(float size) { this->aimMarkerSize_ = size; }
+        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/trunk/src/orxonox/overlays/hud/HUDRadar.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/HUDRadar.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/hud/HUDRadar.cc	(revision 1625)
@@ -0,0 +1,156 @@
+/*
+ *   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)
+    {
+        if (mode == XMLPort::LoadObject)
+            this->bCorrectAspect_ = true;
+
+        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();
+
+            this->sensitivity_ = 1.0f;
+            this->halfDotSizeDistance_ = 3000.0f;
+            this->maximumDotSize_ = 0.1;
+        }
+
+        XMLPortParam(HUDRadar, "sensitivity", setRadarSensitivity, getRadarSensitivity, xmlElement, mode);
+        XMLPortParam(HUDRadar, "halfDotSizeDistance", setHalfDotSizeDistance, getHalfDotSizeDistance, xmlElement, mode);
+        XMLPortParam(HUDRadar, "maximumDotSize", setMaximumDotSize, getMaximumDotSize, xmlElement, mode);
+
+        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/trunk/src/orxonox/overlays/hud/HUDRadar.h
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/HUDRadar.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/hud/HUDRadar.h	(revision 1625)
@@ -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/trunk/src/orxonox/overlays/hud/HUDSpeedBar.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.cc	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.cc	(revision 1625)
@@ -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:
+ *      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 vmax = ship->getMaxSpeed();
+            this->setValue(v/vmax);
+        }
+    }
+}
Index: /code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.h
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.h	(revision 1625)
+++ /code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.h	(revision 1625)
@@ -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/trunk/src/orxonox/tools/TextureGenerator.cc
===================================================================
--- /code/trunk/src/orxonox/tools/TextureGenerator.cc	(revision 1625)
+++ /code/trunk/src/orxonox/tools/TextureGenerator.cc	(revision 1625)
@@ -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/trunk/src/orxonox/tools/TextureGenerator.h
===================================================================
--- /code/trunk/src/orxonox/tools/TextureGenerator.h	(revision 1625)
+++ /code/trunk/src/orxonox/tools/TextureGenerator.h	(revision 1625)
@@ -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/trunk/src/orxonox/tools/WindowEventListener.cc
===================================================================
--- /code/trunk/src/orxonox/tools/WindowEventListener.cc	(revision 1625)
+++ /code/trunk/src/orxonox/tools/WindowEventListener.cc	(revision 1625)
@@ -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/trunk/src/orxonox/tools/WindowEventListener.h
===================================================================
--- /code/trunk/src/orxonox/tools/WindowEventListener.h	(revision 1625)
+++ /code/trunk/src/orxonox/tools/WindowEventListener.h	(revision 1625)
@@ -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/trunk/src/tinyxml/ticpp.cc
===================================================================
--- /code/trunk/src/tinyxml/ticpp.cc	(revision 1624)
+++ /code/trunk/src/tinyxml/ticpp.cc	(revision 1625)
@@ -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/trunk/src/util/Convert.h
===================================================================
--- /code/trunk/src/util/Convert.h	(revision 1624)
+++ /code/trunk/src/util/Convert.h	(revision 1625)
@@ -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/trunk/src/util/Math.cc
===================================================================
--- /code/trunk/src/util/Math.cc	(revision 1624)
+++ /code/trunk/src/util/Math.cc	(revision 1625)
@@ -30,4 +30,5 @@
 
 #include "Math.h"
+#include "Convert.h"
 
 /**
@@ -136,2 +137,13 @@
     return (targetposition + targetvelocity * time);
 }
+
+unsigned long getUniqueNumber()
+{
+    static unsigned long aNumber = 135;
+    return aNumber++;
+}
+
+std::string getUniqueNumberStr()
+{
+    return convertToString(getUniqueNumber());
+}
Index: /code/trunk/src/util/Math.h
===================================================================
--- /code/trunk/src/util/Math.h	(revision 1624)
+++ /code/trunk/src/util/Math.h	(revision 1625)
@@ -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;
@@ -161,4 +164,7 @@
 }
 
+_UtilExport unsigned long getUniqueNumber();
+_UtilExport std::string getUniqueNumberStr();
+
 class _UtilExport IntVector2
 {
Index: /code/trunk/src/util/String.cc
===================================================================
--- /code/trunk/src/util/String.cc	(revision 1624)
+++ /code/trunk/src/util/String.cc	(revision 1625)
@@ -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/trunk/src/util/String.h
===================================================================
--- /code/trunk/src/util/String.h	(revision 1624)
+++ /code/trunk/src/util/String.h	(revision 1625)
@@ -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/trunk/src/util/UtilPrereqs.h
===================================================================
--- /code/trunk/src/util/UtilPrereqs.h	(revision 1624)
+++ /code/trunk/src/util/UtilPrereqs.h	(revision 1625)
@@ -61,5 +61,4 @@
 //-----------------------------------------------------------------------
 class ArgReader;
-class Convert;
 class MultiTypePrimitive;
 class MultiTypeString;
Index: /code/trunk/visual_studio/vc8/audio.vcproj
===================================================================
--- /code/trunk/visual_studio/vc8/audio.vcproj	(revision 1624)
+++ /code/trunk/visual_studio/vc8/audio.vcproj	(revision 1625)
@@ -82,5 +82,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\audio_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
Index: /code/trunk/visual_studio/vc8/ois.vcproj
===================================================================
--- /code/trunk/visual_studio/vc8/ois.vcproj	(revision 1624)
+++ /code/trunk/visual_studio/vc8/ois.vcproj	(revision 1625)
@@ -24,5 +24,5 @@
 			InheritedPropertySheets="..\directory_properties.vsprops"
 			CharacterSet="2"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
Index: /code/trunk/visual_studio/vc8/orxonox.vcproj
===================================================================
--- /code/trunk/visual_studio/vc8/orxonox.vcproj	(revision 1624)
+++ /code/trunk/visual_studio/vc8/orxonox.vcproj	(revision 1625)
@@ -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"
@@ -424,13 +430,13 @@
 				</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>
@@ -460,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
@@ -483,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"
@@ -630,13 +676,13 @@
 				</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>
@@ -649,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/trunk/visual_studio/vc8/util.vcproj
===================================================================
--- /code/trunk/visual_studio/vc8/util.vcproj	(revision 1624)
+++ /code/trunk/visual_studio/vc8/util.vcproj	(revision 1625)
@@ -82,5 +82,5 @@
 			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\util_properties.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
+			WholeProgramOptimization="0"
 			>
 			<Tool
