Index: code/branches/network/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/network/src/orxonox/Orxonox.cc	(revision 1410)
+++ code/branches/network/src/orxonox/Orxonox.cc	(revision 1411)
@@ -401,5 +401,5 @@
       client_g = network::Client::createSingleton();
     else
-      
+
       client_g = network::Client::createSingleton(serverIp_, serverPort_);
 
@@ -490,5 +490,5 @@
 //      orxonoxHUD_->setRocket2(ogreRoot.getCurrentFrameNumber());
       if (eventTimes[3].back() - eventTimes[3].front() != 0)
-        HUD::setFPS(50000.0f/(eventTimes[3].back() - eventTimes[3].front()));
+        HUD::getSingleton().setFPS(50000.0f/(eventTimes[3].back() - eventTimes[3].front()));
 
       // Iterate through all Tickables and call their tick(dt) function
Index: code/branches/network/src/orxonox/hud/BarOverlayElement.cc
===================================================================
--- code/branches/network/src/orxonox/hud/BarOverlayElement.cc	(revision 1410)
+++ code/branches/network/src/orxonox/hud/BarOverlayElement.cc	(revision 1411)
@@ -28,5 +28,4 @@
 #include "OrxonoxStableHeaders.h"
 #include "BarOverlayElement.h"
-
 #include <OgreOverlayManager.h>
 #include "GraphicsEngine.h"
Index: code/branches/network/src/orxonox/hud/BarOverlayElement.h
===================================================================
--- code/branches/network/src/orxonox/hud/BarOverlayElement.h	(revision 1410)
+++ code/branches/network/src/orxonox/hud/BarOverlayElement.h	(revision 1411)
@@ -26,12 +26,10 @@
 */
 
+#ifndef _BAR_H__
+#define _BAR_H__
 
-#ifndef _BarOverlayElement_H__
-#define _BarOverlayElement_H__
-
-#include "OrxonoxPrereqs.h"
-
+#include <OgrePanelOverlayElement.h>
 #include <OgrePrerequisites.h>
-#include <OgrePanelOverlayElement.h>
+#include "../OrxonoxPrereqs.h"
 
 namespace orxonox
@@ -40,36 +38,37 @@
   {
     private:
-      bool autoColor_;                    // whether bar changes color automatically
-      float value_;                       // progress of bar
-      int color_;
-      int left_;
-      int top_;
-      int width_;
-      int height_;
-      int windowW_, windowH_;
-      Ogre::Real leftRel_;
-      Ogre::Real topRel_;
-      Ogre::Real dimRel_;
-      Ogre::OverlayManager* om;           // our overlay manager
-      Ogre::OverlayContainer* container_; // our parent container to attach to
-      Ogre::OverlayContainer* background_;
-      Ogre::String name_;
+        bool autoColor_;                    // whether bar changes color automatically
+        float value_;                       // progress of bar
+        int color_;
+        int left_;
+        int top_;
+        int width_;
+        int height_;
+        int windowW_, windowH_;
+        Ogre::Real leftRel_;
+        Ogre::Real topRel_;
+        Ogre::Real dimRel_;
+        Ogre::OverlayManager* om;           // our overlay manager
+        Ogre::OverlayContainer* container_; // our parent container to attach to
+        Ogre::OverlayContainer* background_;
+        Ogre::String name_;
 
     public:
-      bool left2Right;
-      static const int RED = 0;           // predefined colors
-      static const int YELLOW = 1;
-      static const int GREEN = 2;
+        bool left2Right;
+        static const int RED = 0;           // predefined colors
+        static const int YELLOW = 1;
+        static const int GREEN = 2;
 
-      BarOverlayElement(const Ogre::String& name);
-      virtual ~BarOverlayElement();
-      void init(Real leftRel, Real topRel, Real dimRel, Ogre::OverlayContainer* container);
-      void resize();
-      void setValue(float value);
-      void setColor(int color);
-      float getValue();
-      int getBarColor();
+        BarOverlayElement(const Ogre::String& name);
+        virtual ~BarOverlayElement();
+        void init(Real leftRel, Real topRel, Real dimRel, Ogre::OverlayContainer* container);
+        void resize();
+        void setValue(float value);
+        void setColor(int color);
+        float getValue();
+        int getBarColor();
     };
 }
+#endif
 
-#endif /* _BarOverlayElement_H__ */
+
Index: code/branches/network/src/orxonox/hud/HUD.cc
===================================================================
--- code/branches/network/src/orxonox/hud/HUD.cc	(revision 1410)
+++ code/branches/network/src/orxonox/hud/HUD.cc	(revision 1411)
@@ -131,4 +131,8 @@
     }
 
