Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2008, 3:38:39 PM (16 years ago)
Author:
rgrieder
Message:
  • converted tabs to spaces in HUD
  • adjusted msvc project
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/hud/Navigation.cc

    r1406 r1410  
    2626*/
    2727
     28#include "OrxonoxStableHeaders.h"
     29#include "Navigation.h"
     30
    2831#include <OgreOverlayManager.h>
    29 #include <OgrePanelOverlayElement.h>
    30 #include <OgreTextAreaOverlayElement.h>
    3132#include <OgreStringConverter.h>
    32 #include <GraphicsEngine.h>
     33
     34#include "GraphicsEngine.h"
     35// TODO: remove the SpaceShip and CameraHandler dependencies
    3336#include "objects/SpaceShip.h"
    3437#include "objects/CameraHandler.h"
     38#include "RadarObject.h"
     39#include "RadarOverlayElement.h"
    3540#include "HUD.h"
    36 #include "Navigation.h"
    3741
    3842namespace orxonox
     
    5357
    5458    void Navigation::init(){
    55                 om = &OverlayManager::getSingleton();
    56                 navCam_ = NULL;
     59        om = &OverlayManager::getSingleton();
     60        navCam_ = NULL;
    5761        // create nav text
    5862        navText_ = static_cast<TextAreaOverlayElement*>(om->createOverlayElement("TextArea", "navText"));
     
    7377        navText_->hide();
    7478        container_->addChild(navMarker_);
    75         }
    76 
    77         void Navigation::update(){
     79    }
     80
     81    void Navigation::update(){
    7882        if(focus_ == NULL) return;
    7983        navCamPos_ = SpaceShip::getLocalShip()->getPosition();
    8084        currentDir_ = SpaceShip::getLocalShip()->getDir();
    81                 currentOrth_ = SpaceShip::getLocalShip()->getOrth();
     85        currentOrth_ = SpaceShip::getLocalShip()->getOrth();
    8286
    8387        windowW_ = GraphicsEngine::getSingleton().getWindowWidth();
     
    168172            navText_->setPosition(xPos+navMarker_->getWidth()/2, yPos+navMarker_->getHeight()/2);
    169173        }
    170         }
     174    }
    171175
    172176    void Navigation::cycleFocus(){
    173             if(focus_ == NULL){
     177        if(focus_ == NULL){
    174178            focus_ = HUD::getSingleton().getFirstRadarObject();
    175             }
     179        }
    176180        else{
    177181            focus_->panel_->setMaterialName("Orxonox/RedDot");
     
    188192            focus_->panel_->setMaterialName("Orxonox/WhiteDot");
    189193        }
    190         }
    191 
    192         float Navigation::getDist2Focus(){
    193             if(focus_ == NULL) return(0.0);
    194             return((focus_->pos_-SpaceShip::getLocalShip()->getPosition()).length());
    195         }
     194    }
     195
     196    float Navigation::getDist2Focus(){
     197        if(focus_ == NULL) return(0.0);
     198        return((focus_->pos_-SpaceShip::getLocalShip()->getPosition()).length());
     199    }
    196200}
Note: See TracChangeset for help on using the changeset viewer.