Changeset 8993 for code/branches/presentation2011/src/modules/overlays/hud
- Timestamp:
- Dec 17, 2011, 12:35:33 AM (13 years ago)
- Location:
- code/branches/presentation2011/src/modules/overlays/hud
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.cc
r8988 r8993 76 76 77 77 // Set default values 78 setFont ( "Monofur" ); 79 setTextSize ( 0.05f ); 80 setNavMarkerSize ( 0.05f ); 78 this->setFont ( "Monofur" ); 79 this->setTextSize ( 0.05f ); 80 this->setNavMarkerSize ( 0.05f ); 81 this->setDetectionLimit( 10000.0f ); 81 82 } 82 83 … … 100 101 XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode ); 101 102 XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode ); 103 XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode ); 102 104 } 103 105 … … 175 177 176 178 unsigned int markerCount_ = 0; 179 bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player 177 180 178 181 // for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it) … … 180 183 { 181 184 ObjectMap::iterator it = activeObjectList_.find ( listIt->first ); 182 183 if ( markerCount_ < markerLimit_ ) 185 closeEnough_ = listIt->second < detectionLimit_ ; 186 // display radarviewables on HUD if the marker limit and max-distance is not exceeded 187 if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) ) 184 188 { 185 189 … … 307 311 it->second.text_->show(); 308 312 } 309 else 313 else // do not display on HUD 310 314 { 311 315 it->second.panel_->hide(); -
code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.h
r8988 r8993 85 85 // XMLPort accessors 86 86 void setNavMarkerSize ( float size ) 87 { navMarkerSize_ = size; this->sizeChanged(); }87 { navMarkerSize_ = size; this->sizeChanged(); } 88 88 float getNavMarkerSize() const 89 { return navMarkerSize_; } 90 89 { return navMarkerSize_; } 90 void setDetectionLimit( float limit ) 91 { this->detectionLimit_ = limit; } 92 float getDetectionLimit() const 93 { return this->detectionLimit_; } 91 94 92 95 void setTextSize ( float size ); … … 110 113 bool showDistance; 111 114 112 unsigned int markerLimit_; ;113 115 unsigned int markerLimit_; 116 float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value. 114 117 115 118 };
Note: See TracChangeset
for help on using the changeset viewer.