Index: code/branches/hud/src/orxonox/overlays/HUD.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/HUD.cc	(revision 1600)
+++ 	(revision )
@@ -1,249 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Yuning Chai
- *   Co-authors:
- *      Felix Schulthess
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "HUD.h"
-
-#include <string>
-#include <set>
-#include <assert.h>
-#include <OgreOverlay.h>
-#include <OgreOverlayContainer.h>
-#include <OgreOverlayManager.h>
-#include <OgreStringConverter.h>
-
-#include "core/Debug.h"
-#include "core/ConsoleCommand.h"
-#include "core/CoreIncludes.h"
-#include "objects/SpaceShip.h"
-#include "objects/WorldEntity.h"
-#include "GraphicsEngine.h"
-#include "HUDBar.h"
-#include "RadarObject.h"
-#include "RadarOverlayElement.h"
-#include "Navigation.h"
-
-namespace orxonox
-{
-    CreateFactory(HUD);
-
-    SetConsoleCommandShortcut(HUD, cycleNavigationFocus).setAccessLevel(AccessLevel::User);
-    SetConsoleCommandShortcut(HUD, releaseNavigationFocus).setAccessLevel(AccessLevel::User);
-    SetConsoleCommand(HUD, toggleVisibility, false).setAccessLevel(AccessLevel::User);
-
-    HUD* HUD::instance_s = 0;
-
-    using namespace Ogre;
-
-    HUD::HUD()
-    {
-        assert(instance_s == 0);
-        instance_s = this;
-        RegisterObject(HUD);
-
-        // Singleton like in Ogre. Constructor and destructor are public,
-        // but the assert prevents from having multiple instances.
-
-        orxonoxHUD_ = 0;
-        container_ = 0;
-        fpsText_ = 0;
-        rTRText_ = 0;
-        energyBar_ = 0;
-        speedoBar_ = 0;
-        radar_ = 0;
-        nav_ = 0;
-        showFPS_ = true;
-        showRenderTime_ = true;
-    }
-
-    HUD::~HUD()
-    {
-        if (this->isInitialized())
-        {
-            if (this->container_)
-                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->container_);
-            this->container_ = 0;
-            if (this->fpsText_)
-                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->fpsText_);
-            this->fpsText_ = 0;
-            if (this->rTRText_)
-                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->rTRText_);
-            this->rTRText_ = 0;
-            if (this->energyBar_)
-                delete this->energyBar_;
-            this->energyBar_ = 0;
-            /*if (this->speedoBar_)
-                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->speedoBar_);*/
-            this->speedoBar_ = 0;
-            if (this->radar_)
-                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->radar_);
-            this->radar_ = 0;
-            if (this->orxonoxHUD_)
-                Ogre::OverlayManager::getSingleton().destroy(this->orxonoxHUD_);
-            this->orxonoxHUD_ = 0;
-        }
-
-        instance_s = 0;
-    }
-
-    void HUD::XMLPort(Element& xmlElement, XMLPort::Mode mode)
-    {
-        BaseObject::XMLPort(xmlElement, mode);
-
-        showFPS_ = true;
-        showRenderTime_ = true;
-
-        XMLPortObject(HUD, HUDOverlay, "", addHUDElement, getHUDElement, xmlElement, mode, false, true);
-
-        // create Factories
-        Ogre::OverlayManager::getSingleton().addOverlayElementFactory(&radarOverlayElementFactory_);
-
-        // set up screen-wide container
-        container_ = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Orxonox/HUD/container"));
-        container_->setLeft(0.0);
-        container_->setTop(0.0);
-        container_->setWidth(1.0);
-        container_->setHeight(1.0);
-        container_->setMetricsMode(Ogre::GMM_RELATIVE);
-
-        orxonoxHUD_ = Ogre::OverlayManager::getSingleton().create("Orxonox/HUD");
-        orxonoxHUD_->add2D(container_);
-
-        // create radar
-        radar_ = static_cast<RadarOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Radar", "radar"));
-        radar_->init(0.5, 0.9, 0.2, container_);
-
-        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);
-
-        orxonoxHUD_->show();
-    }
-
-    void HUD::addHUDElement(HUDOverlay* 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;
-    }
-
-    HUDOverlay* HUD::getHUDElement(unsigned int index)
-    {
-        if (index < this->hudElements_.size())
-        {
-          std::map<std::string, HUDOverlay*>::const_iterator it = hudElements_.begin();
-          for (unsigned int i = 0; i != index; ++it, ++i)
-            ;
-          return (*it).second;
-        }
-        else
-            return 0;
-    }
-
-    void HUD::tick(float dt)
-    {
-        radar_->update();
-    }
-
-    void HUD::windowResized(int newWidth, int newHeight)
-    {
-        this->radar_->resize();
-    }
-
-    void HUD::addRadarObject(WorldEntity* object, const ColourValue& colour){
-        RadarObject* obj = new RadarObject(container_, object, colour);
-        roSet_.insert(roSet_.end(), obj);
-//        // check if this is the first RadarObject to create
-//        if(firstRadarObject == NULL){
-//            firstRadarObject = new RadarObject(container_, object, colour);
-//            lastRadarObject = firstRadarObject;
-//        }
-//        else{ // if not, append to list
-//            lastRadarObject->next = new RadarObject(container_, object, colour);
-//            lastRadarObject = lastRadarObject->next;
-//        }
-    }
-
-    void HUD::removeRadarObject(WorldEntity* object){
-        for(std::list<RadarObject*>::iterator it=roSet_.begin(); it!=roSet_.end(); ++it){
-            if ((*it)->getObject() == object)
-            {
-                /*if (this->nav_ && this->nav_->getFocus() == (*it))
-                    this->nav_->releaseFocus();*/
-
-                delete (*it);
-                roSet_.erase(it);
-                return;
-            }
-        }
-    }
-
-    /*static*/ HUD& HUD::getSingleton()
-    {
-        assert(instance_s);
-        return *instance_s;
-    }
-
-    /*static*/ void HUD::toggleVisibility(const std::string& name)
-    {
-        if (HUD::getSingleton().hudElements_.find(name) != HUD::getSingleton().hudElements_.end())
-        {
-            HUD::getSingleton().hudElements_[name]->setVisibility(!HUD::getSingleton().hudElements_[name]->isVisible());
-        }
-    }
-
-    /*static*/ void HUD::setEnergy(float value){
-        HUD::getSingleton().energyBar_->setValue(value);
-    }
-
-    /*static*/ void HUD::cycleNavigationFocus()
-    {
-        if (HUD::getSingleton().hudElements_.find("Navigation") != HUD::getSingleton().hudElements_.end())
-        {
-            Navigation* navi = dynamic_cast<Navigation*>(HUD::getSingleton().hudElements_["Navigation"]);
-            navi->cycleFocus();
-        }
-    }
-
-    /*static*/ void HUD::releaseNavigationFocus(){
-        //HUD::getSingleton().nav_->releaseFocus();
-    }
-}
Index: code/branches/hud/src/orxonox/overlays/HUD.h
===================================================================
--- code/branches/hud/src/orxonox/overlays/HUD.h	(revision 1600)
+++ 	(revision )
@@ -1,103 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Yuning Chai
- *   Co-authors:
- *      Felix Schulthess
- *
- */
-
-
-#ifndef _HUD_H__
-#define _HUD_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <OgrePrerequisites.h>
-#include <OgreTextAreaOverlayElement.h>
-#include "core/BaseObject.h"
-#include "objects/Tickable.h"
-#include "util/Math.h"
-#include "OverlayElementFactories.h"
-#include "tools/WindowEventListener.h"
-
-namespace orxonox
-{
-    class HUDBar;
-    class HUDOverlay;
-
-    class _OrxonoxExport HUD : public BaseObject, public TickableReal, public WindowEventListener
-    {
-      public:
-        HUD();
-        ~HUD();
-
-        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
-
-        virtual void tick(float);
-
-        void resize();
-        void addRadarObject(WorldEntity* object, const ColourValue& colour = ColourValue(0.5, 0.5, 0.5, 1));
-        void removeRadarObject(WorldEntity* object);
-        void setFPS();
-
-        inline std::list<RadarObject*>& getRadarObjects()
-            { return this->roSet_; }
-
-        static HUD& getSingleton();
-
-        static void setEnergy(float value);
-        static void cycleNavigationFocus();
-        static void releaseNavigationFocus();
-        static void toggleVisibility(const std::string& name);
-
-      private:
-        HUD(const HUD& instance);
-
-        void addHUDElement(HUDOverlay* element);
-        HUDOverlay* getHUDElement(unsigned int index);
-
-        void windowResized(int newWidth, int newHeight);
-
-        std::map<std::string, HUDOverlay*> hudElements_;
-
-        std::list<RadarObject*> roSet_;
-
-        RadarOverlayElementFactory radarOverlayElementFactory_;
-
-        Ogre::Overlay* orxonoxHUD_;
-        Ogre::OverlayContainer* container_;
-        Ogre::TextAreaOverlayElement* fpsText_;
-        Ogre::TextAreaOverlayElement* rTRText_;
-        HUDBar* energyBar_;
-        BarOverlayElement* speedoBar_;
-        RadarOverlayElement* radar_;
-        Navigation* nav_;
-
-        bool showFPS_;
-        bool showRenderTime_;
-
-        static HUD* instance_s;
-    };
-}
-
-#endif /* _HUD_H__ */
Index: code/branches/hud/src/orxonox/overlays/HUDOverlay.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/HUDOverlay.cc	(revision 1600)
+++ 	(revision )
@@ -1,151 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "HUDOverlay.h"
-
-#include <OgreOverlayManager.h>
-#include "util/Convert.h"
-#include "core/CoreIncludes.h"
-#include "GraphicsEngine.h"
-
-namespace orxonox
-{
-  unsigned int HUDOverlay::hudOverlayCounter_s = 0;
-
-  HUDOverlay::HUDOverlay()
-    : overlay_(0)
-    , windowAspectRatio_(1.0f)
-    , bCorrectAspect_(false)
-    , size_(1.0f, 1.0f)
-    , sizeCorrection_(1.0f, 1.0f)
-    , angle_(0.0f)
-    , position_(0.0f, 0.0f)
-    , origin_(0.5f, 0.5f)
-  {
-    RegisterObject(HUDOverlay);
-  }
-
-  void HUDOverlay::XMLPort(Element& xmlElement, XMLPort::Mode mode)
-  {
-    BaseObject::XMLPort(xmlElement, mode);
-
-    if (mode == XMLPort::LoadObject)
-    {
-      overlay_ = Ogre::OverlayManager::getSingleton().create("HUDOverlay"
-            + convertToString(hudOverlayCounter_s++) + "_" + this->getName());
-
-      this->windowResized(GraphicsEngine::getSingleton().getWindowWidth(),
-            GraphicsEngine::getSingleton().getWindowHeight());
-    }
-
-    XMLPortParam(HUDOverlay, "correctAspect", setAspectCorrection, getAspectCorrection, xmlElement, mode);
-    XMLPortParam(HUDOverlay, "size", setSize, getSize, xmlElement, mode);
-    XMLPortParam(HUDOverlay, "rotation", setRotation, getRotation, xmlElement, mode);
-    XMLPortParam(HUDOverlay, "origin", setOrigin, getOrigin, xmlElement, mode);
-    XMLPortParam(HUDOverlay, "position", setPosition, getPosition, xmlElement, mode);
-
-    if (mode == XMLPort::LoadObject)
-    {
-      this->overlay_->show();
-      if (!this->isVisible())
-          this->overlay_->hide();
-
-      this->sizeChanged();
-    }
-  }
-
-  HUDOverlay::~HUDOverlay()
-  {
-  }
-
-  void HUDOverlay::changedVisibility()
-  {
-    if (this->overlay_)
-    {
-      if (this->isVisible())
-        this->overlay_->show();
-      else
-        this->overlay_->hide();
-    }
-  }
-
-  void HUDOverlay::windowResized(int newWidth, int newHeight)
-  {
-    this->windowAspectRatio_ = newWidth/(float)newHeight;
-
-    this->setAspectCorrection(this->bCorrectAspect_);
-  }
-
-  void HUDOverlay::setAspectCorrection(bool val)
-  {
-    if (val)
-    {
-      // 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 / (this->windowAspectRatio_ + 1.0);
-      this->sizeCorrection_.y = this->windowAspectRatio_ * this->sizeCorrection_.x;
-    }
-    else
-    {
-      this->sizeCorrection_ = Vector2::UNIT_SCALE;
-    }
-
-    this->bCorrectAspect_ = val;
-    this->sizeChanged();
-  }
-
-  /**
-    @remarks
-      This function can be overriden by any derivative.
-  */
-  void HUDOverlay::sizeChanged()
-  {
-    this->overlay_->setScale(size_.x * sizeCorrection_.x, size_.y * sizeCorrection_.y);
-  }
-
-  /**
-    @remarks
-      This function can be overriden by any derivative.
-  */
-  void HUDOverlay::angleChanged()
-  {
-    this->overlay_->setRotate(this->angle_);
-  }
-
-  /**
-    @remarks
-      This function can be overriden by any derivative.
-  */
-  void HUDOverlay::positionChanged()
-  {
-    Vector2 scroll = (position_ - 0.5 - size_ * (origin_ - 0.5)) * 2.0;
-    this->overlay_->setScroll(scroll.x, -scroll.y);
-  }
-}
Index: code/branches/hud/src/orxonox/overlays/HUDOverlay.h
===================================================================
--- code/branches/hud/src/orxonox/overlays/HUDOverlay.h	(revision 1600)
+++ 	(revision )
@@ -1,115 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _HUDOverlay_H__
-#define _HUDOverlay_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <OgrePrerequisites.h>
-#include "tools/WindowEventListener.h"
-#include "util/Math.h"
-#include "core/BaseObject.h"
-
-namespace orxonox
-{
-  class _OrxonoxExport HUDOverlay : public BaseObject, public WindowEventListener
-  {
-    public:
-      HUDOverlay();
-      virtual ~HUDOverlay();
-
-      virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
-
-      void setAspectCorrection(bool val);
-      bool getAspectCorrection() { return this->bCorrectAspect_; }
-
-      /** Sets the position of this overlay. */
-      void setPosition(Vector2 pos) { this->position_ = pos; this->positionChanged(); }
-
-      /** Gets the current position. */
-      Vector2 getPosition() const { return this->position_; }
-
-      /** Scrolls the overlay by the offsets provided. */
-      void scroll(Vector2 scroll) { this->position_ += scroll; this->positionChanged(); }
-
-      /** Sets the origin point of this overlay. */
-      void setOrigin(Vector2 pos) { this->origin_ = pos; this->positionChanged(); }
-
-      /** Gets the origin point of this overlay */
-      Vector2 getOrigin() const { return this->origin_; }
-
-      /** Sets the rotation applied to this overlay.*/
-      void setRotation(const Ogre::Radian& angle) { this->angle_ = angle; this->angleChanged(); }
-
-      /** Gets the rotation applied to this overlay, in degrees.*/
-      const Radian& getRotation() const { return this->angle_; }
-
-      /** Adds the passed in angle to the rotation applied to this overlay. */
-      void rotate(const Radian& angle) { this->angle_ += angle; this->angleChanged(); }
-
-      /** Sets the scaling factor of this overlay. */
-      void setSize(const Vector2& size) { this->size_ = size; this->sizeChanged(); }
-
-      /** Gets the current size (not corrected) */
-      Vector2 getSize() const { return this->size_; }
-
-      /** Gets the current size (corrected) */
-      Vector2 getActualSize() const { return this->size_ * this->sizeCorrection_; }
-
-      /** Gets the current size correction */
-      Vector2 getSizeCorrection() const { return this->sizeCorrection_; }
-
-      /** Scales the overlay */
-      void scale(Vector2 scale) { this->size_ *= scale; this->sizeChanged(); }
-
-    protected:
-      virtual void changedVisibility();
-      virtual void sizeChanged();
-      virtual void angleChanged();
-      virtual void positionChanged();
-      float getWindowAspectRatio() { return windowAspectRatio_; } 
-
-      Ogre::Overlay* overlay_;
-
-    private:
-      void windowResized(int newWidth, int newHeight);
-
-      float windowAspectRatio_;
-      bool bCorrectAspect_;
-      Vector2 size_;
-      Vector2 sizeCorrection_;
-      Radian angle_;
-      Vector2 position_;
-      Vector2 origin_;
-
-      static unsigned int hudOverlayCounter_s;
-  };
-}
-
-#endif /* _HUDOverlay_H__ */
Index: code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 1601)
+++ code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 1601)
@@ -0,0 +1,151 @@
+/*
+ *   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 "OrxonoxOverlay.h"
+
+#include <OgreOverlayManager.h>
+#include "util/Convert.h"
+#include "core/CoreIncludes.h"
+#include "GraphicsEngine.h"
+
+namespace orxonox
+{
+  unsigned int OrxonoxOverlay::hudOverlayCounter_s = 0;
+
+  OrxonoxOverlay::OrxonoxOverlay()
+    : overlay_(0)
+    , windowAspectRatio_(1.0f)
+    , bCorrectAspect_(false)
+    , size_(1.0f, 1.0f)
+    , sizeCorrection_(1.0f, 1.0f)
+    , angle_(0.0f)
+    , position_(0.0f, 0.0f)
+    , origin_(0.0f, 0.0f)
+  {
+    RegisterObject(OrxonoxOverlay);
+  }
+
+  void OrxonoxOverlay::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+  {
+    BaseObject::XMLPort(xmlElement, mode);
+
+    if (mode == XMLPort::LoadObject)
+    {
+      overlay_ = Ogre::OverlayManager::getSingleton().create("OrxonoxOverlay"
+            + convertToString(hudOverlayCounter_s++) + "_" + this->getName());
+
+      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);
+    XMLPortParam(OrxonoxOverlay, "origin", setOrigin, getOrigin, xmlElement, mode);
+    XMLPortParam(OrxonoxOverlay, "position", setPosition, getPosition, xmlElement, mode);
+
+    if (mode == XMLPort::LoadObject)
+    {
+      this->overlay_->show();
+      if (!this->isVisible())
+          this->overlay_->hide();
+
+      this->sizeChanged();
+    }
+  }
+
+  OrxonoxOverlay::~OrxonoxOverlay()
+  {
+  }
+
+  void OrxonoxOverlay::changedVisibility()
+  {
+    if (this->overlay_)
+    {
+      if (this->isVisible())
+        this->overlay_->show();
+      else
+        this->overlay_->hide();
+    }
+  }
+
+  void OrxonoxOverlay::windowResized(int newWidth, int newHeight)
+  {
+    this->windowAspectRatio_ = newWidth/(float)newHeight;
+
+    this->setAspectCorrection(this->bCorrectAspect_);
+  }
+
+  void OrxonoxOverlay::setAspectCorrection(bool val)
+  {
+    if (val)
+    {
+      // 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 / (this->windowAspectRatio_ + 1.0);
+      this->sizeCorrection_.y = this->windowAspectRatio_ * this->sizeCorrection_.x;
+    }
+    else
+    {
+      this->sizeCorrection_ = Vector2::UNIT_SCALE;
+    }
+
+    this->bCorrectAspect_ = val;
+    this->sizeChanged();
+  }
+
+  /**
+    @remarks
+      This function can be overriden by any derivative.
+  */
+  void OrxonoxOverlay::sizeChanged()
+  {
+    this->overlay_->setScale(size_.x * sizeCorrection_.x, size_.y * sizeCorrection_.y);
+  }
+
+  /**
+    @remarks
+      This function can be overriden by any derivative.
+  */
+  void OrxonoxOverlay::angleChanged()
+  {
+    this->overlay_->setRotate(this->angle_);
+  }
+
+  /**
+    @remarks
+      This function can be overriden by any derivative.
+  */
+  void OrxonoxOverlay::positionChanged()
+  {
+    Vector2 scroll = (position_ - 0.5 - size_ * (origin_ - 0.5)) * 2.0;
+    this->overlay_->setScroll(scroll.x, -scroll.y);
+  }
+}
Index: code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.h
===================================================================
--- code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.h	(revision 1601)
+++ code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.h	(revision 1601)
@@ -0,0 +1,115 @@
+/*
+ *   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 _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
+{
+  class _OrxonoxExport OrxonoxOverlay : public BaseObject, public WindowEventListener
+  {
+    public:
+      OrxonoxOverlay();
+      virtual ~OrxonoxOverlay();
+
+      virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+      void setAspectCorrection(bool val);
+      bool getAspectCorrection() { return this->bCorrectAspect_; }
+
+      /** Sets the position of this overlay. */
+      void setPosition(Vector2 pos) { this->position_ = pos; this->positionChanged(); }
+
+      /** Gets the current position. */
+      Vector2 getPosition() const { return this->position_; }
+
+      /** Scrolls the overlay by the offsets provided. */
+      void scroll(Vector2 scroll) { this->position_ += scroll; this->positionChanged(); }
+
+      /** Sets the origin point of this overlay. */
+      void setOrigin(Vector2 pos) { this->origin_ = pos; this->positionChanged(); }
+
+      /** Gets the origin point of this overlay */
+      Vector2 getOrigin() const { return this->origin_; }
+
+      /** Sets the rotation applied to this overlay.*/
+      void setRotation(const Ogre::Radian& angle) { this->angle_ = angle; this->angleChanged(); }
+
+      /** Gets the rotation applied to this overlay, in degrees.*/
+      const Radian& getRotation() const { return this->angle_; }
+
+      /** Adds the passed in angle to the rotation applied to this overlay. */
+      void rotate(const Radian& angle) { this->angle_ += angle; this->angleChanged(); }
+
+      /** Sets the scaling factor of this overlay. */
+      void setSize(const Vector2& size) { this->size_ = size; this->sizeChanged(); }
+
+      /** Gets the current size (not corrected) */
+      Vector2 getSize() const { return this->size_; }
+
+      /** Gets the current size (corrected) */
+      Vector2 getActualSize() const { return this->size_ * this->sizeCorrection_; }
+
+      /** Gets the current size correction */
+      Vector2 getSizeCorrection() const { return this->sizeCorrection_; }
+
+      /** Scales the overlay */
+      void scale(Vector2 scale) { this->size_ *= scale; this->sizeChanged(); }
+
+    protected:
+      virtual void changedVisibility();
+      virtual void sizeChanged();
+      virtual void angleChanged();
+      virtual void positionChanged();
+      float getWindowAspectRatio() { return windowAspectRatio_; } 
+
+      Ogre::Overlay* overlay_;
+
+    private:
+      void windowResized(int newWidth, int newHeight);
+
+      float windowAspectRatio_;
+      bool bCorrectAspect_;
+      Vector2 size_;
+      Vector2 sizeCorrection_;
+      Radian angle_;
+      Vector2 position_;
+      Vector2 origin_;
+
+      static unsigned int hudOverlayCounter_s;
+  };
+}
+
+#endif /* _OrxonoxOverlay_H__ */
Index: code/branches/hud/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/OverlayGroup.cc	(revision 1601)
+++ code/branches/hud/src/orxonox/overlays/OverlayGroup.cc	(revision 1601)
@@ -0,0 +1,249 @@
+/*
+ *   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
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "OverlayGroup.h"
+
+#include <string>
+#include <set>
+#include <assert.h>
+#include <OgreOverlay.h>
+#include <OgreOverlayContainer.h>
+#include <OgreOverlayManager.h>
+#include <OgreStringConverter.h>
+
+#include "core/Debug.h"
+#include "core/ConsoleCommand.h"
+#include "core/CoreIncludes.h"
+#include "objects/SpaceShip.h"
+#include "objects/WorldEntity.h"
+#include "GraphicsEngine.h"
+#include "hud/HUDBar.h"
+#include "hud/RadarObject.h"
+#include "hud/RadarOverlayElement.h"
+#include "hud/HUDNavigation.h"
+
+namespace orxonox
+{
+    CreateFactory(OverlayGroup);
+
+    SetConsoleCommandShortcut(OverlayGroup, cycleNavigationFocus).setAccessLevel(AccessLevel::User);
+    SetConsoleCommandShortcut(OverlayGroup, releaseNavigationFocus).setAccessLevel(AccessLevel::User);
+    SetConsoleCommand(OverlayGroup, toggleVisibility, false).setAccessLevel(AccessLevel::User);
+
+    OverlayGroup* OverlayGroup::hudInstance_s = 0;
+
+    using namespace Ogre;
+
+    OverlayGroup::OverlayGroup()
+    {
+        assert(hudInstance_s == 0);
+        hudInstance_s = this;
+        RegisterObject(OverlayGroup);
+
+        // Singleton like in Ogre. Constructor and destructor are public,
+        // but the assert prevents from having multiple instances.
+
+        orxonoxHUD_ = 0;
+        container_ = 0;
+        fpsText_ = 0;
+        rTRText_ = 0;
+        energyBar_ = 0;
+        speedoBar_ = 0;
+        radar_ = 0;
+        nav_ = 0;
+        showFPS_ = true;
+        showRenderTime_ = true;
+    }
+
+    OverlayGroup::~OverlayGroup()
+    {
+        if (this->isInitialized())
+        {
+            if (this->container_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->container_);
+            this->container_ = 0;
+            if (this->fpsText_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->fpsText_);
+            this->fpsText_ = 0;
+            if (this->rTRText_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->rTRText_);
+            this->rTRText_ = 0;
+            if (this->energyBar_)
+                delete this->energyBar_;
+            this->energyBar_ = 0;
+            /*if (this->speedoBar_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->speedoBar_);*/
+            this->speedoBar_ = 0;
+            if (this->radar_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->radar_);
+            this->radar_ = 0;
+            if (this->orxonoxHUD_)
+                Ogre::OverlayManager::getSingleton().destroy(this->orxonoxHUD_);
+            this->orxonoxHUD_ = 0;
+        }
+
+        hudInstance_s = 0;
+    }
+
+    void OverlayGroup::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        BaseObject::XMLPort(xmlElement, mode);
+
+        showFPS_ = true;
+        showRenderTime_ = true;
+
+        XMLPortObject(OverlayGroup, OrxonoxOverlay, "", addElement, getElement, xmlElement, mode, false, true);
+
+        // create Factories
+        Ogre::OverlayManager::getSingleton().addOverlayElementFactory(&radarOverlayElementFactory_);
+
+        // set up screen-wide container
+        container_ = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Orxonox/HUD/container"));
+        container_->setLeft(0.0);
+        container_->setTop(0.0);
+        container_->setWidth(1.0);
+        container_->setHeight(1.0);
+        container_->setMetricsMode(Ogre::GMM_RELATIVE);
+
+        orxonoxHUD_ = Ogre::OverlayManager::getSingleton().create("Orxonox/HUD");
+        orxonoxHUD_->add2D(container_);
+
+        // create radar
+        radar_ = static_cast<RadarOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Radar", "radar"));
+        radar_->init(0.5, 0.9, 0.2, container_);
+
+        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);
+
+        orxonoxHUD_->show();
+    }
+
+    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;
+    }
+
+    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;
+    }
+
+    void OverlayGroup::tick(float dt)
+    {
+        radar_->update();
+    }
+
+    void OverlayGroup::windowResized(int newWidth, int newHeight)
+    {
+        this->radar_->resize();
+    }
+
+    void OverlayGroup::addRadarObject(WorldEntity* object, const ColourValue& colour){
+        RadarObject* obj = new RadarObject(container_, object, colour);
+        roSet_.insert(roSet_.end(), obj);
+//        // check if this is the first RadarObject to create
+//        if(firstRadarObject == NULL){
+//            firstRadarObject = new RadarObject(container_, object, colour);
+//            lastRadarObject = firstRadarObject;
+//        }
+//        else{ // if not, append to list
+//            lastRadarObject->next = new RadarObject(container_, object, colour);
+//            lastRadarObject = lastRadarObject->next;
+//        }
+    }
+
+    void OverlayGroup::removeRadarObject(WorldEntity* object){
+        for(std::list<RadarObject*>::iterator it=roSet_.begin(); it!=roSet_.end(); ++it){
+            if ((*it)->getObject() == object)
+            {
+                /*if (this->nav_ && this->nav_->getFocus() == (*it))
+                    this->nav_->releaseFocus();*/
+
+                delete (*it);
+                roSet_.erase(it);
+                return;
+            }
+        }
+    }
+
+    /*static*/ OverlayGroup& OverlayGroup::getHUD()
+    {
+        assert(hudInstance_s);
+        return *hudInstance_s;
+    }
+
+    /*static*/ void OverlayGroup::toggleVisibility(const std::string& name)
+    {
+        if (OverlayGroup::getHUD().hudElements_.find(name) != OverlayGroup::getHUD().hudElements_.end())
+        {
+            OverlayGroup::getHUD().hudElements_[name]->setVisibility(!OverlayGroup::getHUD().hudElements_[name]->isVisible());
+        }
+    }
+
+    /*static*/ void OverlayGroup::setEnergy(float value){
+        OverlayGroup::getHUD().energyBar_->setValue(value);
+    }
+
+    /*static*/ void OverlayGroup::cycleNavigationFocus()
+    {
+        if (OverlayGroup::getHUD().hudElements_.find("Navigation") != OverlayGroup::getHUD().hudElements_.end())
+        {
+            HUDNavigation* navi = dynamic_cast<HUDNavigation*>(OverlayGroup::getHUD().hudElements_["Navigation"]);
+            navi->cycleFocus();
+        }
+    }
+
+    /*static*/ void OverlayGroup::releaseNavigationFocus(){
+        //OverlayGroup::getHUD().nav_->releaseFocus();
+    }
+}
Index: code/branches/hud/src/orxonox/overlays/OverlayGroup.h
===================================================================
--- code/branches/hud/src/orxonox/overlays/OverlayGroup.h	(revision 1601)
+++ code/branches/hud/src/orxonox/overlays/OverlayGroup.h	(revision 1601)
@@ -0,0 +1,103 @@
+/*
+ *   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
+ *
+ */
+
+
+#ifndef _OverlayGroup_H__
+#define _OverlayGroup_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgrePrerequisites.h>
+#include <OgreTextAreaOverlayElement.h>
+#include "core/BaseObject.h"
+#include "objects/Tickable.h"
+#include "util/Math.h"
+#include "hud/OverlayElementFactories.h"
+#include "tools/WindowEventListener.h"
+
+namespace orxonox
+{
+    class HUDBar;
+    class OrxonoxOverlay;
+
+    class _OrxonoxExport OverlayGroup : public BaseObject, public TickableReal, public WindowEventListener
+    {
+      public:
+        OverlayGroup();
+        ~OverlayGroup();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        virtual void tick(float);
+
+        void resize();
+        void addRadarObject(WorldEntity* object, const ColourValue& colour = ColourValue(0.5, 0.5, 0.5, 1));
+        void removeRadarObject(WorldEntity* object);
+        void setFPS();
+
+        inline std::list<RadarObject*>& getRadarObjects()
+            { return this->roSet_; }
+
+        static OverlayGroup& getHUD();
+
+        static void setEnergy(float value);
+        static void cycleNavigationFocus();
+        static void releaseNavigationFocus();
+        static void toggleVisibility(const std::string& name);
+
+      private:
+        OverlayGroup(const OverlayGroup& instance);
+
+        void addElement(OrxonoxOverlay* element);
+        OrxonoxOverlay* getElement(unsigned int index);
+
+        void windowResized(int newWidth, int newHeight);
+
+        std::map<std::string, OrxonoxOverlay*> hudElements_;
+
+        std::list<RadarObject*> roSet_;
+
+        RadarOverlayElementFactory radarOverlayElementFactory_;
+
+        Ogre::Overlay* orxonoxHUD_;
+        Ogre::OverlayContainer* container_;
+        Ogre::TextAreaOverlayElement* fpsText_;
+        Ogre::TextAreaOverlayElement* rTRText_;
+        HUDBar* energyBar_;
+        BarOverlayElement* speedoBar_;
+        RadarOverlayElement* radar_;
+        HUDNavigation* nav_;
+
+        bool showFPS_;
+        bool showRenderTime_;
+
+        static OverlayGroup* hudInstance_s;
+    };
+}
+
+#endif /* _OverlayGroup_H__ */
Index: code/branches/hud/src/orxonox/overlays/console/InGameConsole.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/console/InGameConsole.cc	(revision 1600)
+++ code/branches/hud/src/orxonox/overlays/console/InGameConsole.cc	(revision 1601)
@@ -378,5 +378,5 @@
         this->consoleOverlayNoise_->setWidth((int) this->windowW_ * this->relativeWidth - 10);
         this->consoleOverlayNoise_->setHeight((int) this->windowH_ * this->relativeHeight - 5);