+    void HUD::setFPS(float fps){
+        fpsText->setCaption("FPS: " + Ogre::StringConverter::toString(fps));
+    }
+
     void HUD::addRadarObject(Vector3 pos){
         // check if this is the first RadarObject to create
@@ -152,8 +156,4 @@
     }
 
-    /*static*/ void HUD::setFPS(float fps){
-        HUD::getSingleton().fpsText->setCaption("FPS: " + Ogre::StringConverter::toString(fps));
-    }
-
     /*static*/ void HUD::setEnergy(float value){
         HUD::getSingleton().energyBar->setValue(value);
Index: code/branches/network/src/orxonox/hud/HUD.h
===================================================================
--- code/branches/network/src/orxonox/hud/HUD.h	(revision 1410)
+++ code/branches/network/src/orxonox/hud/HUD.h	(revision 1411)
@@ -58,4 +58,5 @@
       public:
         virtual void tick(float);
+        void setFPS(float fps);
         void addRadarObject(Vector3 pos);
         RadarObject* getFirstRadarObject();
@@ -63,5 +64,4 @@
         static HUD* instance_s;
         static HUD& getSingleton();
-        static void setFPS(float fps);
         static void setEnergy(float value);
         static void cycleNavigationFocus();
Index: code/branches/network/src/orxonox/hud/Navigation.cc
===================================================================
--- code/branches/network/src/orxonox/hud/Navigation.cc	(revision 1410)
+++ code/branches/network/src/orxonox/hud/Navigation.cc	(revision 1411)
@@ -103,36 +103,35 @@
         int xPos = xPosRel*windowW_;
         int yPos = yPosRel*windowH_;
+        int xFromCenter = xPos-windowW_/2;
+        int yFromCenter = yPos-windowH_/2;
         // is object in view?
+        float radius = RadarOverlayElement::calcRadius(navCamPos_, currentDir_, currentOrth_, focus_);
+        bool isRight = (currentDir_.crossProduct(currentOrth_)).dotProduct(focus_->pos_ - navCamPos_)>0;
+        bool isAbove = currentOrth_.dotProduct(focus_->pos_ - navCamPos_)>0;
         bool outOfView = (xPosRel<0 || xPosRel>1 || yPosRel<0 || yPosRel>1);
         // if object is behind us, it is out of view anyway:
-        if(!outOfView && RadarOverlayElement::calcRadius(navCamPos_, currentDir_, currentOrth_, focus_)>3.14/2) outOfView = true;
+        if(!outOfView && radius>3.14/2) outOfView = true;
 
         if(outOfView){
-            // NO!
+            // object is not in view
             navMarker_->setMaterialName("Orxonox/NavArrows");
             navMarker_->setDimensions(16,16);
-            float phiUpRight = atan((float)(windowW_)/(float)(windowH_));
-            // from the angle we find out where to draw the marker
+            float phiUpperCorner = atan((float)(windowW_)/(float)(windowH_));
+            // from the angle we find out on which edge to draw the marker
             // and which of the four arrows to take
-            float phiNav = RadarOverlayElement::calcPhi(navCamPos_, currentDir_, currentOrth_, focus_);
-            bool right = RadarOverlayElement::calcRight(navCamPos_, currentDir_, currentOrth_, focus_);
-            if(right){
-                if(phiNav<phiUpRight){
-                    // arrow up
-                    navMarker_->setPosition(tan(phiNav)*windowH_/2+windowW_/2, 0);
+            float phiNav = atan((float) xFromCenter / (float) yFromCenter);
+
+            if(isAbove && isRight){
+                // top right quadrant
+                if(-phiNav<phiUpperCorner){
+                    COUT(3) << "arrow up\n";
+                    navMarker_->setPosition(-tan(phiNav)*windowH_/2+windowW_/2, 0);
                     navMarker_->setUV(0.5, 0.0, 1.0, 0.5);
                     navText_->setLeft(navMarker_->getLeft()+navMarker_->getWidth());
                     navText_->setTop(navMarker_->getHeight());
                 }
-                else if(phiNav>3.14-phiUpRight){
-                    // arrow down
-                    navMarker_->setPosition(-tan(phiNav)*windowH_/2+windowW_/2, windowH_-16);
-                    navMarker_->setUV(0.0, 0.5, 0.5, 1.0);
-                    navText_->setLeft(navMarker_->getLeft()+navMarker_->getWidth());
-                    navText_->setTop(navMarker_->getTop()-navMarker_->getHeight());
-                }
-                else {
-                    // arrow right
-                    navMarker_->setPosition(windowW_-16, -tan((3.14-2*phiNav)/2)*windowW_/2+windowH_/2);
+                else {
+                    COUT(3) << "arrow right\n";
+                    navMarker_->setPosition(windowW_-16, tan((3.14-2*phiNav)/2)*windowW_/2+windowH_/2);
                     navMarker_->setUV(0.5, 0.5, 1.0, 1.0);
                     navText_->setLeft(navMarker_->getLeft()-navMarker_->getWidth());
@@ -140,7 +139,25 @@
                 }
             }
-            else{
-                if(phiNav<phiUpRight) {
-                    // arrow up
+            if(!isAbove && isRight){
+                // bottom right quadrant
+                if(phiNav<phiUpperCorner) {
+                    COUT(3) << "arrow down\n";
+                    navMarker_->setPosition(tan(phiNav)*windowH_/2+windowW_/2, windowH_-16);
+                    navMarker_->setUV(0.0, 0.5, 0.5, 1.0);
+                    navText_->setLeft(navMarker_->getLeft()+navMarker_->getWidth());
+                    navText_->setTop(navMarker_->getTop()-navMarker_->getHeight());
+                }
+                else {
+                    COUT(3) << "arrow right\n";
+                    navMarker_->setPosition(windowW_-16, tan((3.14-2*phiNav)/2)*windowW_/2+windowH_/2);
+                    navMarker_->setUV(0.5, 0.5, 1.0, 1.0);
+                    navText_->setLeft(navMarker_->getLeft()-navMarker_->getWidth());
+                    navText_->setTop(navMarker_->getTop()+navMarker_->getHeight());
+                }
+            }
+            if(isAbove && !isRight){
+                // top left quadrant
+                if(phiNav<phiUpperCorner){
+                    COUT(3) << "arrow up\n";
                     navMarker_->setPosition(-tan(phiNav)*windowH_/2+windowW_/2, 0);
                     navMarker_->setUV(0.5, 0.0, 1.0, 0.5);
@@ -148,13 +165,6 @@
                     navText_->setTop(navMarker_->getHeight());
                 }
-                else if(phiNav>3.14-phiUpRight) {
-                    // arrow down
-                    navMarker_->setPosition(tan(phiNav)*windowH_/2+windowW_/2, windowH_-16);
-                    navMarker_->setUV(0.0, 0.5, 0.5, 1.0);
-                    navText_->setLeft(navMarker_->getLeft()+navMarker_->getWidth());
-                    navText_->setTop(navMarker_->getTop()-navMarker_->getHeight());
-                }
-                else {
-                    // arrow left
+                else {
+                    COUT(3) << "arrow left\n";
                     navMarker_->setPosition(0, -tan((3.14-2*phiNav)/2)*windowW_/2+windowH_/2);
                     navMarker_->setUV(0.0, 0.0, 0.5, 0.5);
@@ -163,7 +173,24 @@
                 }
             }
+            if(!isAbove && !isRight){
+                // bottom left quadrant
+                if(phiNav>-phiUpperCorner) {
+                    COUT(3) << "arrow down\n";
+                    navMarker_->setPosition(tan(phiNav)*windowH_/2+windowW_/2, windowH_-16);
+                    navMarker_->setUV(0.0, 0.5, 0.5, 1.0);
+                    navText_->setLeft(navMarker_->getLeft()+navMarker_->getWidth());
+                    navText_->setTop(navMarker_->getTop()-navMarker_->getHeight());
+                }
+                else {
+                    COUT(3) << "arrow left\n";
+                    navMarker_->setPosition(0, -tan((3.14-2*phiNav)/2)*windowW_/2+windowH_/2);
+                    navMarker_->setUV(0.0, 0.0, 0.5, 0.5);
+                    navText_->setLeft(navMarker_->getWidth());
+                    navText_->setTop(navMarker_->getTop()+navMarker_->getHeight());
+                }
+            }
         }
         else{
-            // YES!
+            // object is in view
             navMarker_->setMaterialName("Orxonox/NavTDC");
             navMarker_->setDimensions(24,24);
Index: code/branches/network/src/orxonox/hud/RadarObject.h
===================================================================
--- code/branches/network/src/orxonox/hud/RadarObject.h	(revision 1410)
+++ code/branches/network/src/orxonox/hud/RadarObject.h	(revision 1411)
@@ -20,5 +20,5 @@
 *
 *   Author:
-*      Yuning Chai
+*      Felix Schulthess
 *   Co-authors:
 *      ...
Index: code/branches/network/src/orxonox/hud/RadarOverlayElement.h
===================================================================
--- code/branches/network/src/orxonox/hud/RadarOverlayElement.h	(revision 1410)
+++ code/branches/network/src/orxonox/hud/RadarOverlayElement.h	(revision 1411)
@@ -22,5 +22,5 @@
 *      Yuning Chai
 *   Co-authors:
-*      ...
+*      Felix Schulthess
 *
 */
