Changeset 6898
- Timestamp:
- May 13, 2010, 12:02:14 PM (15 years ago)
- Location:
- code/branches/hudelements/src/modules/overlays/hud
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.cc
r6897 r6898 61 61 setNavMarkerSize(0.05f); 62 62 63 respawnObjectSet_ = this->getOwner()->getScene()->getRadar()->getRadarObjects(); 64 65 for (respawnObjectSetIt_ = respawnObjectSet_.begin(); respawnObjectSetIt_ != respawnObjectSet_.end(); 66 ++respawnObjectSetIt_) 67 { 68 if (!(*respawnObjectSetIt_)->isHumanShip_) addObject(*respawnObjectSetIt_); 69 } 63 70 64 71 65 // // create nav text … … 182 176 for (tempRadarViewable = activeObjectList_.begin(); tempRadarViewable!=activeObjectList_.end(); ++tempRadarViewable) 183 177 { 184 COUT(0) << "check 174" << std::endl; 178 185 179 186 180 //get Distance to HumanController and save it in the TextAreaOverlayElement. … … 189 183 float textLength = multi_cast<std::string>(dist).size() * tempRadarViewable->second.second->getCharHeight() * 0.3f; 190 184 191 COUT(0) << "check 181" << std::endl; 185 192 186 193 187 orxonox::Camera* cam = CameraManager::getInstance().getActiveCamera(); … … 198 192 Vector3 pos = transform * tempRadarViewable->first->getRVWorldPosition(); 199 193 200 COUT(0) << "check 190" << std::endl; 194 201 195 202 196 bool outOfView; … … 224 218 } 225 219 226 COUT(0) << "check 174" << std::endl; 220 227 221 228 222 if (pos.x < pos.y) … … 272 266 else 273 267 { 274 COUT(0) << "check 264" << std::endl; 268 275 269 276 270 // object is in view … … 299 293 } 300 294 301 302 295 tempRadarViewable->second.first->show(); 296 tempRadarViewable->second.second->show(); 303 297 } 304 298 … … 308 302 309 303 310 float HUDNavigation::getDist2Focus() const {311 312 Radar* radar = this->getOwner()->getScene()->getRadar();313 if (radar->getFocus() && HumanController::getLocalControllerEntityAsPawn())314 return (radar->getFocus()->getRVWorldPosition() - HumanController::getLocalControllerEntityAsPawn()->getWorldPosition()).length();315 else316 return 0;317 }304 // float HUDNavigation::getDist2Focus() const { 305 // 306 // Radar* radar = this->getOwner()->getScene()->getRadar(); 307 // if (radar->getFocus() && HumanController::getLocalControllerEntityAsPawn()) 308 // return (radar->getFocus()->getRVWorldPosition() - HumanController::getLocalControllerEntityAsPawn()->getWorldPosition()).length(); 309 // else 310 // return 0; 311 // } 318 312 319 313 /** … … 361 355 Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton() 362 356 .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString())); 363 357 358 364 359 float xScale = this->getActualSize().x; 365 360 float yScale = this->getActualSize().y; … … 375 370 // background_->addChild(activeObjectList_[object].first); 376 371 // background_->addChild(activeObjectList_[object].second); 377 COUT(0) << "check 357" << std::endl; 372 378 373 } 379 374 … … 392 387 } 393 388 394 // void HUDRadar::changedOwner() { 395 // SUPER(HUDRadar, changedOwner); 396 // 397 // this->owner_ = orxonox_cast<Pawn*>(this->getOwner()); 398 // assert(this->radarObjects_.size()==0); 399 // this->gatherObjects(); 400 // } 389 void HUDNavigation::changedOwner() { 390 391 392 393 respawnObjectSet_ = this->getOwner()->getScene()->getRadar()->getRadarObjects(); 394 respawnObjectSetType::iterator respawnObjectSetIt_; 395 for (respawnObjectSetIt_ = respawnObjectSet_.begin(); respawnObjectSetIt_ != respawnObjectSet_.end(); 396 ++respawnObjectSetIt_) 397 { 398 if (!(*respawnObjectSetIt_)->isHumanShip_) HUDNavigation::addObject(*respawnObjectSetIt_); 399 } 400 401 } 402 403 401 404 402 405 // void updateActiveObjectList(map activeObjectList_){} -
code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.h
r6897 r6898 58 58 inline float getRadarSensitivity() const {return 1.0f;} 59 59 inline void radarTick(float dt) {} 60 //virtual void changedOwner();60 virtual void changedOwner(); 61 61 62 62 … … 95 95 void updateMarker(); 96 96 void updateFocus(); 97 float getDist2Focus() const;97 // float getDist2Focus() const; 98 98 void getSingleton(); 99 99 … … 113 113 activeObjectListType activeObjectList_; 114 114 activeObjectListType::iterator tempRadarViewable; 115 115 116 116 typedef std::set<RadarViewable*> respawnObjectSetType; 117 117 respawnObjectSetType respawnObjectSet_; 118 respawnObjectSetType::iterator respawnObjectSetIt_; 118 119 119 120 120 121 std::string fontName_;
Note: See TracChangeset
for help on using the changeset viewer.