-        this->consoleOverlayNoise_->setTiling(consoleOverlayNoise_->getWidth() / 80.0f * this->noiseSize_, consoleOverlayNoise_->getHeight() / 80.0f * this->noiseSize_);
+        this->consoleOverlayNoise_->setTiling(consoleOverlayNoise_->getWidth() / (50.0f * this->noiseSize_), consoleOverlayNoise_->getHeight() / (50.0f * this->noiseSize_));
 
         // now adjust the text lines...
Index: code/branches/hud/src/orxonox/overlays/hud/HUDBar.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/hud/HUDBar.cc	(revision 1600)
+++ code/branches/hud/src/orxonox/overlays/hud/HUDBar.cc	(revision 1601)
@@ -73,5 +73,5 @@
     void HUDBar::XMLPort(Element& xmlElement, XMLPort::Mode mode)
     {
-        HUDOverlay::XMLPort(xmlElement, mode);
+        OrxonoxOverlay::XMLPort(xmlElement, mode);
 
         if (mode == XMLPort::LoadObject)
Index: code/branches/hud/src/orxonox/overlays/hud/HUDBar.h
===================================================================
--- code/branches/hud/src/orxonox/overlays/hud/HUDBar.h	(revision 1600)
+++ code/branches/hud/src/orxonox/overlays/hud/HUDBar.h	(revision 1601)
@@ -38,9 +38,9 @@
 
 #include "util/Math.h"
-#include "HUDOverlay.h"
+#include "overlays/OrxonoxOverlay.h"
 
 namespace orxonox
 {
-  class _OrxonoxExport HUDBar : public HUDOverlay
+  class _OrxonoxExport HUDBar : public OrxonoxOverlay
   {
     public:
Index: code/branches/hud/src/orxonox/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/hud/HUDNavigation.cc	(revision 1601)
+++ code/branches/hud/src/orxonox/overlays/hud/HUDNavigation.cc	(revision 1601)
@@ -0,0 +1,376 @@
+/*
+ *   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 <OgreStringConverter.h>
+
+//#include "GraphicsEngine.h"
+// TODO: remove the SpaceShip and CameraHandler dependencies
+#include "objects/SpaceShip.h"
+#include "objects/Projectile.h"
+#include "objects/CameraHandler.h"
+#include "overlays/OverlayGroup.h"
+#include "RadarObject.h"
+#include "RadarOverlayElement.h"
+#include "core/Debug.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(HUDNavigation);
+
+    using namespace Ogre;
+
+    HUDNavigation::HUDNavigation()
+      : container_(0)
+      , navMarker_(0)
+      , aimMarker_(0)
+      , navText_(0)
+      , focus_(0)
+    {
+        RegisterObject(HUDNavigation);
+    }
+
+    HUDNavigation::~HUDNavigation()
+    {
+        if (this->isInitialized())
+        {
+            if (this->container_)
+                OverlayManager::getSingleton().destroyOverlayElement(this->container_);
+            if (this->navMarker_)
+                OverlayManager::getSingleton().destroyOverlayElement(this->navMarker_);
+            if (this->navText_)
+                OverlayManager::getSingleton().destroyOverlayElement(this->navText_);
+            if (this->aimMarker_)
+                OverlayManager::getSingleton().destroyOverlayElement(this->aimMarker_);
+        }
+    }
+
+    void HUDNavigation::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        OrxonoxOverlay::XMLPort(xmlElement, mode);
+
+        if (mode == XMLPort::LoadObject)
+        {
+            // create container
+            container_ = static_cast<OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_navContainer"));
+            container_->setMetricsMode(Ogre::GMM_RELATIVE);
+            container_->setLeft(0.0);
+            container_->setTop(0.0);
+            container_->setWidth(1.0);
+            container_->setHeight(1.0);
+
+            // create nav text
+            navText_ = static_cast<TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", getName() + "_navText"));
+            navText_->setMetricsMode(Ogre::GMM_RELATIVE);
+            navText_->setPosition(0.0f, 0.0f);
+            navText_->setCharHeight(0.05f);
+            navText_->setFontName("Monofur");
+
+            // create nav marker
+            navMarker_ = static_cast<PanelOverlayElement*>(OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_navMarker"));
+            navMarker_->setMetricsMode(GMM_RELATIVE);
+            navMarker_->setMaterialName("Orxonox/NavArrows");
+            this->navMarkerSize_ = 0.05;
+            this->wasOutOfView_ = true; // just a to ensure the material is changed right the first time..
+
+            // create aim marker
+            aimMarker_ = static_cast<PanelOverlayElement*>(OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_aimMarker"));
+            aimMarker_->setMetricsMode(GMM_RELATIVE);
+            aimMarker_->setMaterialName("Orxonox/NavCrosshair");
+            this->aimMarkerSize_ = 0.04;
+            
+            container_->addChild(navMarker_);
+            container_->addChild(aimMarker_);
+            container_->addChild(navText_);
+            container_->show();
+
+            this->overlay_->add2D(container_);
+            this->overlay_->hide();
+        }
+
+        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::setNavMarkerSize(float size)
+    {
+        this->navMarkerSize_ = size;
+    }
+
+    float HUDNavigation::getNavMarkerSize() const
+    {
+        return this->navMarkerSize_;
+    }
+
+    void HUDNavigation::setAimMarkerSize(float size)
+    {
+        this->aimMarkerSize_ = size;
+    }
+
+    float HUDNavigation::getAimMarkerSize() const
+    {
+        return this->aimMarkerSize_;
+    }
+
+    void HUDNavigation::setFont(const std::string& font)
+    {
+        if (this->navText_ && font != "")
+            this->navText_->setFontName(font);
+    }
+
+    std::string HUDNavigation::getFont() const
+    {
+        if (this->navText_)
+            return this->navText_->getFontName();
+        else
+            return "";
+    }
+
+    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 (!focus_)
+            return;
+
+        updateMarker();
+    }
+
+    void HUDNavigation::updateMarker()
+    {
+        // set text
+        int dist = (int) getDist2Focus()/100.0f;
+        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 * focus_->getPosition();
+
+        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(), focus_->getPosition(), focus_->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);
+        }
+    }
+
+    void HUDNavigation::cycleFocus()
+    {
+        if (!focus_)
+        {
+            // Get closest object
+            float distance = (unsigned int) -1;
+            Vector3 shipPos = SpaceShip::getLocalShip()->getPosition();
+            it_ = OverlayGroup::getHUD().getRadarObjects().begin();
+
+            for (std::list<RadarObject*>::iterator it = OverlayGroup::getHUD().getRadarObjects().begin(); it != OverlayGroup::getHUD().getRadarObjects().end(); ++it)
+            {
+                float newdist = (*it)->getPosition().squaredDistance(shipPos);
+                if (newdist < distance)
+                {
+                    distance = newdist;
+                    it_ = it;
+                }
+            }
+
+            if (it_ != OverlayGroup::getHUD().getRadarObjects().end())
+            {
+                focus_ = *it_;
+
+                // move the focused object to the begin of the list, so we will iterate through all other objects when cycling
+                OverlayGroup::getHUD().getRadarObjects().erase(it_);
+                OverlayGroup::getHUD().getRadarObjects().insert(OverlayGroup::getHUD().getRadarObjects().begin(), focus_);
+                it_ = OverlayGroup::getHUD().getRadarObjects().begin();
+            }
+        }
+        else if (it_ != OverlayGroup::getHUD().getRadarObjects().end())
+        {
+            focus_->resetMaterial();
+            ++it_;
+            if (it_ != OverlayGroup::getHUD().getRadarObjects().end())
+                focus_ = *it_;
+            else
+                focus_ = 0;
+        }
+        else
+        {
+            focus_ = 0;
+        }
+        updateFocus();
+    }
+
+    void HUDNavigation::updateFocus()
+    {
+        if (focus_)
+        {
+            overlay_->show();
+            focus_->setColour(ColourValue::White);
+        }
+        else
+        {
+            overlay_->hide();
+        }
+    }
+
+    void HUDNavigation::releaseFocus()
+    {
+        this->focus_ = 0;
+        this->updateFocus();
+    }
+
+    float HUDNavigation::getDist2Focus() const
+    {
+        if (focus_)
+            return (focus_->getPosition() - SpaceShip::getLocalShip()->getPosition()).length();
+        else
+            return 0;
+    }
+
+    void HUDNavigation::sizeChanged()
+    {
+        float xScale = this->getActualSize().x;
+        float yScale = this->getActualSize().y;
+        if (this->navMarker_)
+            navMarker_->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale);
+        if (this->aimMarker_)
+            aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale);
+        if (this->navText_)
+            navText_->setCharHeight(navText_->getCharHeight() * yScale);
+    }
+}
Index: code/branches/hud/src/orxonox/overlays/hud/HUDNavigation.h
===================================================================
--- code/branches/hud/src/orxonox/overlays/hud/HUDNavigation.h	(revision 1601)
+++ code/branches/hud/src/orxonox/overlays/hud/HUDNavigation.h	(revision 1601)
@@ -0,0 +1,90 @@
+/*
+ *   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 <OgreTextAreaOverlayElement.h>
+#include <OgrePanelOverlayElement.h>
+#include "overlays/OrxonoxOverlay.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HUDNavigation : public OrxonoxOverlay, public Tickable
+    {
+      public:
+        HUDNavigation();
+        virtual ~HUDNavigation();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        virtual void tick(float dt);
+
+        void cycleFocus();
+        float getDist2Focus() const;
+
+        inline RadarObject* getFocus() const
+            { return this->focus_; }
+        void releaseFocus();
+
+    protected:
+      virtual void sizeChanged();
+      virtual void angleChanged() { }
+      virtual void positionChanged() { }
+
+      private:
+        void init();
+        void updateMarker();
+        void updateFocus();
+
+        void setNavMarkerSize(float size);
+        float getNavMarkerSize() const;
+        void setAimMarkerSize(float size);
+        float getAimMarkerSize() const;
+        void setTextSize(float size);
+        float getTextSize() const;
+        void setFont(const std::string& font);
+        std::string getFont() const;
+
+        Ogre::OverlayContainer* container_;         //!< Container that holds the navigation elements
+        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
+        std::list<RadarObject*>::iterator it_;
+        RadarObject* focus_;                        // next pointer of linked list
+        bool wasOutOfView_;
+  };
+}
+
+#endif /* _HUDNavigation_H__ */
Index: code/branches/hud/src/orxonox/overlays/hud/HUDText.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/hud/HUDText.cc	(revision 1600)
+++ code/branches/hud/src/orxonox/overlays/hud/HUDText.cc	(revision 1601)
@@ -60,5 +60,5 @@
   void HUDText::XMLPort(Element& xmlElement, XMLPort::Mode mode)
   {
-    HUDOverlay::XMLPort(xmlElement, mode);
+    OrxonoxOverlay::XMLPort(xmlElement, mode);
 
     if (mode == XMLPort::LoadObject)
Index: code/branches/hud/src/orxonox/overlays/hud/HUDText.h
===================================================================
--- code/branches/hud/src/orxonox/overlays/hud/HUDText.h	(revision 1600)
+++ code/branches/hud/src/orxonox/overlays/hud/HUDText.h	(revision 1601)
@@ -37,9 +37,9 @@
 
 #include "util/Math.h"
-#include "HUDOverlay.h"
+#include "overlays/OrxonoxOverlay.h"
 
 namespace orxonox
 {
-  class _OrxonoxExport HUDText : public HUDOverlay
+  class _OrxonoxExport HUDText : public OrxonoxOverlay
   {
   public:
Index: code/branches/hud/src/orxonox/overlays/hud/Navigation.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/hud/Navigation.cc	(revision 1600)
+++ 	(revision )
@@ -1,376 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Felix Schulthess
- *   Co-authors:
- *      Reto Grieder
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Navigation.h"
-
-#include <OgreOverlayManager.h>
-#include <OgreStringConverter.h>
-
-//#include "GraphicsEngine.h"
-// TODO: remove the SpaceShip and CameraHandler dependencies
-#include "objects/SpaceShip.h"
-#include "objects/Projectile.h"
-#include "objects/CameraHandler.h"
-#include "HUD.h"
-#include "RadarObject.h"
-#include "RadarOverlayElement.h"
-#include "core/Debug.h"
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
-    CreateFactory(Navigation);
-
-    using namespace Ogre;
-
-    Navigation::Navigation()
-      : container_(0)
-      , navMarker_(0)
-      , aimMarker_(0)
-      , navText_(0)
-      , focus_(0)
-    {
-        RegisterObject(Navigation);
-    }
-
-    Navigation::~Navigation()
-    {
-        if (this->isInitialized())
-        {
-            if (this->container_)
-                OverlayManager::getSingleton().destroyOverlayElement(this->container_);
-            if (this->navMarker_)
-                OverlayManager::getSingleton().destroyOverlayElement(this->navMarker_);
-            if (this->navText_)
-                OverlayManager::getSingleton().destroyOverlayElement(this->navText_);
-            if (this->aimMarker_)
-                OverlayManager::getSingleton().destroyOverlayElement(this->aimMarker_);
-        }
-    }
-
-    void Navigation::XMLPort(Element& xmlElement, XMLPort::Mode mode)
-    {
-        HUDOverlay::XMLPort(xmlElement, mode);
-
-        if (mode == XMLPort::LoadObject)
-        {
-            // create container
-            container_ = static_cast<OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_navContainer"));
-            container_->setMetricsMode(Ogre::GMM_RELATIVE);
-            container_->setLeft(0.0);
-            container_->setTop(0.0);
-            container_->setWidth(1.0);
-            container_->setHeight(1.0);
-
-            // create nav text
-            navText_ = static_cast<TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", getName() + "_navText"));
-            navText_->setMetricsMode(Ogre::GMM_RELATIVE);
-            navText_->setPosition(0.0f, 0.0f);
-            navText_->setCharHeight(0.05f);
-            navText_->setFontName("Monofur");
-
-            // create nav marker
-            navMarker_ = static_cast<PanelOverlayElement*>(OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_navMarker"));
-            navMarker_->setMetricsMode(GMM_RELATIVE);
-            navMarker_->setMaterialName("Orxonox/NavArrows");
-            this->navMarkerSize_ = 0.05;
-            this->wasOutOfView_ = true; // just a to ensure the material is changed right the first time..
-
-            // create aim marker
-            aimMarker_ = static_cast<PanelOverlayElement*>(OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_aimMarker"));
-            aimMarker_->setMetricsMode(GMM_RELATIVE);
-            aimMarker_->setMaterialName("Orxonox/NavCrosshair");
-            this->aimMarkerSize_ = 0.04;
-            
-            container_->addChild(navMarker_);
-            container_->addChild(aimMarker_);
-            container_->addChild(navText_);
-            container_->show();
-
-            this->overlay_->add2D(container_);
-            this->overlay_->hide();
-        }
-
-        XMLPortParam(Navigation, "font", setFont, getFont, xmlElement, mode);
-        XMLPortParam(Navigation, "textsize", setTextSize, getTextSize, xmlElement, mode);
-        XMLPortParam(Navigation, "navmarkersize", setNavMarkerSize, getNavMarkerSize, xmlElement, mode);
-        XMLPortParam(Navigation, "aimmarkersize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode);
-
-        if (mode == XMLPort::LoadObject)
-        {
-            this->sizeChanged();
-        }
-    }
-
-    void Navigation::setNavMarkerSize(float size)
-    {
-        this->navMarkerSize_ = size;
-    }
-
-    float Navigation::getNavMarkerSize() const
-    {
-        return this->navMarkerSize_;
-    }
-
-    void Navigation::setAimMarkerSize(float size)
-    {
-        this->aimMarkerSize_ = size;
-    }
-
-    float Navigation::getAimMarkerSize() const
-    {
-        return this->aimMarkerSize_;
-    }
-
-    void Navigation::setFont(const std::string& font)
-    {
-        if (this->navText_ && font != "")
-            this->navText_->setFontName(font);
-    }
-
-    std::string Navigation::getFont() const
-    {
-        if (this->navText_)
-            return this->navText_->getFontName();
-        else
-            return "";
-    }
-
-    void Navigation::setTextSize(float size)
-    {
-        if (this->navText_ && size >= 0.0f)
-            this->navText_->setCharHeight(size);
-    }
-
-    float Navigation::getTextSize() const
-    {
-        if (this->navText_)
-            return this->navText_->getCharHeight();
-        else
-            return 0.0f;
-    }
-
-    void Navigation::tick(float dt)
-    {
-        if (!focus_)
-            return;
-
-        updateMarker();
-    }
-
-    void Navigation::updateMarker()
-    {
-        // set text
-        int dist = (int) getDist2Focus()/100.0f;
-        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 * focus_->getPosition();
-
-        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(), focus_->getPosition(), focus_->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);
-        }
-    }
-
-    void Navigation::cycleFocus()
-    {
-        if (!focus_)
-        {
-            // Get closest object
-            float distance = (unsigned int) -1;
-            Vector3 shipPos = SpaceShip::getLocalShip()->getPosition();
-            it_ = HUD::getSingleton().getRadarObjects().begin();
-
-            for (std::list<RadarObject*>::iterator it = HUD::getSingleton().getRadarObjects().begin(); it != HUD::getSingleton().getRadarObjects().end(); ++it)
-            {
-                float newdist = (*it)->getPosition().squaredDistance(shipPos);
-                if (newdist < distance)
-                {
-                    distance = newdist;
-                    it_ = it;
-                }
-            }
-
-            if (it_ != HUD::getSingleton().getRadarObjects().end())
-            {
-                focus_ = *it_;
-
-                // move the focused object to the begin of the list, so we will iterate through all other objects when cycling
-                HUD::getSingleton().getRadarObjects().erase(it_);
-                HUD::getSingleton().getRadarObjects().insert(HUD::getSingleton().getRadarObjects().begin(), focus_);
-                it_ = HUD::getSingleton().getRadarObjects().begin();
-            }
-        }
-        else if (it_ != HUD::getSingleton().getRadarObjects().end())
-        {
-            focus_->resetMaterial();
-            ++it_;
-            if (it_ != HUD::getSingleton().getRadarObjects().end())
-                focus_ = *it_;
-            else
-                focus_ = 0;
-        }
-        else
-        {
-            focus_ = 0;
-        }
-        updateFocus();
-    }
-
-    void Navigation::updateFocus()
-    {
-        if (focus_)
-        {
-            overlay_->show();
-            focus_->setColour(ColourValue::White);
-        }
-        else
-        {
-            overlay_->hide();
-        }
-    }
-
-    void Navigation::releaseFocus()
-    {
-        this->focus_ = 0;
-        this->updateFocus();
-    }
-
-    float Navigation::getDist2Focus() const
-    {
-        if (focus_)
-            return (focus_->getPosition() - SpaceShip::getLocalShip()->getPosition()).length();
-        else
-            return 0;
-    }
-
-    void Navigation::sizeChanged()
-    {
-        float xScale = this->getActualSize().x;
-        float yScale = this->getActualSize().y;
-        if (this->navMarker_)
-            navMarker_->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale);
-        if (this->aimMarker_)
-            aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale);
-        if (this->navText_)
-            navText_->setCharHeight(navText_->getCharHeight() * yScale);
-    }
-}
Index: code/branches/hud/src/orxonox/overlays/hud/Navigation.h
===================================================================
--- code/branches/hud/src/orxonox/overlays/hud/Navigation.h	(revision 1600)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Felix Schulthess
- *   Co-authors:
- *      Reto Grieder
- *
- */
-
-#ifndef _Navigation_H__
-#define _Navigation_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <OgrePrerequisites.h>
-#include <OgreTextAreaOverlayElement.h>
-#include <OgrePanelOverlayElement.h>
-#include "HUDOverlay.h"
-#include "util/Math.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Navigation : public HUDOverlay, public Tickable
-    {
-      public:
-        Navigation();
-        virtual ~Navigation();
-
-        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
-
-        virtual void tick(float dt);
-
-        void cycleFocus();
-        float getDist2Focus() const;
-
-        inline RadarObject* getFocus() const
-            { return this->focus_; }
-        void releaseFocus();
-
-    protected:
-      virtual void sizeChanged();
-      virtual void angleChanged() { }
-      virtual void positionChanged() { }
-
-      private:
-        void init();
-        void updateMarker();
-        void updateFocus();
-
-        void setNavMarkerSize(float size);
-        float getNavMarkerSize() const;
-        void setAimMarkerSize(float size);
-        float getAimMarkerSize() const;
-        void setTextSize(float size);
-        float getTextSize() const;
-        void setFont(const std::string& font);
-        std::string getFont() const;
-
-        Ogre::OverlayContainer* container_;         //!< Container that holds the navigation elements
-        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
-        std::list<RadarObject*>::iterator it_;
-        RadarObject* focus_;                        // next pointer of linked list
-        bool wasOutOfView_;
-  };
-}
-
-#endif /* _Navigation_H__ */
Index: code/branches/hud/src/orxonox/overlays/hud/RadarOverlayElement.cc
===================================================================
--- code/branches/hud/src/orxonox/overlays/hud/RadarOverlayElement.cc	(revision 1600)
+++ code/branches/hud/src/orxonox/overlays/hud/RadarOverlayElement.cc	(revision 1601)
@@ -41,5 +41,5 @@
 #include "GraphicsEngine.h"
 #include "RadarObject.h"
-#include "HUD.h"
+#include "overlays/OverlayGroup.h"
 
 namespace orxonox
@@ -77,5 +77,5 @@
     void RadarOverlayElement::update() {
         // iterate through all RadarObjects
-        for(std::list<RadarObject*>::iterator it=HUD::getSingleton().getRadarObjects().begin(); it!=HUD::getSingleton().getRadarObjects().end(); it++)
+        for(std::list<RadarObject*>::iterator it=OverlayGroup::getHUD().getRadarObjects().begin(); it!=OverlayGroup::getHUD().getRadarObjects().end(); it++)
         {
             // calc position on radar...
@@ -101,5 +101,5 @@
         COUT(3) << "List of RadarObjects:\n";
         // iterate through all Radar Objects
-        for(std::list<RadarObject*>::const_iterator it=HUD::getSingleton().getRadarObjects().begin(); it!=HUD::getSingleton().getRadarObjects().end(); ++it){
+        for(std::list<RadarObject*>::const_iterator it=OverlayGroup::getHUD().getRadarObjects().begin(); it!=OverlayGroup::getHUD().getRadarObjects().end(); ++it){
             COUT(3) << i++ << ": " << (*it)->getPosition() << std::endl;
         }
