Index: code/branches/hud/src/orxonox/hud/HUDOverlay.cc
===================================================================
--- code/branches/hud/src/orxonox/hud/HUDOverlay.cc	(revision 1590)
+++ code/branches/hud/src/orxonox/hud/HUDOverlay.cc	(revision 1595)
@@ -41,4 +41,8 @@
   HUDOverlay::HUDOverlay()
     : overlay_(0)
+    , windowAspectRatio_(1.0f)
+    , bCorrectAspect_(false)
+    , size_(1.0f)
+    , sizeCorrection_(1.0f)
   {
     RegisterObject(HUDOverlay);
@@ -54,10 +58,10 @@
             + convertToString(hudOverlayCounter_s++) + "_" + this->getName());
 
-      this->windowWidth_ = GraphicsEngine::getSingleton().getWindowWidth();
-      this->windowHeight_ = GraphicsEngine::getSingleton().getWindowHeight();
-      this->windowAspectRatio_ = windowWidth_/(float)windowHeight_;
+      this->windowResized(GraphicsEngine::getSingleton().getWindowWidth(),
+            GraphicsEngine::getSingleton().getWindowHeight());
     }
 
-    XMLPortParam(HUDOverlay, "scale", setScale, getScale, xmlElement, mode);
+    XMLPortParam(HUDOverlay, "size", setSize, getSize, xmlElement, mode);
+    XMLPortParam(HUDOverlay, "correctAspect", setAspectCorrection, getAspectCorrection, xmlElement, mode);
     XMLPortParam(HUDOverlay, "scroll", setScroll, getScroll, xmlElement, mode);
     XMLPortParam(HUDOverlay, "rotation", setRotation, getRotation, xmlElement, mode);
@@ -68,4 +72,6 @@
       if (!this->isVisible())
           this->overlay_->hide();
+
+      this->sizeChanged();
     }
   }
@@ -77,18 +83,46 @@
   void HUDOverlay::changedVisibility()
   {
-      if (this->overlay_)
-      {
-          if (this->isVisible())
-              overlay_->show();
-          else
-              overlay_->hide();
-      }
+    if (this->overlay_)
+    {
+      if (this->isVisible())
+        this->overlay_->show();
+      else
+        this->overlay_->hide();
+    }
   }
 
   void HUDOverlay::windowResized(int newWidth, int newHeight)
   {
-    this->windowWidth_ = newWidth;
-    this->windowHeight_ = newHeight;
-    this->windowAspectRatio_ = windowWidth_/(float)windowHeight_;
+    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_.x * sizeCorrection_.y);
   }
 
Index: code/branches/hud/src/orxonox/hud/HUDOverlay.h
===================================================================
--- code/branches/hud/src/orxonox/hud/HUDOverlay.h	(revision 1590)
+++ code/branches/hud/src/orxonox/hud/HUDOverlay.h	(revision 1595)
@@ -47,5 +47,6 @@
       virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
 
-      virtual void changedVisibility();
+      void setAspectCorrection(bool val);
+      bool getAspectCorrection() { return this->bCorrectAspect_; }
 
       /** Sets the scrolling factor of this overlay. */
@@ -68,23 +69,34 @@
 
       /** Sets the scaling factor of this overlay. */
-      void setScale(const Vector2& scale) { overlay_->setScale(scale.x, scale.y); }
+      void setSize(const Vector2& size) { this->size_ = size; this->sizeChanged(); }
 
