Changeset 1392 for code/trunk/src/orxonox
- Timestamp:
- May 23, 2008, 4:38:02 PM (17 years ago)
- Location:
- code/trunk/src/orxonox/hud
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/hud/BarOverlayElement.cc
r1362 r1392 27 27 28 28 #include <OgreOverlayManager.h> 29 #include <OgreOverlayElement.h>30 #include <OgrePanelOverlayElement.h>31 29 #include "GraphicsEngine.h" 32 30 #include "BarOverlayElement.h" … … 36 34 using namespace Ogre; 37 35 38 BarOverlayElement::BarOverlayElement(const String& name): Ogre::PanelOverlayElement(name){36 BarOverlayElement::BarOverlayElement(const String& name):PanelOverlayElement(name){ 39 37 name_ = name; 40 38 } … … 42 40 BarOverlayElement::~BarOverlayElement(){} 43 41 44 void BarOverlayElement::init(Real leftRel, Real topRel, Real dimRel, O gre::OverlayContainer* container){42 void BarOverlayElement::init(Real leftRel, Real topRel, Real dimRel, OverlayContainer* container){ 45 43 // init some values... 46 44 container_ = container; 47 om = &O gre::OverlayManager::getSingleton();45 om = &OverlayManager::getSingleton(); 48 46 value_ = 0; 49 47 color_ = 2; … … 53 51 topRel_ = topRel; 54 52 dimRel_ = dimRel; 55 53 56 54 // create background... 57 55 background_ = static_cast<OverlayContainer*>(om->createOverlayElement("Panel", name_+"container")); 58 56 background_->show(); 59 57 container_->addChild(background_); 60 background_->setMetricsMode( Ogre::GMM_PIXELS);58 background_->setMetricsMode(GMM_PIXELS); 61 59 background_->setMaterialName("Orxonox/BarBackground"); 62 60 … … 65 63 66 64 show(); 67 setMetricsMode( Ogre::GMM_PIXELS);65 setMetricsMode(GMM_PIXELS); 68 66 setMaterialName("Orxonox/Green"); 69 67 background_->addChild(this); -
code/trunk/src/orxonox/hud/BarOverlayElement.h
r1362 r1392 30 30 #define _BAR_H__ 31 31 32 #include <OgreOverlayManager.h> 33 #include <OgreOverlayElement.h> 32 34 33 #include <OgrePanelOverlayElement.h> 35 36 34 #include <OgrePrerequisites.h> 37 35 #include "../OrxonoxPrereqs.h" 38 39 40 36 41 37 namespace orxonox -
code/trunk/src/orxonox/hud/HUD.cc
r1388 r1392 26 26 */ 27 27 28 28 #include <string.h> 29 29 #include "OrxonoxStableHeaders.h" 30 30 #include <OgreOverlay.h> 31 31 #include <OgreOverlayContainer.h> 32 32 #include <OgreOverlayManager.h> 33 #include <OgreSceneNode.h>34 #include <OgreEntity.h>35 33 #include <OgreStringConverter.h> 34 36 35 #include "core/Debug.h" 36 #include "core/ConsoleCommand.h" 37 37 #include "objects/SpaceShip.h" 38 #include "HUD.h"39 38 #include "BarOverlayElement.h" 40 39 #include "RadarOverlayElement.h" 41 40 #include "OverlayElementFactories.h" 41 #include "HUD.h" 42 42 43 43 namespace orxonox -
code/trunk/src/orxonox/hud/HUD.h
r1388 r1392 30 30 #define _HUD_H__ 31 31 32 #include <string.h> 33 #include <OgreOverlayElement.h> 32 #include <OgrePrerequisites.h> 34 33 #include <OgreTextAreaOverlayElement.h> 35 #include <OgrePrerequisites.h>36 37 34 #include "OrxonoxPrereqs.h" 38 35 #include "core/Tickable.h" -
code/trunk/src/orxonox/hud/RadarObject.cc
r1362 r1392 26 26 */ 27 27 28 #include <string.h> 29 #include <OgreOverlayManager.h> 30 #include <OgrePanelOverlayElement.h> 31 #include <OgreStringConverter.h> 32 #include <util/Math.h> 28 33 #include "RadarObject.h" 29 34 … … 34 39 int RadarObject::count = 0; // initialize static variable 35 40 36 RadarObject::RadarObject(O gre::OverlayContainer* container){41 RadarObject::RadarObject(OverlayContainer* container){ 37 42 container_ = container; 38 43 pos_ = Vector3(0.0, 0.0, 0.0); … … 40 45 } 41 46 42 RadarObject::RadarObject(O gre::OverlayContainer* container, Vector3 pos){47 RadarObject::RadarObject(OverlayContainer* container, Vector3 pos){ 43 48 container_ = container; 44 49 pos_ = pos; … … 50 55 void RadarObject::init(){ 51 56 next = NULL; 52 om = &O gre::OverlayManager::getSingleton();57 om = &OverlayManager::getSingleton(); 53 58 panel_ = static_cast<PanelOverlayElement*>(om->createOverlayElement("Panel", 54 "Object"+ Ogre::StringConverter::toString(count)));59 "Object"+StringConverter::toString(count))); 55 60 panel_->setMaterialName("Orxonox/RedDot"); 56 61 panel_->setDimensions(3,3); -
code/trunk/src/orxonox/hud/RadarObject.h
r1362 r1392 29 29 #define _RADAR2_H__ 30 30 31 #include <string.h>32 31 #include <OgrePrerequisites.h> 33 #include <OgreOverlayManager.h>34 #include <OgreOverlayElement.h>35 #include <OgrePanelOverlayElement.h>36 #include <OgreStringConverter.h>37 38 #include <util/Math.h>39 32 #include "../OrxonoxPrereqs.h" 40 33 -
code/trunk/src/orxonox/hud/RadarOverlayElement.cc
r1387 r1392 25 25 * 26 26 */ 27 27 #include <string.h> 28 29 30 #include <string.h> 31 #include <OgreOverlayManager.h> 32 #include <OgreStringConverter.h> 33 #include <OgrePanelOverlayElement.h> 34 35 #include "GraphicsEngine.h" 36 #include "core/Tickable.h" 37 #include "core/ConsoleCommand.h" 38 #include "objects/SpaceShip.h" 28 39 #include "RadarOverlayElement.h" 29 40 … … 33 44 using namespace Ogre; 34 45 35 RadarOverlayElement::RadarOverlayElement(const String& name): Ogre::PanelOverlayElement(name){46 RadarOverlayElement::RadarOverlayElement(const String& name):PanelOverlayElement(name){ 36 47 } 37 48 … … 39 50 } 40 51 41 void RadarOverlayElement::init(Real leftRel, Real topRel, Real dimRel, O gre::OverlayContainer* container){52 void RadarOverlayElement::init(Real leftRel, Real topRel, Real dimRel, OverlayContainer* container){ 42 53 // some initial data 43 om = &O gre::OverlayManager::getSingleton();54 om = &OverlayManager::getSingleton(); 44 55 dimRel_ = dimRel; 45 56 leftRel_ = leftRel; … … 52 63 // create nav marker ... 53 64 navMarker_ = static_cast<PanelOverlayElement*>(om->createOverlayElement("Panel", "NavMarker")); 54 navMarker_->setMetricsMode( Ogre::GMM_PIXELS);65 navMarker_->setMetricsMode(GMM_PIXELS); 55 66 navMarker_->setMaterialName("Orxonox/NavMarker"); 56 67 navMarker_->setDimensions(16,16); … … 67 78 plane = Plane(currentDir_, shipPos_); 68 79 69 setMetricsMode( Ogre::GMM_PIXELS);80 setMetricsMode(GMM_PIXELS); 70 81 setMaterialName("Orxonox/Radar"); 71 82 resize(); … … 189 200 float RadarOverlayElement::calcPhi(RadarObject* obj){ 190 201 // project difference vector on our plane... 191 Ogre::Vector3 proj = plane.projectVector(obj->pos_ - shipPos_);202 Vector3 proj = plane.projectVector(obj->pos_ - shipPos_); 192 203 // ...and find out the angle 193 204 return(acos((currentOrth_.dotProduct(proj))/ -
code/trunk/src/orxonox/hud/RadarOverlayElement.h
r1387 r1392 29 29 #define _RADAR_H__ 30 30 31 #include <string.h> 32 #include <OgreOverlayManager.h> 33 #include <OgreStringConverter.h> 34 #include <OgreOverlayElement.h> 35 #include <OgrePanelOverlayElement.h> 31 #include <util/Math.h> 36 32 #include <OgrePrerequisites.h> 37 38 #include <util/Math.h>39 #include <string.h>40 #include "core/Tickable.h"41 #include "core/ConsoleCommand.h"42 #include "objects/SpaceShip.h"43 33 #include "../OrxonoxPrereqs.h" 44 34 #include "RadarObject.h" 45 #include "GraphicsEngine.h"46 35 47 36 namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.