[Orxonox-commit 4815] r9484 - code/branches/spaceNavigation/src/modules/overlays/hud

mottetb at orxonox.net mottetb at orxonox.net
Mon Dec 3 15:57:02 CET 2012


Author: mottetb
Date: 2012-12-03 15:57:02 +0100 (Mon, 03 Dec 2012)
New Revision: 9484

Modified:
   code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.cc
   code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.h
Log:
hallo

Modified: code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.cc	2012-12-03 14:51:35 UTC (rev 9483)
+++ code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.cc	2012-12-03 14:57:02 UTC (rev 9484)
@@ -215,38 +215,49 @@
                     textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f;
                 }
 
-
                 // Selected object
                 if(this->closestTarget_) {
                     // select the closest object as target
                     if(listIt == this->sortedObjectList_.begin())
                     {
                         it->second.selected_ = true;
-                    } else {
+                        orxout() << "Closest object selected" << std::endl;
+                    }
+                    else if(it->second.selected_)
+                    {
                         it->second.selected_ = false;
+                        orxout() << "Previous object unselected" << std::endl;
                     }
-                    closestTarget_ = false;
-                    orxout() << "Closest object selected" << std::endl;
+
                 }
+                // select the next closest object
                 else if(this->nextTarget_)
                 {
-                    // select the next closest object
                     if(nextHasToBeSelected){
                         it->second.selected_ = true;
                         nextHasToBeSelected = false;
-                        this->nextTarget_ = false;
+                        orxout() << "Next object selected" << std::endl;
                     }
                     else if(it->second.selected_)
                     {
                         nextHasToBeSelected = true;
                         it->second.selected_ = false;
+                        orxout() << "Previous object unselected" << std::endl;
+
+                        listIt++;
+
+                        if (markerCount + 1 >= this->markerLimit_ ||
+                                (listIt->second > this->detectionLimit_
+                                && detectionLimit_ >= 0))
+                        {
+                            this->activeObjectList_.find(this->sortedObjectList_.begin()->first)->second.selected_ = true;
+                            nextHasToBeSelected = false;
+                        }
+
+                        listIt--;
                     }
-                    else if(markerCount + 1 >= markerLimit_)
-                    {
-                        // this object is the last one that is marked, then select the closest
-                        this->activeObjectList_.find(this->sortedObjectList_.begin()->first)->second.selected_ = true;
-                        nextHasToBeSelected = false;
-                    }
+
+
                 }
 
 
@@ -397,6 +408,9 @@
                 it->second.target_->hide();
             }
         }
+
+        this->closestTarget_ = false;
+        this->nextTarget_ = false;
     }
 
     /** Overridden method of OrxonoxOverlay.

Modified: code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.h	2012-12-03 14:51:35 UTC (rev 9483)
+++ code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.h	2012-12-03 14:57:02 UTC (rev 9484)
@@ -129,8 +129,6 @@
             bool closestTarget_;
             bool nextTarget_;
 
-            static const float LIGHTNING_GUN_SPEED_ = 700.0f;
-            static const float HSW01_SPEED_ = 2500.0f;
             static HUDNavigation* localHUD_s; //!< This is used as a filter. Only the local HUD should be influenced by the static Console Command functions.
 
 




More information about the Orxonox-commit mailing list