Changeset 1410 for code/branches/network/src/orxonox/hud/Navigation.cc
- Timestamp:
- May 24, 2008, 3:38:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/hud/Navigation.cc
r1406 r1410 26 26 */ 27 27 28 #include "OrxonoxStableHeaders.h" 29 #include "Navigation.h" 30 28 31 #include <OgreOverlayManager.h> 29 #include <OgrePanelOverlayElement.h>30 #include <OgreTextAreaOverlayElement.h>31 32 #include <OgreStringConverter.h> 32 #include <GraphicsEngine.h> 33 34 #include "GraphicsEngine.h" 35 // TODO: remove the SpaceShip and CameraHandler dependencies 33 36 #include "objects/SpaceShip.h" 34 37 #include "objects/CameraHandler.h" 38 #include "RadarObject.h" 39 #include "RadarOverlayElement.h" 35 40 #include "HUD.h" 36 #include "Navigation.h"37 41 38 42 namespace orxonox … … 53 57 54 58 void Navigation::init(){ 55 56 59 om = &OverlayManager::getSingleton(); 60 navCam_ = NULL; 57 61 // create nav text 58 62 navText_ = static_cast<TextAreaOverlayElement*>(om->createOverlayElement("TextArea", "navText")); … … 73 77 navText_->hide(); 74 78 container_->addChild(navMarker_); 75 76 77 79 } 80 81 void Navigation::update(){ 78 82 if(focus_ == NULL) return; 79 83 navCamPos_ = SpaceShip::getLocalShip()->getPosition(); 80 84 currentDir_ = SpaceShip::getLocalShip()->getDir(); 81 85 currentOrth_ = SpaceShip::getLocalShip()->getOrth(); 82 86 83 87 windowW_ = GraphicsEngine::getSingleton().getWindowWidth(); … … 168 172 navText_->setPosition(xPos+navMarker_->getWidth()/2, yPos+navMarker_->getHeight()/2); 169 173 } 170 174 } 171 175 172 176 void Navigation::cycleFocus(){ 173 177 if(focus_ == NULL){ 174 178 focus_ = HUD::getSingleton().getFirstRadarObject(); 175 179 } 176 180 else{ 177 181 focus_->panel_->setMaterialName("Orxonox/RedDot"); … … 188 192 focus_->panel_->setMaterialName("Orxonox/WhiteDot"); 189 193 } 190 191 192 193 194 195 194 } 195 196 float Navigation::getDist2Focus(){ 197 if(focus_ == NULL) return(0.0); 198 return((focus_->pos_-SpaceShip::getLocalShip()->getPosition()).length()); 199 } 196 200 }
Note: See TracChangeset
for help on using the changeset viewer.