Changeset 1000 for code/branches/hud2/src/orxonox/hud/HUD.cc
- Timestamp:
- Apr 6, 2008, 6:06:32 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.