Index: code/branches/presentationHS14merge/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/presentationHS14merge/src/modules/overlays/hud/HUDNavigation.cc	(revision 10222)
+++ code/branches/presentationHS14merge/src/modules/overlays/hud/HUDNavigation.cc	(revision 10242)
@@ -82,4 +82,6 @@
         this->setNavMarkerSize(0.03f);
         this->setAimMarkerSize(0.02f);
+        this->setHealthMarkerSize(0.06f);
+        this->setHealthLevelMarkerSize(0.06f);
 
         this->setDetectionLimit(10000.0f);
@@ -116,4 +118,7 @@
         XMLPortParam(HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode);
         XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlelement, mode);
+        XMLPortParam(HUDNavigation, "healthMarkerSize", setHealthMarkerSize, getHealthMarkerSize, xmlelement, mode);
+        XMLPortParam(HUDNavigation, "healthLevelMarkerSize", setHealthLevelMarkerSize, getHealthLevelMarkerSize, xmlelement, mode);
+
     }
 
@@ -206,4 +211,5 @@
         for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt)
         {
+
             std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.find(listIt->first);
             closeEnough = listIt->second < this->detectionLimit_;
@@ -275,4 +281,6 @@
 
 
+
+
                 // Transform to screen coordinates
                 Vector3 pos = camTransform * it->first->getRVWorldPosition();
@@ -298,4 +306,6 @@
                     if (!it->second.wasOutOfView_)
                     {
+                        it->second.health_->hide();
+                        it->second.healthLevel_->hide();
                         it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("arrows.png", it->first->getRadarObjectColour()));
                         it->second.wasOutOfView_ = true;
@@ -357,4 +367,33 @@
                     // Object is in view
 
+
+
+
+                    //calculate the health of the actual selected radarViewable (relativHealthScale: while (0) is no health left, (1) is the initial health)
+                    Pawn* pawnPtr = (Pawn*) (it->first->getWorldEntity());
+                    float health = pawnPtr->getHealth();
+                    float initHealth = pawnPtr->getMaxHealth();
+                    float relativHealthScale = health/initHealth;
+
+                    //integer values from 0 to 10 (0 is no health and 10 is full health)
+                    int discreteHealthScale = (int)(10*relativHealthScale);
+
+                    //calculate the HealthLevel (= OponentLevel or Strength) there are 5 Levels
+                    //Level 1, Level 2,... , Level 5
+                    int HealthLevel = 1;
+
+                    if(initHealth < 200)
+                        HealthLevel = 1;
+                    if(200 <= initHealth && initHealth < 500)
+                        HealthLevel = 2;
+                    if(500 <= initHealth && initHealth < 1000)
+                        HealthLevel = 3;
+                    if(1000 <= initHealth && initHealth < 2500)
+                        HealthLevel = 4;
+                    if(2500 <= initHealth)
+                        HealthLevel = 5;
+
+
+
                     // Change material only if outOfView changed
                     if (it->second.wasOutOfView_)
@@ -364,6 +403,53 @@
                         it->second.panel_->setDimensions(this->navMarkerSize_ * this->getActualSize().x, this->navMarkerSize_ * this->getActualSize().y);
                         it->second.target_->setDimensions(this->aimMarkerSize_ * this->getActualSize().x, this->aimMarkerSize_ * this->getActualSize().y);
+
+
+                        //it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2_1.png", it->first->getRadarObjectColour()));
+                        it->second.health_->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", it->first->getRadarObjectColour()));
+                        it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x , 0.75f*this->healthMarkerSize_ * this->getActualSize().y);
                         it->second.wasOutOfView_ = false;
-                    }
+
+                        // because as soon as relative health drops below 10% (0.1) the descrete value is 0 but as long as the
+                        // spaceship is still intact there should be at least one part of the bar left.
+                        if(1<=discreteHealthScale){
+                            it->second.health_->setTiling((float)discreteHealthScale , 1 ,0);
+                            it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x *0.1f*discreteHealthScale, 0.75f*this->healthMarkerSize_ * this->getActualSize().y);
+                        }
+
+
+
+                        //healthLevel
+                        it->second.healthLevel_->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", it->first->getRadarObjectColour()));
+                        it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * this->getActualSize().x , 0.75f*this->healthLevelMarkerSize_ * this->getActualSize().y);
+                        it->second.wasOutOfView_ = false;
+                        it->second.healthLevel_->setTiling((float)HealthLevel , 1 ,0);
+                        it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * this->getActualSize().x *0.1f*HealthLevel, 0.25f*this->healthLevelMarkerSize_ * this->getActualSize().y);
+                    }
+
+
+
+                    // sets Position and Dimensions (amount) health
+                    it->second.health_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
+                    it->second.health_->setLeft((pos.x + 0.975f - it->second.panel_->getWidth()) * 0.5f);
+                    it->second.health_->setTop((-pos.y + 1.04f - it->second.panel_->getHeight()) * 0.5f);
+
+
+                    // because as soon as relative health drops below 10% (0.1) the descrete value is 0 but as long as the
+                    // spaceship is still intact there should be at least one part of the bar left.
+                    if(1<=discreteHealthScale){
+                    it->second.health_->setTiling((float)discreteHealthScale , 1 ,0);
+                    it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x *0.1f*discreteHealthScale, 0.75f*this->healthMarkerSize_ * this->getActualSize().y);
+                    }
+
+
+                    //sets Position and Dimensions (level) of healthLevel
+                    it->second.healthLevel_->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", it->first->getRadarObjectColour()));
+                    it->second.healthLevel_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
+                    it->second.healthLevel_->setLeft((pos.x + 0.975f - it->second.panel_->getWidth()) * 0.5f);
+                    it->second.healthLevel_->setTop((-pos.y + 1.125f - it->second.panel_->getHeight()) * 0.5f);
+
+                    it->second.healthLevel_->setTiling((float)HealthLevel , 1 ,0);
+                    it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * this->getActualSize().x *0.1f*HealthLevel, 0.25f*this->healthLevelMarkerSize_ * this->getActualSize().y);
+
 
                     // Position marker
