Changeset 10122 for code/branches/hudHS14/src/modules/overlays/hud
- Timestamp:
- Nov 12, 2014, 4:08:14 PM (10 years ago)
- Location:
- code/branches/hudHS14/src/modules/overlays/hud
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.cc
r10110 r10122 82 82 this->setNavMarkerSize(0.03f); 83 83 this->setAimMarkerSize(0.02f); 84 this->setHealthMarkerSize(0.08f); 84 85 85 86 this->setDetectionLimit(10000.0f); … … 116 117 XMLPortParam(HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode); 117 118 XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlelement, mode); 119 XMLPortParam(HUDNavigation, "healthMarkerSize", setHealthMarkerSize, getHealthMarkerSize, xmlelement, mode); 120 118 121 } 119 122 … … 206 209 for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt) 207 210 { 211 208 212 std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.find(listIt->first); 209 213 closeEnough = listIt->second < this->detectionLimit_; … … 273 277 } 274 278 } 279 280 275 281 276 282 … … 358 364 // Object is in view 359 365 360 // Change material only if outOfView changed 366 367 368 369 370 371 // Change material only if outOfView changed 361 372 if (it->second.wasOutOfView_) 362 373 { … … 367 378 368 379 //manipulation bzw versuch !!! Jonas 369 it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2b.png", it->first->getRadarObjectColour())); 380 it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2.png", it->first->getRadarObjectColour())); 381 it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x, this->healthMarkerSize_ * this->getActualSize().y); 370 382 371 383 it->second.wasOutOfView_ = false; 372 384 } 373 385 386 387 //i need to find the place where the amount of health is saved!!! 388 //this->selectedTarget_->getWorldEntity()-> 389 390 374 391 // Position health (versuch !!!!) 392 it->second.health_->setUV(0.0f, 0.0f, 1.0f, 1.0f); 375 393 it->second.health_->setLeft((pos.x + 1.0f - it->second.panel_->getWidth()) * 0.5f); 376 394 it->second.health_->setTop((-pos.y + 1.0f - it->second.panel_->getHeight()) * 0.5f); … … 431 449 432 450 { 433 it->second.health_->hide() 451 it->second.health_->hide(); 434 452 it->second.panel_->hide(); 435 453 it->second.text_->hide(); … … 487 505 .createOverlayElement("Panel", "HUDNavigation_healthMarker_" + getUniqueNumberString())); 488 506 //panel->setMaterialName("Orxonox/NavTDC"); 489 health->setMaterialName(TextureGenerator::getMaterialName("bar2 b.png", object->getRadarObjectColour()));507 health->setMaterialName(TextureGenerator::getMaterialName("bar2.png", object->getRadarObjectColour())); 490 508 health->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale); 491 509 //panel->setColour(object->getRadarObjectColour()); … … 519 537 520 538 ObjectInfo tempStruct = 521 { health, panel, target, text, false, false, false , false};539 { health, panel, target, text, false, false, false}; 522 540 this->activeObjectList_[object] = tempStruct; 523 541 -
code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.h
r10110 r10122 78 78 { 79 79 80 //manipulation bzw versuch !!! Jonas80 //manipulation bzw versuch !!! health additional 81 81 Ogre::PanelOverlayElement* health_; 82 83 82 Ogre::PanelOverlayElement* panel_; 84 83 Ogre::PanelOverlayElement* target_; … … 92 91 93 92 // XMLPort accessors 93 inline void setHealthMarkerSize(float size) 94 { 95 this->healthMarkerSize_ = size; 96 this->sizeChanged(); 97 } 98 inline float getHealthMarkerSize() const 99 { return healthMarkerSize_; } 100 94 101 inline void setNavMarkerSize(float size) 95 102 { … … 104 111 this->sizeChanged(); 105 112 } 113 106 114 inline float getAimMarkerSize() const 107 115 { return aimMarkerSize_; } … … 125 133 std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_; 126 134 135 float healthMarkerSize_; 127 136 float navMarkerSize_; 128 137 float aimMarkerSize_;
Note: See TracChangeset
for help on using the changeset viewer.