Changeset 1000 for code/branches/hud2/src/orxonox
- Timestamp:
- Apr 6, 2008, 6:06:32 PM (17 years ago)
- Location:
- code/branches/hud2/src/orxonox/hud
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud2/src/orxonox/hud/Bar.cc
r991 r1000 25 25 * 26 26 */ 27 28 #include "OrxonoxStableHeaders.h" 27 29 28 30 #include <OgreOverlayManager.h> … … 94 96 95 97 SmartBar::SmartBar(Ogre::Real left, Ogre::Real top, Ogre::Real width, Ogre::Real height, 96 int dir, std::string name) : Bar ::Bar(left, top, width, height, dir, Bar::YELLOW, name){98 int dir, std::string name) : Bar(left, top, width, height, dir, Bar::YELLOW, name){ 97 99 } 98 100 -
code/branches/hud2/src/orxonox/hud/HUD.cc
r991 r1000 31 31 #include <OgreOverlayContainer.h> 32 32 #include <OgreOverlayManager.h> 33 #include <OgreSceneNode.h> 33 34 34 35 #include "HUD.h" 35 36 #include "Bar.h" 37 #include "TestElement.h" 38 // ugly hack 39 #include "Orxonox.h" 36 40 37 41 … … 60 64 energyCounterPanel->addChild(energyCounter->element); 61 65 66 TestOverlayElementFactory *factory = new TestOverlayElementFactory(); 67 overlayManager.addOverlayElementFactory(factory); 68 Ogre::OverlayElement* testElement = overlayManager.createOverlayElementFromFactory("Test", "testElement"); 69 62 70 Ogre::Overlay* orxonoxOverlay = overlayManager.create("Orxonox/HUD"); 63 71 orxonoxOverlay->add2D(energyCounterPanel); 72 73 // important: don't use SceneManager to create the node! but register the creator scene manager. 74 ogreNode_ = new Ogre::SceneNode(Orxonox::getSingleton()->getSceneManager(), "hudNoedely"); 75 76 ogreNode_->setPosition(80,-60,-200); 77 ogreNode_->setScale(0.4,0.4,0.4); 78 // ugly hack, but I haven't figured out yet how we could change this, since we really need the 79 // scene manager.. 80 ogreNode_->attachObject(Orxonox::getSingleton()->getSceneManager()->createEntity("head", "ogrehead.mesh")); 81 orxonoxOverlay->add3D(ogreNode_); 82 64 83 orxonoxOverlay->show(); 84 } 85 86 void HUD::tick(float dt) 87 { 88 if (this->ogreNode_) 89 { 90 this->ogreNode_->roll(Ogre::Degree(dt*200),Ogre::Node::TS_LOCAL); 91 this->ogreNode_->yaw(Ogre::Degree(dt*200),Ogre::Node::TS_LOCAL); 92 this->ogreNode_->pitch(Ogre::Degree(dt*200),Ogre::Node::TS_LOCAL); 93 } 65 94 } 66 95 -
code/branches/hud2/src/orxonox/hud/HUD.h
r991 r1000 34 34 #include <OgreTextAreaOverlayElement.h> 35 35 #include <OgrePrerequisites.h> 36 #include "../OrxonoxPrereqs.h"37 36 37 #include "OrxonoxPrereqs.h" 38 39 #include "core/Tickable.h" 38 40 #include "Bar.h" 39 41 … … 41 43 namespace orxonox 42 44 { 43 class _OrxonoxExport HUD 45 class _OrxonoxExport HUD : Tickable 44 46 { 45 47 private: … … 49 51 ~HUD(); 50 52 53 virtual void tick(float); 54 51 55 Bar* energyCounter; 56 Ogre::SceneNode* ogreNode_; 52 57 }; 53 58 }
Note: See TracChangeset
for help on using the changeset viewer.