@@ -376,5 +462,10 @@
                     it->second.text_->setTop((-pos.y + 1.0f + it->second.panel_->getHeight()) * 0.5f);
 
+
+
+
                     // Make sure the overlays are shown
+                    it->second.health_->show();
+                    it->second.healthLevel_->show();
                     it->second.panel_->show();
                     it->second.text_->show();
@@ -419,4 +510,6 @@
 
             {
+                it->second.health_->hide();
+                it->second.healthLevel_->hide();
                 it->second.panel_->hide();
                 it->second.text_->hide();
@@ -442,4 +535,8 @@
         for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
         {
+            if (it->second.health_ != NULL)
+                it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
+            if (it->second.healthLevel_ != NULL)
+                it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
             if (it->second.panel_ != NULL)
                 it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
@@ -468,4 +565,18 @@
 
         // Create everything needed to display the object on the radar and add it to the map
+
+        // Create health
+        Ogre::PanelOverlayElement* health = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDNavigation_healthMarker_" + getUniqueNumberString()));
+        //panel->setMaterialName("Orxonox/NavTDC");
+        health->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", object->getRadarObjectColour()));
+        health->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
+        //panel->setColour(object->getRadarObjectColour());
+
+        // Create healthLevel
+        Ogre::PanelOverlayElement* healthLevel = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDNavigation_healthLevelMarker_" + getUniqueNumberString()));
+        //panel->setMaterialName("Orxonox/NavTDC");
+        health->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", object->getRadarObjectColour()));
+        health->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
+
 
         // Create arrow/marker
@@ -490,4 +601,6 @@
         text->setColour(object->getRadarObjectColour());
 
+        health->hide();
+        healthLevel->hide();
         panel->hide();
         target->hide();
@@ -495,7 +608,9 @@
 
         ObjectInfo tempStruct =
-        {   panel, target, text, false, false, false};
+        {   health, healthLevel, panel, target, text, false, false, false};
         this->activeObjectList_[object] = tempStruct;
 
+        this->background_->addChild(health);
+        this->background_->addChild(healthLevel);
         this->background_->addChild(panel);
         this->background_->addChild(target);
@@ -512,8 +627,12 @@
         {
             // Detach overlays
+            this->background_->removeChild(it->second.health_->getName());
+            this->background_->removeChild(it->second.healthLevel_->getName());
             this->background_->removeChild(it->second.panel_->getName());
             this->background_->removeChild(it->second.target_->getName());
             this->background_->removeChild(it->second.text_->getName());
             // Properly destroy the overlay elements (do not use delete!)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.health_);
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.healthLevel_);
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.panel_);
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.target_);
Index: code/branches/presentationHS14merge/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/branches/presentationHS14merge/src/modules/overlays/hud/HUDNavigation.h	(revision 10222)
+++ code/branches/presentationHS14merge/src/modules/overlays/hud/HUDNavigation.h	(revision 10242)
@@ -77,4 +77,9 @@
             struct ObjectInfo
             {
+
+
+
+                Ogre::PanelOverlayElement* health_;
+                Ogre::PanelOverlayElement* healthLevel_;
                 Ogre::PanelOverlayElement* panel_;
                 Ogre::PanelOverlayElement* target_;
@@ -88,4 +93,20 @@
 
             // XMLPort accessors
+            inline void setHealthMarkerSize(float size)
+                        {
+                            this->healthMarkerSize_ = size;
+                            this->sizeChanged();
+                        }
+            inline float getHealthMarkerSize() const
+                            { return healthMarkerSize_; }
+
+            inline void setHealthLevelMarkerSize(float size)
+                                    {
+                                        this->healthLevelMarkerSize_ = size;
+                                        this->sizeChanged();
+                                    }
+                        inline float getHealthLevelMarkerSize() const
+                                        { return healthLevelMarkerSize_; }
+
             inline void setNavMarkerSize(float size)
             {
@@ -100,4 +121,5 @@
                 this->sizeChanged();
             }
+
             inline float getAimMarkerSize() const
                 { return aimMarkerSize_; }
@@ -121,4 +143,6 @@
             std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
 
+            float healthMarkerSize_;
+            float healthLevelMarkerSize_;
             float navMarkerSize_;
             float aimMarkerSize_;
