Index: code/branches/hud3/src/orxonox/hud/HUD.cc
===================================================================
--- code/branches/hud3/src/orxonox/hud/HUD.cc	(revision 1315)
+++ code/branches/hud3/src/orxonox/hud/HUD.cc	(revision 1328)
@@ -22,5 +22,5 @@
 *      Yuning Chai
 *   Co-authors:
-*      ...
+*      Felix Schulthess
 *
 */
@@ -39,7 +39,4 @@
 #include "RadarOverlayElement.h"
 #include "OverlayElementFactories.h"
-// ugly hack
-#include "Orxonox.h"
-
 
 namespace orxonox
@@ -53,7 +50,4 @@
     om->addOverlayElementFactory(barOverlayElementFactory);
 
-    SmartBarOverlayElementFactory *smartBarOverlayElementFactory = new SmartBarOverlayElementFactory();
-    om->addOverlayElementFactory(smartBarOverlayElementFactory);
-
     RadarOverlayElementFactory *radarOverlayElementFactory = new RadarOverlayElementFactory();
     om->addOverlayElementFactory(radarOverlayElementFactory);
@@ -63,8 +57,8 @@
     container = static_cast<Ogre::OverlayContainer*>(om->createOverlayElement("Panel", "Orxonox/HUD/container"));
 
-    energyCounter = static_cast<SmartBarOverlayElement*>(om->createOverlayElement("SmartBar", "energyCounter"));
+    energyCounter = static_cast<BarOverlayElement*>(om->createOverlayElement("Bar", "energyCounter"));
     energyCounter->show();
 
-    speedo = static_cast<SmartBarOverlayElement*>(om->createOverlayElement("SmartBar", "speedo"));
+    speedo = static_cast<BarOverlayElement*>(om->createOverlayElement("Bar", "speedo"));
     speedo->show();
 
@@ -72,67 +66,10 @@
     radar->show();
 
-
-/*    TextAreaOverlayElement* test = static_cast<TextAreaOverlayElement*>(overlayManager.createOverlayElement("TextArea", "test"));
-
-    int dirX, dirY, dirZ;      //flying direction
-    int ortX, ortY, ortZ;      //orthogonal direction
-    int dX, dY, dZ;            //distance between main ship and the object
-    int vecX, vecY, vecZ;      //vector product dir X ort
-    double alpha;              //defines the radius in the radar
-    double beta;               //defines the angle in the radar
-    bool right;                //checks whether the object is on the right side (since cos is not bijective)
-
-    dirX = 1;
-    dirY = 0;
-    dirZ = 0;
-
-    ortX = 0;
-    ortY = 0;
-    ortZ = 1;
-
-    dX = -2;
-    dY = 2;
-    dZ = 0;
-
-    alpha = acos((dirX*dX+dirY*dY+dirZ*dZ)/(sqrt(pow(dX,2)+pow(dY,2)+pow(dZ,2))*sqrt(pow(dirX,2)+pow(dirY,2)+pow(dirZ,2))));
-    beta = acos((ortX*dX+ortY*dY+ortZ*dZ)/(sqrt(pow(dX,2)+pow(dY,2)+pow(dZ,2))*sqrt(pow(ortX,2)+pow(ortY,2)+pow(ortZ,2))));
-    vecX = dirY*ortZ - dirZ*ortY;
-    vecY = dirZ*ortX - dirX*ortZ;
-    vecZ = dirX*ortY - dirY*ortX;
-
-    if((vecX*dX+vecY*dY+vecZ*dZ)>0){right=true;}
-    else right=false;
-
-    test->setCaption("hell");
-    test->setPosition(10,10);
-    test->setDimensions(20,20);
-    test->show();
-    test->setMetricsMode(Ogre::GMM_PIXELS);
-    container->addChild(test);
-
-    COUT(0)<<alpha<<" "<<beta<<" "<<right<<std::endl;
-*/
-
     container->addChild(energyCounter);
     container->addChild(speedo);
     container->addChild(radar);
     container->show();
-
     orxonoxHUD->add2D(container);
     orxonoxHUD->show();
-
-
-
-    // important: don't use SceneManager to create the node! but register the creator scene manager.
-/*    ogreNode_ = new Ogre::SceneNode(Orxonox::getSingleton()->getSceneManager(), "hudNoedely");
-
-    ogreNode_->setPosition(80,-60,-200);
-    ogreNode_->setScale(0.4,0.4,0.4);
-    // ugly hack, but I haven't figured out yet how we could change this, since we really need the
-    // scene manager..
-    ogreNode_->attachObject(Orxonox::getSingleton()->getSceneManager()->createEntity("head", "ogrehead.mesh"));
-//    orxonoxOverlay->add3D(ogreNode_);
-*/
-
     container->setLeft(0.0);
     container->setTop(0.0);
@@ -141,13 +78,10 @@
     container->setMetricsMode(Ogre::GMM_RELATIVE);
 
-    energyCounter->initSmartBarOverlayElement(0.01, 0.01, 0.2, 0.02, BarOverlayElement::LEFT);
-    energyCounter->reset(100);
+    energyCounter->init(0.01, 0.01, 0.2, 0.02, container);
+    energyCounter->setValue(1);
 
-    speedo->initSmartBarOverlayElement(0.01, 0.04, 0.2, 0.02, BarOverlayElement::LEFT);
-    speedo->reset(80);
+    speedo->init(0.01, 0.04, 0.2, 0.02, container);
 
-    radar->initRadarOverlayElement(0.5, 0.9, 0.2, container);
-
-
+    radar->init(0.5, 0.9, 0.2, container);
   }
 
@@ -156,16 +90,10 @@
       float v = SpaceShip::instance_s->getVelocity().length();
       float vmax = SpaceShip::instance_s->getMaxSpeed();
-      speedo->reset(100*v/vmax);
+      speedo->setValue(v/vmax);
       radar->update();
-    /*if (this->ogreNode_)
-    {
-      this->ogreNode_->roll(Ogre::Degree(dt*200),Ogre::Node::TS_LOCAL);
-      this->ogreNode_->yaw(Ogre::Degree(dt*200),Ogre::Node::TS_LOCAL);
-      this->ogreNode_->pitch(Ogre::Degree(dt*200),Ogre::Node::TS_LOCAL);
-    }*/
   }
 
-  HUD::~HUD(void){}
-
+  HUD::~HUD(void){
+  }
 }
 
