Changeset 7163 for code/trunk/src/modules/overlays/hud/HUDNavigation.h
- Timestamp:
- Aug 11, 2010, 8:55:13 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/overlays/hud/HUDNavigation.h
r6417 r7163 32 32 #include "overlays/OverlaysPrereqs.h" 33 33 34 #include <map> 35 #include <string> 36 37 34 38 #include "util/OgreForwardRefs.h" 35 39 #include "tools/interfaces/Tickable.h" 40 #include "interfaces/RadarListener.h" 36 41 #include "overlays/OrxonoxOverlay.h" 37 42 38 43 namespace orxonox 39 44 { 40 class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable 45 class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener 46 { 47 public: 48 HUDNavigation ( BaseObject* creator ); 49 virtual ~HUDNavigation(); 50 51 void setConfigValues(); 52 53 virtual void XMLPort ( Element& xmlElement, XMLPort::Mode mode ); 54 virtual void tick ( float dt ); 55 56 virtual void addObject ( RadarViewable* object ); 57 virtual void removeObject ( RadarViewable* viewable ); 58 virtual void objectChanged ( RadarViewable* viewable ); 59 60 virtual void changedOwner(); 61 virtual void sizeChanged(); 62 virtual void angleChanged() { } 63 virtual void positionChanged() { } 64 virtual void radarTick ( float dt ) {} 65 66 inline float getRadarSensitivity() const 67 { return 1.0f; } 68 69 private: 70 struct ObjectInfo 41 71 { 42 public: 43 HUDNavigation(BaseObject* creator); 44 virtual ~HUDNavigation(); 72 Ogre::PanelOverlayElement* panel_; 73 Ogre::TextAreaOverlayElement* text_; 74 bool outOfView_; 75 bool wasOutOfView_; 45 76 46 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); 47 virtual void tick(float dt); 77 }; 48 78 49 private: 50 void sizeChanged(); 51 void angleChanged() { } 52 void positionChanged() { } 79 bool showObject( RadarViewable* rv ); 53 80 54 // XMLPort accessors 55 void setNavMarkerSize(float size) { this->navMarkerSize_ = size; this->sizeChanged(); } 56 float getNavMarkerSize() const { return this->navMarkerSize_; } 81 // XMLPort accessors 82 void setNavMarkerSize ( float size ) 83 { navMarkerSize_ = size; this->sizeChanged(); } 84 float getNavMarkerSize() const 85 { return navMarkerSize_; } 57 86 58 /* 59 void setAimMarkerSize(float size) { this->aimMarkerSize_ = size; this->sizeChanged(); } 60 float getAimMarkerSize() const { return this->aimMarkerSize_; } 61 */ 87 void setTextSize ( float size ); 88 float getTextSize() const; 62 89 63 void setTextSize(float size);64 float getTextSize() const;90 void setFont ( const std::string& font ); 91 const std::string& getFont() const; 65 92 66 void setFont(const std::string& font);67 const std::string& getFont() const;93 typedef std::map<RadarViewable*, ObjectInfo > ObjectMap; 94 ObjectMap activeObjectList_; 68 95 69 void updateMarker(); 70 void updateFocus(); 71 float getDist2Focus() const; 96 typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList; 97 sortedList sortedObjectList_; 72 98 73 Ogre::PanelOverlayElement* navMarker_; //!< the panel used to show the arrow and the target marker 74 float navMarkerSize_; //!< One paramter size of the navigation marker75 /* 76 Ogre::PanelOverlayElement* aimMarker_; //!< Panel used to show the aim Marker77 float aimMarkerSize_; //!< One paramter size of the aim marker 78 */ 79 Ogre::TextAreaOverlayElement* navText_; //!< Text overlay to display the target distance 80 bool wasOutOfView_; //!< Performance booster variable: setMaterial is not cheap 81 99 100 float navMarkerSize_; 101 std::string fontName_; 102 float textSize_; 103 104 unsigned int markerLimit_;; //TODO: is it possible to set this over the console and/or the IG-Setting 105 106 107 }; 82 108 } 83 109
Note: See TracChangeset
for help on using the changeset viewer.