Index: code/branches/pickup2/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/pickup2/src/modules/overlays/hud/HUDNavigation.cc	(revision 5942)
+++ code/branches/pickup2/src/modules/overlays/hud/HUDNavigation.cc	(revision 6412)
@@ -30,4 +30,5 @@
 
 #include <string>
+#include <OgreCamera.h>
 #include <OgreOverlayManager.h>
 #include <OgreTextAreaOverlayElement.h>
@@ -35,10 +36,13 @@
 
 #include "util/Math.h"
-#include "util/StringUtils.h"
 #include "util/Convert.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
+#include "CameraManager.h"
 #include "Scene.h"
 #include "Radar.h"
+#include "graphics/Camera.h"
+#include "controllers/HumanController.h"
+#include "worldentities/pawns/Pawn.h"
 
 namespace orxonox
@@ -60,4 +64,5 @@
         navMarker_->setMaterialName("Orxonox/NavArrows");
 
+/*
         // create aim marker
         aimMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
@@ -70,7 +75,8 @@
         setNavMarkerSize(0.05f);
         setAimMarkerSize(0.04f);
+*/
 
         background_->addChild(navMarker_);
-        background_->addChild(aimMarker_);
+//        background_->addChild(aimMarker_);
         background_->addChild(navText_);
 
@@ -85,5 +91,5 @@
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navMarker_);
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navText_);
-            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->aimMarker_);
+//            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->aimMarker_);
         }
     }
@@ -96,10 +102,10 @@
         XMLPortParam(HUDNavigation, "textSize", setTextSize, getTextSize, xmlElement, mode);
         XMLPortParam(HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlElement, mode);
-        XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode);
+//        XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode);
     }
 
     void HUDNavigation::setFont(const std::string& font)
     {
-        if (this->navText_ && font != "")
+        if (this->navText_ && !font.empty())
             this->navText_->setFontName(font);
     }
@@ -149,10 +155,10 @@
         float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3;
 
-/*
-        Ogre::Camera* navCam = SpaceShip::getLocalShip()->getCamera()->cam_;
-        Matrix4 transformationMatrix = navCam->getProjectionMatrix() * navCam->getViewMatrix();
-*/
+        orxonox::Camera* cam = CameraManager::getInstance().getActiveCamera();
+        if (!cam)
+            return;
+        const Matrix4& transform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
         // transform to screen coordinates
-        Vector3 pos = /*transformationMatrix * */radar->getFocus()->getRVWorldPosition();
+        Vector3 pos = transform * radar->getFocus()->getRVWorldPosition();
 
         bool outOfView;
@@ -172,5 +178,5 @@
         {
             // object is not in view
-            aimMarker_->hide();
+//            aimMarker_->hide();
 
             if (!wasOutOfView_)
@@ -227,5 +233,5 @@
             // object is in view
 /*
-            Vector3 aimpos = transformationMatrix * getPredictedPosition(SpaceShip::getLocalShip()->getPosition(),
+            Vector3 aimpos = transform * getPredictedPosition(SpaceShip::getLocalShip()->getPosition(),
                     Projectile::getSpeed(), Radar::getInstance().getFocus()->getRVWorldPosition(), Radar::getInstance().getFocus()->getRVOrientedVelocity());
 */
@@ -241,6 +247,6 @@
             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);
@@ -253,9 +259,8 @@
     float HUDNavigation::getDist2Focus() const
     {
-/*
-        if (Radar::getInstance().getFocus())
-            return (Radar::getInstance().getFocus()->getRVWorldPosition() - SpaceShip::getLocalShip()->getPosition()).length();
-        else
-*/
+        Radar* radar = this->getOwner()->getScene()->getRadar();
+        if (radar->getFocus() && HumanController::getLocalControllerEntityAsPawn())
+            return (radar->getFocus()->getRVWorldPosition() - HumanController::getLocalControllerEntityAsPawn()->getWorldPosition()).length();
+        else
             return 0;
     }
@@ -267,11 +272,13 @@
     void HUDNavigation::sizeChanged()
     {
-        // use size to compensate for apspect ratio if enabled.
+        // use size to compensate for aspect ratio if enabled.
         float xScale = this->getActualSize().x;
         float yScale = this->getActualSize().y;
         if (this->navMarker_)
             navMarker_->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale);
+/*
         if (this->aimMarker_)
             aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale);
+*/
         if (this->navText_)
             navText_->setCharHeight(navText_->getCharHeight() * yScale);
