- Timestamp:
- May 10, 2010, 2:21:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.cc
r6868 r6873 91 91 HUDNavigation::~HUDNavigation() 92 92 { 93 93 94 if (this->isInitialized()) 94 95 { 95 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navMarker_); 96 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navText_); 96 if(!activeObjectList_.empty()) 97 { 98 for(tempRadarViewable = activeObjectList_.begin(); tempRadarViewable!=activeObjectList_.end(); ++tempRadarViewable) 99 { 100 Ogre::OverlayManager::getSingleton().destroyOverlayElement(tempRadarViewable->second.first); 101 Ogre::OverlayManager::getSingleton().destroyOverlayElement(tempRadarViewable->second.second); 97 102 // Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->aimMarker_); 103 } 104 } 98 105 } 99 106 } … … 172 179 for(tempRadarViewable = activeObjectList_.begin(); tempRadarViewable!=activeObjectList_.end(); ++tempRadarViewable) 173 180 { 181 COUT(0) << "check 174" << std::endl; 174 182 175 183 //get Distance to HumanController and save it in the TextAreaOverlayElement. … … 178 186 float textLength = multi_cast<std::string>(dist).size() * tempRadarViewable->second.second->getCharHeight() * 0.3f; 179 187 188 COUT(0) << "check 181" << std::endl; 189 180 190 orxonox::Camera* cam = CameraManager::getInstance().getActiveCamera(); 181 191 if (!cam) … … 185 195 Vector3 pos = transform * tempRadarViewable->first->getRVWorldPosition(); 186 196 197 COUT(0) << "check 190" << std::endl; 198 187 199 bool outOfView; 188 200 if (pos.z > 1.0) … … 208 220 wasOutOfView_ = true; 209 221 } 222 223 COUT(0) << "check 174" << std::endl; 210 224 211 225 if (pos.x < pos.y) … … 232 246 else 233 247 { 248 COUT(0) << "check 241" << std::endl; 234 249 if (pos.y < -pos.x) 235 250 { … … 254 269 else 255 270 { 256 271 COUT(0) << "check 264" << std::endl; 257 272 258 273 // object is in view … … 300 315 void HUDNavigation::sizeChanged(){ 301 316 // use size to compensate for aspect ratio if enabled. 302 float xScale = this->getActualSize().x; 303 float yScale = this->getActualSize().y; 304 if (this->navMarker_) 305 navMarker_->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale); 306 // if (this->aimMarker_) 307 // aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale); 308 if (this->navText_) 309 navText_->setCharHeight(navText_->getCharHeight() * yScale); 317 float xScale = this->getActualSize().x; 318 float yScale = this->getActualSize().y; 319 320 if(!activeObjectList_.empty()) 321 { 322 for(tempRadarViewable = activeObjectList_.begin(); tempRadarViewable!=activeObjectList_.end(); ++tempRadarViewable) 323 { 324 325 if (tempRadarViewable->second.first) 326 tempRadarViewable->second.first->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale); 327 // if (this->aimMarker_) 328 // aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale); 329 if (tempRadarViewable->second.second) 330 tempRadarViewable->second.second->setCharHeight(tempRadarViewable->second.second->getCharHeight() * yScale); 331 } 332 } 310 333 } 311 334 … … 339 362 // background_->addChild(activeObjectList_[object].first); 340 363 // background_->addChild(activeObjectList_[object].second); 364 COUT(0) << "check 357" << std::endl; 341 365 } 342 366
Note: See TracChangeset
for help on using the changeset viewer.