- Timestamp:
- May 22, 2008, 1:05:53 PM (16 years ago)
- Location:
- code/branches/hud3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud3/bin/levels/sample.oxw
r1352 r1356 14 14 <Skybox src="Orxonox/StarSkyBox" /> 15 15 <SpaceShip camera="true" position="0,0,0" scale="10" yawpitchroll="0,0,0" mesh="assff.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" /> 16 <Model position="1500,0, 0" scale="10" mesh="tomato.mesh" yawpitchroll="-40,30,0" rotationAxis="1,0,0" rotationRate="-30"/>16 <Model position="1500,0,100" scale="10" mesh="tomato.mesh" yawpitchroll="-40,30,0" rotationAxis="1,0,0" rotationRate="-30"/> 17 17 <Model position="0,4200,0" scale="10" mesh="tomato.mesh" yawpitchroll="-50,60,0" rotationAxis="1,0,0" rotationRate="-30"/> 18 18 <Model position="0,0,6800" scale="10" mesh="tomato.mesh" yawpitchroll="-50,-30,0" rotationAxis="1,0,0" rotationRate="-30"/> -
code/branches/hud3/src/orxonox/hud/HUD.cc
r1352 r1356 33 33 #include <OgreSceneNode.h> 34 34 #include <OgreEntity.h> 35 #include <OgreStringConverter.h> 35 36 #include "core/Debug.h" 36 37 #include "objects/SpaceShip.h" … … 55 56 orxonoxHUD = om->create("Orxonox/HUD"); 56 57 container = static_cast<Ogre::OverlayContainer*>(om->createOverlayElement("Panel", "Orxonox/HUD/container")); 58 // test 59 test = static_cast<TextAreaOverlayElement*>(om->createOverlayElement("TextArea", "test123")); 60 test->show(); 61 test->setMetricsMode(Ogre::GMM_RELATIVE); 62 test->setDimensions(0.8, 0.8); 63 test->setPosition(0.02, 0.02); 64 test->setFontName("Console"); 65 test->setCaption("init"); 66 57 67 // create energy bar 58 68 energyBar = static_cast<BarOverlayElement*>(om->createOverlayElement("Bar", "energyBar")); … … 75 85 container->setHeight(1.0); 76 86 container->setMetricsMode(Ogre::GMM_RELATIVE); 87 container->addChild(test); 77 88 energyBar->init(0.01, 0.94, 0.4, container); 78 89 energyBar->setValue(1); 79 90 speedoBar->init(0.01, 0.90, 0.4, container); 80 91 radar->init(0.5, 0.9, 0.2, container); 81 radar->addObject(Vector3(1500.0, 0.0, 0.0));92 radar->addObject(Vector3(1500.0, 0.0, 100.0)); 82 93 radar->addObject(Vector3(0.0, 4000.0, 0.0)); 83 94 radar->addObject(Vector3(0.0, 0.0, 6800.0)); 84 95 RadarOverlayElement::cycleFocus(); 85 96 } … … 87 98 void HUD::tick(float dt) 88 99 { 100 int d = radar->getDist2Focus()/10; 101 test->setCaption("Distance: " + Ogre::StringConverter::toString(d)); 102 89 103 energyBar->resize(); 90 104 -
code/branches/hud3/src/orxonox/hud/HUD.h
r1335 r1356 32 32 #include <string.h> 33 33 #include <OgreOverlayElement.h> 34 #include <OgreTextAreaOverlayElement.h> 34 35 #include <OgrePrerequisites.h> 35 36 … … 48 49 Ogre::Overlay* orxonoxHUD; 49 50 Ogre::OverlayContainer* container; 51 Ogre::TextAreaOverlayElement* test; 50 52 BarOverlayElement* energyBar; 51 53 BarOverlayElement* speedoBar; -
code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc
r1354 r1356 181 181 } 182 182 183 float RadarOverlayElement::getDist2Focus(){ 184 return((focus_->pos_-shipPos_).length()); 185 } 186 183 187 float RadarOverlayElement::calcRadius(RadarObject* obj){ 184 188 return(acos((currentDir_.dotProduct(obj->pos_ - shipPos_))/ -
code/branches/hud3/src/orxonox/hud/RadarOverlayElement.h
r1353 r1356 72 72 void addObject(Vector3 pos); 73 73 void listObjects(); 74 float getDist2Focus(); 74 75 float calcRadius(RadarObject* obj); 75 76 float calcPhi(RadarObject* obj);
Note: See TracChangeset
for help on using the changeset viewer.