Index: code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.cc	(revision 6864)
+++ code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.cc	(revision 6865)
@@ -28,4 +28,5 @@
 
 #include "HUDNavigation.h"
+#include <utility>
 
 #include <string>
@@ -54,13 +55,13 @@
     {
         RegisterObject(HUDNavigation);
-
-        // create nav text
-        navText_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton()
-            .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
-
-        // create nav marker
-        navMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
-            .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
-        navMarker_->setMaterialName("Orxonox/NavArrows");
+	
+//         // create nav text
+//         navText_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton()
+//             .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
+// 
+//         // create nav marker
+//         navMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+//             .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
+//         navMarker_->setMaterialName("Orxonox/NavArrows");
 
 /*
@@ -76,11 +77,11 @@
         setAimMarkerSize(0.04f);
 */
-
-        background_->addChild(navMarker_);
+/*
+        background_->addChild(navMarker_);*/
 //        background_->addChild(aimMarker_);
-        background_->addChild(navText_);
+//         background_->addChild(navText_);
 
         // hide at first
-        this->setVisible(false);
+//         this->setVisible(false);
 	
 	
@@ -138,29 +139,40 @@
     {
         SUPER(HUDNavigation, tick, dt);
+	
+// 	updateActiveObjectList(activeObjectList_);
 
         // Get radar
-        Radar* radar = this->getOwner()->getScene()->getRadar();
-
-        if (!radar->getFocus())
-        {
-            this->overlay_->hide();
-            return;
-        }
-        else
-        {
-            this->overlay_->show();
-        }
+//         Radar* radar = this->getOwner()->getScene()->getRadar();
+// 
+//         if (!radar->getFocus())
+//         {
+//             this->overlay_->hide();
+//             return;
+//         }
+//         else
+//         {
+//             this->overlay_->show();
+//         }
 
         // set text
-        int dist = static_cast<int>(getDist2Focus());
-        navText_->setCaption(multi_cast<std::string>(dist));
-        float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3f;
-
-        orxonox::Camera* cam = CameraManager::getInstance().getActiveCamera();
+//         int dist = static_cast<int>(getDist2Focus());
+//         navText_->setCaption(multi_cast<std::string>(dist));
+//         float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3f;
+
+      if(!activeObjectList_.empty()) {
+      for(tempRadarViewable = activeObjectList_.begin(); tempRadarViewable!=activeObjectList_.end(); ++tempRadarViewable)
+	{
+	
+	//get Distance to HumanController and save it in the TextAreaOverlayElement.
+	int dist = (int)(tempRadarViewable->first->getRVWorldPosition() - HumanController::getLocalControllerEntityAsPawn()->getWorldPosition()).length();
+	tempRadarViewable->second.second->setCaption(multi_cast<std::string>(dist));
+	float textLength = multi_cast<std::string>(dist).size() * tempRadarViewable->second.second->getCharHeight() * 0.3f;
+	 
+	orxonox::Camera* cam = CameraManager::getInstance().getActiveCamera();
         if (!cam)
             return;
         const Matrix4& transform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
         // transform to screen coordinates
-        Vector3 pos = transform * radar->getFocus()->getRVWorldPosition();
+        Vector3 pos = transform * tempRadarViewable->first->getRVWorldPosition();
 
         bool outOfView;
@@ -184,5 +196,5 @@
             if (!wasOutOfView_)
             {
-                navMarker_->setMaterialName("Orxonox/NavArrows");
+                tempRadarViewable->second.first->setMaterialName("Orxonox/NavArrows");
                 wasOutOfView_ = true;
             }
@@ -194,8 +206,8 @@
                     // up
                     float position = pos.x / pos.y + 1.0f;
-                    navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5f, 0.0f);
-                    navMarker_->setUV(0.5f, 0.0f, 1.0f, 0.5f);
-                    navText_->setLeft((position - textLength) * 0.5f);
-                    navText_->setTop(navMarker_->getHeight());
+                    tempRadarViewable->second.first->setPosition((position - tempRadarViewable->second.first->getWidth()) * 0.5f, 0.0f);
+                    tempRadarViewable->second.first->setUV(0.5f, 0.0f, 1.0f, 0.5f);
+                    tempRadarViewable->second.second->setLeft((position - textLength) * 0.5f);
+                    tempRadarViewable->second.second->setTop(tempRadarViewable->second.first->getHeight());
                 }
                 else
@@ -203,8 +215,8 @@
                     // left
                     float position = pos.y / pos.x + 1.0f;
-                    navMarker_->setPosition(0.0f, (position - navMarker_->getWidth()) * 0.5f);
-                    navMarker_->setUV(0.0f, 0.0f, 0.5f, 0.5f);
-                    navText_->setLeft(navMarker_->getWidth() + 0.01f);
-                    navText_->setTop((position - navText_->getCharHeight()) * 0.5f);
+                    tempRadarViewable->second.first->setPosition(0.0f, (position - tempRadarViewable->second.first->getWidth()) * 0.5f);
+                    tempRadarViewable->second.first->setUV(0.0f, 0.0f, 0.5f, 0.5f);
+                    tempRadarViewable->second.second->setLeft(tempRadarViewable->second.first->getWidth() + 0.01f);
+                    tempRadarViewable->second.second->setTop((position - tempRadarViewable->second.second->getCharHeight()) * 0.5f);
                 }
             }
