Index: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 8891)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 9016)
@@ -25,4 +25,5 @@
  *      Reto Grieder
  *      Oliver Scheuss
+ *      Matthias Spalinger
  *
  */
@@ -63,5 +64,5 @@
 {
   SetConfigValue(markerLimit_, 3);
-
+  SetConfigValue(showDistance, false);
 }
 
@@ -75,8 +76,8 @@
 
     // Set default values
-    setFont ( "Monofur" );
-    setTextSize ( 0.05f );
-    setNavMarkerSize ( 0.05f );
-    setDetectionLimit( 10000.0f );
+    this->setFont ( "Monofur" );
+    this->setTextSize ( 0.05f );
+    this->setNavMarkerSize ( 0.05f );
+    this->setDetectionLimit( 10000.0f ); 
 }
 
@@ -97,8 +98,8 @@
     SUPER ( HUDNavigation, XMLPort, xmlelement, mode );
 
-    XMLPortParam ( HUDNavigation, "font",           setFont,           getFont,           xmlelement, mode );
-    XMLPortParam ( HUDNavigation, "textSize",       setTextSize,       getTextSize,       xmlelement, mode );
-    XMLPortParam ( HUDNavigation, "navMarkerSize",  setNavMarkerSize,  getNavMarkerSize,  xmlelement, mode );
-    XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
+    XMLPortParam ( HUDNavigation, "font",          setFont,          getFont,          xmlelement, mode );
+    XMLPortParam ( HUDNavigation, "textSize",      setTextSize,      getTextSize,      xmlelement, mode );
+    XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
+    XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode ); 
 }
 
@@ -144,5 +145,17 @@
 }
 
-
+float HUDNavigation::getArrowSizeX(int dist)
+{    
+    if (dist < 600) 
+        dist = 600;
+    return this->getActualSize().x * 900 * navMarkerSize_ / dist;
+}
+
+float HUDNavigation::getArrowSizeY(int dist)
+{    
+    if (dist < 600)
+        dist = 600;   
+    return this->getActualSize().y * 900 * navMarkerSize_ / dist;
+}
 
 void HUDNavigation::tick ( float dt )
@@ -165,4 +178,5 @@
     unsigned int markerCount_ = 0;
     bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player
+
 //         for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
     for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
@@ -170,5 +184,6 @@
         ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
         closeEnough_ = listIt->second < detectionLimit_ ;
-        if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) ) // display on HUD if the statement is true
+        // display radarviewables on HUD if the marker limit and max-distance is not exceeded 
+        if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) ) 
         {
 
@@ -176,6 +191,17 @@
             // Get Distance to HumanController and save it in the TextAreaOverlayElement.
             int dist = listIt->second;
+            float textLength = 0.0f;
+
+            //display distance next to cursor
+            if (showDistance){
             it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
-            float textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
+            textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
+            }
+
+            //display name next to cursor
+            else{
+            it->second.text_->setCaption(it->first->getRVName()); 
+            textLength = it->first->getRVName().size() * it->second.text_->getCharHeight() * 0.3f;
+            }
 
             // Transform to screen coordinates
@@ -194,6 +220,4 @@
             else
                 outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
-            // Get Distance to HumanController and save it in the TextAreaOverlayElement.
-            it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
 
             if ( outOfView )
@@ -207,4 +231,10 @@
                     it->second.wasOutOfView_ = true;
                 }
+
+                //float xDistScale = this->getActualSize().x * 1000.0f * navMarkerSize_ / dist;
+                //float yDistScale = this->getActualSize().y * 1000.0f * navMarkerSize_ / dist;
+
+                // Adjust Arrowsize according to distance
+                it->second.panel_->setDimensions(getArrowSizeX(dist),getArrowSizeY(dist));
 
                 // Switch between top, bottom, left and right position of the arrow at the screen border
@@ -263,4 +293,5 @@
                   //it->second.panel_->setMaterialName ( "Orxonox/NavTDC" );
                     it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "tdc.png", it->first->getRadarObjectColour()) );
+                    it->second.panel_->setDimensions ( navMarkerSize_ * this->getActualSize().x, navMarkerSize_ * this->getActualSize().y );
                     it->second.wasOutOfView_ = false;
                 }
@@ -280,5 +311,5 @@
             it->second.text_->show();
         }
-        else // do not display on HUD
+        else // do not display on HUD 
         {
             it->second.panel_->hide();
@@ -312,5 +343,5 @@
 void HUDNavigation::addObject ( RadarViewable* object )
 {
-    if( showObject(object) == false )
+    if( showObject(object)==false )
         return;
 
@@ -399,5 +430,5 @@
         return false;
     assert( rv->getWorldEntity() );
-    if ( rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false )
+    if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
         return false;
     return true;
