Changeset 7051 for code/branches
- Timestamp:
- May 31, 2010, 3:33:14 PM (14 years ago)
- Location:
- code/branches/presentation3/src/modules/overlays/hud
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.cc
r7050 r7051 47 47 #include "worldentities/WorldEntity.h" 48 48 #include "core/ConfigValueIncludes.h" 49 #include "tools/TextureGenerator.h" 49 50 // #include <boost/bind/bind_template.hpp> 50 51 … … 199 200 if ( !it->second.wasOutOfView_ ) 200 201 { 201 it->second.panel_->setMaterialName ( "Orxonox/NavArrows");202 it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "arrows.tga", it->first->getRadarObjectColour()) ); 202 203 it->second.wasOutOfView_ = true; 203 204 } … … 256 257 if ( it->second.wasOutOfView_ ) 257 258 { 258 it->second.panel_->setMaterialName ( "Orxonox/NavTDC" ); 259 //it->second.panel_->setMaterialName ( "Orxonox/NavTDC" ); 260 it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "tdc.tga", it->first->getRadarObjectColour()) ); 259 261 it->second.wasOutOfView_ = false; 260 262 } … … 306 308 void HUDNavigation::addObject ( RadarViewable* object ) 307 309 { 310 if( showObject(object)==false ) 311 return; 308 312 309 313 if ( activeObjectList_.size() >= markerLimit_ ) … … 311 315 return; 312 316 313 // Don't display our own ship314 if ( object == dynamic_cast<RadarViewable*> ( this->getOwner() ) )315 return;316 317 317 // Object hasn't been added yet (we know that) 318 318 assert ( this->activeObjectList_.find ( object ) == this->activeObjectList_.end() ); … … 327 327 Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*> ( Ogre::OverlayManager::getSingleton() 328 328 .createOverlayElement ( "Panel", "HUDNavigation_navMarker_" + getUniqueNumberString() ) ); 329 panel->setMaterialName ( "Orxonox/NavTDC" ); 329 // panel->setMaterialName ( "Orxonox/NavTDC" ); 330 panel->setMaterialName( TextureGenerator::getMaterialName( "tdc.tga", object->getRadarObjectColour()) ); 330 331 panel->setDimensions ( navMarkerSize_ * xScale, navMarkerSize_ * yScale ); 332 // panel->setColour( object->getRadarObjectColour() ); 331 333 332 334 Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*> ( Ogre::OverlayManager::getSingleton() … … 334 336 text->setFontName ( this->fontName_ ); 335 337 text->setCharHeight ( text->getCharHeight() * yScale ); 338 text->setColour( object->getRadarObjectColour() ); 336 339 337 340 panel->hide(); … … 351 354 void HUDNavigation::removeObject ( RadarViewable* viewable ) 352 355 { 353 if ( viewable == dynamic_cast<RadarViewable*> ( this->getOwner() ))356 if( showObject(viewable)==false ) 354 357 return; 355 358 … … 386 389 } 387 390 391 void HUDNavigation::objectChanged(RadarViewable* viewable) 392 { 393 // TODO: niceification neccessary ;) 394 removeObject(viewable); 395 addObject(viewable); 396 } 397 398 399 bool HUDNavigation::showObject(RadarViewable* rv) 400 { 401 if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) ) 402 return false; 403 assert( rv->getWorldEntity() ); 404 if ( rv->getWorldEntity()->isVisible()==false ) 405 return false; 406 return true; 407 } 408 388 409 void HUDNavigation::changedOwner() 389 410 { -
code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.h
r7050 r7051 56 56 virtual void addObject ( RadarViewable* object ); 57 57 virtual void removeObject ( RadarViewable* viewable ); 58 virtual void objectChanged ( RadarViewable* viewable ) {}58 virtual void objectChanged ( RadarViewable* viewable ); 59 59 60 60 virtual void changedOwner(); … … 76 76 77 77 }; 78 79 bool showObject( RadarViewable* rv ); 78 80 79 81 // XMLPort accessors
Note: See TracChangeset
for help on using the changeset viewer.