Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1330 for code


Ignore:
Timestamp:
May 19, 2008, 10:58:51 PM (16 years ago)
Author:
FelixSchulthess
Message:

removed old files

Location:
code/branches/hud3/src/orxonox/hud
Files:
4 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud3/src/orxonox/hud/HUD.cc

    r1329 r1330  
    4242namespace orxonox
    4343{
    44   using namespace Ogre;
     44    using namespace Ogre;
    4545
    46   HUD::HUD(int zoom){
    47     om = &Ogre::OverlayManager::getSingleton();
     46    HUD::HUD(int zoom){
     47        om = &Ogre::OverlayManager::getSingleton();
    4848
    49     BarOverlayElementFactory *barOverlayElementFactory = new BarOverlayElementFactory();
    50     om->addOverlayElementFactory(barOverlayElementFactory);
     49        BarOverlayElementFactory *barOverlayElementFactory = new BarOverlayElementFactory();
     50        om->addOverlayElementFactory(barOverlayElementFactory);
    5151
    52     RadarOverlayElementFactory *radarOverlayElementFactory = new RadarOverlayElementFactory();
    53     om->addOverlayElementFactory(radarOverlayElementFactory);
     52        RadarOverlayElementFactory *radarOverlayElementFactory = new RadarOverlayElementFactory();
     53        om->addOverlayElementFactory(radarOverlayElementFactory);
    5454
    55     orxonoxHUD = om->create("Orxonox/HUD");
     55        orxonoxHUD = om->create("Orxonox/HUD");
    5656
    57     container = static_cast<Ogre::OverlayContainer*>(om->createOverlayElement("Panel", "Orxonox/HUD/container"));
     57        container = static_cast<Ogre::OverlayContainer*>(om->createOverlayElement("Panel", "Orxonox/HUD/container"));
    5858
    59     energyCounter = static_cast<BarOverlayElement*>(om->createOverlayElement("Bar", "energyCounter"));
    60     energyCounter->show();
     59        energyCounter = static_cast<BarOverlayElement*>(om->createOverlayElement("Bar", "energyCounter"));
     60        energyCounter->show();
    6161
    62     speedo = static_cast<BarOverlayElement*>(om->createOverlayElement("Bar", "speedo"));
    63     speedo->show();
     62        speedo = static_cast<BarOverlayElement*>(om->createOverlayElement("Bar", "speedo"));
     63        speedo->show();
    6464
    65     radar = static_cast<RadarOverlayElement*>(om->createOverlayElement("Radar", "radar"));
    66     radar->show();
     65        radar = static_cast<RadarOverlayElement*>(om->createOverlayElement("Radar", "radar"));
     66        radar->show();
    6767
    68     container->show();
    69     orxonoxHUD->add2D(container);
    70     orxonoxHUD->show();
    71     container->setLeft(0.0);
    72     container->setTop(0.0);
    73     container->setWidth(1.0);
    74     container->setHeight(1.0);
    75     container->setMetricsMode(Ogre::GMM_RELATIVE);
     68        container->show();
     69        orxonoxHUD->add2D(container);
     70        orxonoxHUD->show();
     71        container->setLeft(0.0);
     72        container->setTop(0.0);
     73        container->setWidth(1.0);
     74        container->setHeight(1.0);
     75        container->setMetricsMode(Ogre::GMM_RELATIVE);
    7676
    77     energyCounter->init(0.01, 0.95, 0.4, 0.04, container);
    78     energyCounter->setValue(1);
     77        energyCounter->init(0.01, 0.95, 0.4, 0.04, container);
     78        energyCounter->setValue(1);
    7979
    80     speedo->init(0.01, 0.90, 0.4, 0.04, container);
     80        speedo->init(0.01, 0.90, 0.4, 0.04, container);
    8181
    82     radar->init(0.5, 0.9, 0.2, container);
    83   }
     82        radar->init(0.5, 0.9, 0.2, container);
     83    }
    8484
    85   void HUD::tick(float dt)
    86   {
    87       energyCounter->resize();
     85    void HUD::tick(float dt)
     86    {
     87        energyCounter->resize();
    8888
    89       float v = SpaceShip::instance_s->getVelocity().length();
    90       float vmax = SpaceShip::instance_s->getMaxSpeed();
    91       speedo->setValue(v/vmax);
    92       speedo->resize();
     89        float v = SpaceShip::instance_s->getVelocity().length();
     90        float vmax = SpaceShip::instance_s->getMaxSpeed();
     91        speedo->setValue(v/vmax);
     92        speedo->resize();
    9393
    94       radar->resize();
    95       radar->update();
    96   }
     94        radar->resize();
     95        radar->update();
     96    }
    9797
    98   HUD::~HUD(void){
    99   }
     98    HUD::~HUD(void){
     99    }
    100100}
    101101
Note: See TracChangeset for help on using the changeset viewer.