-      /** Gets the current scale value */
-      Vector2 getScale() const { return Vector2(overlay_->getScaleX(), overlay_->getScaleY()); }
+      /** 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) { overlay_->setScale(overlay_->getScaleX()*scale.x, overlay_->getScaleY()*scale.y); }
+      void scale(Vector2 scale) { this->size_ *= scale; this->sizeChanged(); }
 
     protected:
-      virtual void windowResized(int newWidth, int newHeight);
+      virtual void changedVisibility();
+      virtual void sizeChanged();
+      float getWindowAspectRatio() { return windowAspectRatio_; } 
 
       Ogre::Overlay* overlay_;
-      float windowAspectRatio_;
-      int windowWidth_;
-      int windowHeight_;
 
     private:
+      void windowResized(int newWidth, int newHeight);
+
+      float windowAspectRatio_;
+      bool bCorrectAspect_;
+      Vector2 size_;
+      Vector2 sizeCorrection_;
+
       static unsigned int hudOverlayCounter_s;
-
   };
 }
Index: code/branches/hud/src/orxonox/hud/Navigation.cc
===================================================================
--- code/branches/hud/src/orxonox/hud/Navigation.cc	(revision 1590)
+++ code/branches/hud/src/orxonox/hud/Navigation.cc	(revision 1595)
@@ -54,4 +54,5 @@
       , navMarker_(0)
       , aimMarker_(0)
+      , navText_(0)
       , focus_(0)
     {
@@ -81,23 +82,23 @@
         {
             // create container
-            this->container_ = static_cast<OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_navContainer"));
-            this->container_->setMetricsMode(Ogre::GMM_RELATIVE);
-            this->container_->setLeft(0.0);
-            this->container_->setTop(0.0);
-            this->container_->setWidth(1.0);
-            this->container_->setHeight(1.0);
+            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
-            this->navText_ = static_cast<TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", getName() + "_navText"));
-            this->navText_->setMetricsMode(Ogre::GMM_RELATIVE);
-            this->navText_->setPosition(0.0f, 0.0f);
-            this->navText_->setCharHeight(0.05f);
-            this->navText_->setFontName("Monofur");
+            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_->setDimensions(0.05f, 0.05f);
             navMarker_->setMaterialName("Orxonox/NavArrows");
+            this->navMarkerSize_ = 0.05;
             this->wasOutOfView_ = true; // just a to ensure the material is changed right the first time..
 
@@ -105,6 +106,6 @@
             aimMarker_ = static_cast<PanelOverlayElement*>(OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_aimMarker"));
             aimMarker_->setMetricsMode(GMM_RELATIVE);
-            aimMarker_->setDimensions(0.05f, 0.05f);
             aimMarker_->setMaterialName("Orxonox/NavCrosshair");
+            this->aimMarkerSize_ = 0.04;
             
             container_->addChild(navMarker_);
@@ -121,32 +122,29 @@
         XMLPortParam(Navigation, "navmarkersize", setNavMarkerSize, getNavMarkerSize, xmlElement, mode);
         XMLPortParam(Navigation, "aimmarkersize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode);
-    }
-
-    void Navigation::setNavMarkerSize(Vector2 size)
-    {
-        if (this->navMarker_ && size.squaredLength() >= 0.0f)
-            this->navMarker_->setDimensions(size.x, size.y);
-    }
-
-    Vector2 Navigation::getNavMarkerSize() const
-    {
-        if (this->navMarker_)
-            return Vector2(navMarker_->getWidth(), navMarker_->getHeight());
-        else
-            return Vector2::ZERO;
-    }
-
-    void Navigation::setAimMarkerSize(Vector2 size)
-    {
-        if (this->aimMarker_ && size.squaredLength() >= 0.0f)
-            this->aimMarker_->setDimensions(size.x, size.y);
-    }
-
-    Vector2 Navigation::getAimMarkerSize() const
-    {
-        if (this->aimMarker_)
-            return Vector2(aimMarker_->getWidth(), aimMarker_->getHeight());
-        else
-            return Vector2::ZERO;
+
+        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_;
     }
 
@@ -208,5 +206,4 @@
             pos.x = -pos.x;
             pos.y = -pos.y;
-            pos.z = -pos.z;
         }
         else
@@ -366,11 +363,14 @@
     }
 
-    void Navigation::windowResized(int newWidth, int newHeight)
-    {
-        HUDOverlay::windowResized(newWidth, newHeight);
-
-        //if (this->navMarker_)
-        //    navMarker_->setDimensions(0.05, 0.05);
-
+    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/hud/Navigation.h
===================================================================
--- code/branches/hud/src/orxonox/hud/Navigation.h	(revision 1590)
+++ code/branches/hud/src/orxonox/hud/Navigation.h	(revision 1595)
@@ -58,5 +58,5 @@
 
     protected:
-      virtual void windowResized(int newWidth, int newHeight);
+      virtual void sizeChanged();
 
       private:
@@ -65,8 +65,8 @@
         void updateFocus();
 
-        void setNavMarkerSize(Vector2 size);
-        Vector2 getNavMarkerSize() const;
-        void setAimMarkerSize(Vector2 size);
-        Vector2 getAimMarkerSize() const;
+        void setNavMarkerSize(float size);
+        float getNavMarkerSize() const;
+        void setAimMarkerSize(float size);
+        float getAimMarkerSize() const;
         void setTextSize(float size);
         float getTextSize() const;
@@ -75,7 +75,9 @@
 
         Ogre::OverlayContainer* container_;         //!< Container that holds the navigation elements
-        Ogre::PanelOverlayElement* navMarker_;      // the panel used to show the arrow
-        Ogre::PanelOverlayElement* aimMarker_;
-        Ogre::TextAreaOverlayElement* navText_;     // displaying distance
+        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
