- Timestamp:
- Dec 16, 2008, 6:01:13 PM (16 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
-
code/branches/presentation/src/orxonox/overlays/hud/HUDSpeedBar.cc
r2087 r2485 31 31 #include "HUDSpeedBar.h" 32 32 #include "core/CoreIncludes.h" 33 #include "objects/worldentities/pawns/SpaceShip.h" 34 #include "objects/items/Engine.h" 33 35 34 36 namespace orxonox … … 41 43 RegisterObject(HUDSpeedBar); 42 44 45 this->owner_ = 0; 43 46 } 44 47 … … 49 52 void HUDSpeedBar::tick(float dt) 50 53 { 51 /* 52 SpaceShip* ship = SpaceShip::getLocalShip(); 53 if ( ship)54 SUPER(HUDSpeedBar, tick, dt); 55 56 if (this->owner_ && this->owner_->getEngine()) 54 57 { 55 float v = ship->getVelocity().length(); 56 float value = v / ship->getMaxSpeed(); 57 if (value != this->getValue()) 58 this->setValue(value); 58 float value = this->owner_->getVelocity().length() / (this->owner_->getEngine()->getMaxSpeedFront() * this->owner_->getEngine()->getSpeedFactor() * this->owner_->getEngine()->getBoostFactor()); 59 this->setValue(value); 59 60 } 60 */ 61 } 62 63 void HUDSpeedBar::changedOwner() 64 { 65 SUPER(HUDSpeedBar, changedOwner); 66 67 this->owner_ = dynamic_cast<SpaceShip*>(this->getOwner()); 61 68 } 62 69 }
Note: See TracChangeset
for help on using the changeset viewer.