Index: code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.cc	(revision 8974)
+++ code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.cc	(revision 8988)
@@ -25,4 +25,5 @@
  *      Reto Grieder
  *      Oliver Scheuss
+ *      Matthias Spalinger
  *
  */
@@ -63,5 +64,5 @@
 {
   SetConfigValue(markerLimit_, 3);
-
+  SetConfigValue(showDistance, false);
 }
 
@@ -78,5 +79,4 @@
     setTextSize ( 0.05f );
     setNavMarkerSize ( 0.05f );
-    setDetectionLimit( 10000.0f );
 }
 
@@ -97,8 +97,7 @@
     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 );
 }
 
@@ -144,5 +143,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 )
@@ -164,11 +175,11 @@
 
     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 )
     {
         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
+
+        if ( markerCount_ < markerLimit_ )
         {
 
@@ -176,6 +187,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 +216,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 +227,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 +289,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 +307,5 @@
             it->second.text_->show();
         }
-        else // do not display on HUD
+        else
         {
             it->second.panel_->hide();
@@ -312,5 +339,5 @@
 void HUDNavigation::addObject ( RadarViewable* object )
 {
-    if( showObject(object) == false )
+    if( showObject(object)==false )
         return;
 
@@ -399,5 +426,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;