@@ -215,8 +227,8 @@
                     // down
                     float position = -pos.x / pos.y + 1.0f;
-                    navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5f, 1.0f - navMarker_->getHeight());
-                    navMarker_->setUV(0.0f, 0.5f, 0.5f, 1.0f);
-                    navText_->setLeft((position - textLength) * 0.5f);
-                    navText_->setTop(1.0f - navMarker_->getHeight() - navText_->getCharHeight());
+                    tempRadarViewable->second.first->setPosition((position - tempRadarViewable->second.first->getWidth()) * 0.5f, 1.0f - navMarker_->getHeight());
+                    tempRadarViewable->second.first->setUV(0.0f, 0.5f, 0.5f, 1.0f);
+                    tempRadarViewable->second.second->setLeft((position - textLength) * 0.5f);
+                    tempRadarViewable->second.second->setTop(1.0f - tempRadarViewable->second.first->getHeight() - tempRadarViewable->second.second->getCharHeight());
                 }
                 else
@@ -224,8 +236,8 @@
                     // right
                     float position = -pos.y / pos.x + 1.0f;
-                    navMarker_->setPosition(1.0f - navMarker_->getWidth(), (position - navMarker_->getHeight()) * 0.5f);
-                    navMarker_->setUV(0.5f, 0.5f, 1.0f, 1.0f);
-                    navText_->setLeft(1.0f - navMarker_->getWidth() - textLength - 0.01f);
-                    navText_->setTop((position - navText_->getCharHeight()) * 0.5f);
+                    tempRadarViewable->second.first->setPosition(1.0f - tempRadarViewable->second.first->getWidth(), (position - tempRadarViewable->second.first->getHeight()) * 0.5f);
+                    tempRadarViewable->second.first->setUV(0.5f, 0.5f, 1.0f, 1.0f);
+                    tempRadarViewable->second.second->setLeft(1.0f - tempRadarViewable->second.first->getWidth() - textLength - 0.01f);
+                    tempRadarViewable->second.second->setTop((position - tempRadarViewable->second.second->getCharHeight()) * 0.5f);
                 }
             }
@@ -233,4 +245,6 @@
         else
         {
+	  
+	  
             // object is in view
 /*
@@ -240,12 +254,12 @@
             if (wasOutOfView_)
             {
-                navMarker_->setMaterialName("Orxonox/NavTDC");
+                tempRadarViewable->second.first->setMaterialName("Orxonox/NavTDC");
                 wasOutOfView_ = false;
             }
 
             // object is in view
-            navMarker_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
-            navMarker_->setLeft((pos.x + 1.0f - navMarker_->getWidth()) * 0.5f);
-            navMarker_->setTop((-pos.y + 1.0f - navMarker_->getHeight()) * 0.5f);
+            tempRadarViewable->second.first->setUV(0.0f, 0.0f, 1.0f, 1.0f);
+            tempRadarViewable->second.first->setLeft((pos.x + 1.0f - tempRadarViewable->second.first->getWidth()) * 0.5f);
+            tempRadarViewable->second.first->setTop((-pos.y + 1.0f - tempRadarViewable->second.first->getHeight()) * 0.5f);
 
 /*
@@ -254,11 +268,14 @@
             aimMarker_->setTop((-aimpos.y + 1.0f - aimMarker_->getHeight()) * 0.5f);
 */
-            navText_->setLeft((pos.x + 1.0f + navMarker_->getWidth()) * 0.5f);
-            navText_->setTop((-pos.y + 1.0f + navMarker_->getHeight()) * 0.5f);
+            tempRadarViewable->second.second->setLeft((pos.x + 1.0f + tempRadarViewable->second.first->getWidth()) * 0.5f);
+            tempRadarViewable->second.second->setTop((-pos.y + 1.0f + tempRadarViewable->second.first->getHeight()) * 0.5f);
         }
-    }
-
-    float HUDNavigation::getDist2Focus() const
-    {
+      }
+    }
+    }
+    
+    
+    float HUDNavigation::getDist2Focus() const{
+      
         Radar* radar = this->getOwner()->getScene()->getRadar();
         if (radar->getFocus() && HumanController::getLocalControllerEntityAsPawn())
@@ -272,24 +289,21 @@
            scales with scale(). Here we obviously have to adjust this.
     */
-    void HUDNavigation::sizeChanged()
-    {
-        // use size to compensate for aspect ratio if enabled.
+    void HUDNavigation::sizeChanged(){
+            // 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->aimMarker_)
+//             aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale);
         if (this->navText_)
             navText_->setCharHeight(navText_->getCharHeight() * yScale);
     }
     
-    void HUDNavigation::addObject(RadarViewable* object)
-    {
-        if (object == dynamic_cast<RadarViewable*>(this->getOwner()))
+    
+    void HUDNavigation::addObject(RadarViewable* object){
+            if (object == dynamic_cast<RadarViewable*>(this->getOwner()))
             return;
-	
+	 
 	assert(object);
 	  
@@ -307,20 +321,30 @@
         Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton()
              .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
+	     
+	int dist = (int)(object->getRVWorldPosition() - HumanController::getLocalControllerEntityAsPawn()->getWorldPosition()).length();
+	    activeObjectList_[object].second->setCaption(multi_cast<std::string>(dist));
 	
 	activeObjectList_[object] = std::make_pair (panel, text) ;	
 	activeObjectList_[object].first->show();
 	activeObjectList_[object].second->show();
-	}
-    
-    	void HUDNavigation::removeObject(RadarViewable* viewable){
-	  assert(activeObjectList_.find(viewable)!=activeObjectList_.end());
+// 	background_->addChild(activeObjectList_[object].first);
+// 	background_->addChild(activeObjectList_[object].second);
+    }
+    
+  void HUDNavigation::removeObject(RadarViewable* viewable){
+  	  assert(activeObjectList_.find(viewable)!=activeObjectList_.end());
 	  activeObjectList_.erase(viewable);
-	}
+  }
+
+// 	void updateActiveObjectList(map activeObjectList_){}
+// 
+// 	void HUDNavigation::objectChanged(RadarViewable* viewable){}
+// 
 // 	
-//         void HUDNavigation::objectChanged(RadarViewable* viewable){}
 //         float HUDNavigation::getRadarSensitivity(){}
 //         void HUDNavigation::radarTick(float dt){}
-// 	
-
+	
 
 }
+
+
Index: code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.h	(revision 6864)
+++ code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.h	(revision 6865)
@@ -39,5 +39,4 @@
 #include "overlays/OrxonoxOverlay.h"
 
-#include <pair>
 #include <vector>
 
@@ -65,4 +64,6 @@
         void positionChanged() { }
 	
+// 	void updateActiveObjectList(map activeObjectList_);
+	
 	
 
@@ -86,5 +87,5 @@
         float getDist2Focus() const;
 	void getSingleton();
-	void getSingleton();
+
     
 	void updateActiveObjectMap();
@@ -99,5 +100,7 @@
         bool wasOutOfView_;                         //!< Performance booster variable: setMaterial is not cheap
 	
-	std::map<RadarViewable*, std::pair<Ogre::PanelOverlayElement*, Ogre::TextAreaOverlayElement*> > activeObjectList_;
+	typedef std::map<RadarViewable*, std::pair<Ogre::PanelOverlayElement*, Ogre::TextAreaOverlayElement*> > activeObjectListType;
+	activeObjectListType activeObjectList_;
+	activeObjectListType::iterator tempRadarViewable;
 	
     };
