Orxonox  0.0.5 Codename: Arcturus
HUDRadar.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Yuning Chai
24  * Felix Schulthess
25  * Co-authors:
26  * Reto Grieder
27  *
28  */
29 
30 #ifndef _HUDRadar_H__
31 #define _HUDRadar_H__
32 
34 
35 #include <map>
36 #include <vector>
37 #include <string>
38 
39 #include "util/OgreForwardRefs.h"
43 
44 namespace orxonox
45 {
47  {
48  public:
49  HUDRadar(Context* context);
50  virtual ~HUDRadar();
51 
52  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
53  virtual void changedOwner() override;
54  void setConfigValues();
55 
56  private:
57  // XML accessors
58  float getHalfDotSizeDistance() const { return this->halfDotSizeDistance_; }
59  void setHalfDotSizeDistance(float distance) { this->halfDotSizeDistance_ = distance; }
60 
61  void setDetectionLimit( float limit ) { this->detectionLimit_ = limit; }
62  float getDetectionLimit() const { return this->detectionLimit_; }
63 
64  float getMaximumDotSize() const { return this->maximumDotSize_; }
65  void setMaximumDotSize(float size) { this->maximumDotSize_ = size; }
66 
67  float getMaximumDotSize3D() const { return this->maximumDotSize3D_; }
68  void setMaximumDotSize3D(float size) { this->maximumDotSize3D_ = size;}
69 
70  std::string get2DMaterial() const {return this->material2D_; }
71  void set2DMaterial(std::string material2D) { this->material2D_ = material2D; }
72 
73  std::string get3DMaterial() const {return this->material3D_; }
74  void set3DMaterial(std::string material3D) { this->material3D_ = material3D; }
75 
76  std::string get3DMaterialFront() const {return this->material3DFront_; }
77  void set3DMaterialFront(std::string material3DFront) { this->material3DFront_ = material3DFront; }
78 
79  std::string get3DMaterialBack() const {return this->material3DBack_; }
80  void set3DMaterialBack(std::string material3DBack) { this->material3DBack_ = material3DBack; }
81 
82  virtual float getRadarSensitivity() const override { return this->sensitivity_; }
83  // used also by RadarListener interface!
84  void setRadarSensitivity(float sensitivity) { this->sensitivity_ = sensitivity; }
85 
86  // Determines angle between line of sight and x/z-plain on the 3D minimap
87  float getMapAngle() const { return this->mapAngle_; }
88  void setMapAngle(float mapAngle) { this->mapAngle_ = mapAngle; }
89 
90  // RadarListener interface
91  virtual void addObject(RadarViewable* viewable) override;
92  virtual void removeObject(RadarViewable* viewable) override;
93  virtual void objectChanged( RadarViewable* rv ) override;
94  virtual void radarTick(float dt) override;
95  bool showObject( RadarViewable* rv );
96 
97  void gatherObjects();
98 
99  std::map<RadarViewable::Shape, std::string> shapeMaterials_;
100 
101 // std::vector<Ogre::PanelOverlayElement*> radarDots_;
102 // std::vector<Ogre::PanelOverlayElement*>::iterator itRadarDots_;
103  std::map<RadarViewable*, Ogre::PanelOverlayElement*> radarObjects_;
104  Ogre::PanelOverlayElement* marker_;
105 
106  bool RadarMode_; // Determines, if Radar runs in 3D or 2D Mode
107 
111  float mapAngle_;
112 
113  std::string material2D_; //Material name for 2D map
114  std::string material3D_; //Material names For the 3D minimap
117 
118  Ogre::PanelOverlayElement* map3DFront_; //Overlayelements for the 3D minimap to be able to draw the points in a semi 3D matter
119  Ogre::PanelOverlayElement* map3DBack_;
120 
124  };
125 }
126 
127 #endif /* _HUDRadar_H__ */
float sensitivity_
Definition: HUDRadar.h:121
void setHalfDotSizeDistance(float distance)
Definition: HUDRadar.h:59
float halfDotSizeDistance_
Definition: HUDRadar.h:108
std::string get3DMaterial() const
Definition: HUDRadar.h:73
std::map< RadarViewable::Shape, std::string > shapeMaterials_
Definition: HUDRadar.h:99
std::string material3DFront_
Definition: HUDRadar.h:115
void set3DMaterialBack(std::string material3DBack)
Definition: HUDRadar.h:80
Ogre::PanelOverlayElement * marker_
Definition: HUDRadar.h:104
void setMapAngle(float mapAngle)
Definition: HUDRadar.h:88
float getMapAngle() const
Definition: HUDRadar.h:87
void set3DMaterialFront(std::string material3DFront)
Definition: HUDRadar.h:77
::std::string string
Definition: gtest-port.h:756
std::string get3DMaterialFront() const
Definition: HUDRadar.h:76
ControllableEntity * owner_
Definition: HUDRadar.h:123
Definition: RadarListener.h:37
float detectionLimit_
Definition: HUDRadar.h:122
Interface for receiving window events.
Definition: RadarViewable.h:48
float maximumDotSize3D_
Definition: HUDRadar.h:110
xmlelement
Definition: Super.h:519
Ogre::PanelOverlayElement * map3DBack_
Definition: HUDRadar.h:119
float getMaximumDotSize() const
Definition: HUDRadar.h:64
float mapAngle_
Definition: HUDRadar.h:111
float getHalfDotSizeDistance() const
Definition: HUDRadar.h:58
std::string get2DMaterial() const
Definition: HUDRadar.h:70
#define _OverlaysExport
Definition: OverlaysPrereqs.h:60
std::string material2D_
Definition: HUDRadar.h:113
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Shared library macros, enums, constants and forward declarations for the overlays module ...
std::string get3DMaterialBack() const
Definition: HUDRadar.h:79
Mode
Definition: CorePrereqs.h:102
bool RadarMode_
Definition: HUDRadar.h:106
void setDetectionLimit(float limit)
Definition: HUDRadar.h:61
void setMaximumDotSize3D(float size)
Definition: HUDRadar.h:68
std::string material3D_
Definition: HUDRadar.h:114
void setRadarSensitivity(float sensitivity)
Definition: HUDRadar.h:84
Definition: Context.h:45
Base class to display content directly onto the screen.
Definition: OrxonoxOverlay.h:72
float getMaximumDotSize3D() const
Definition: HUDRadar.h:67
Declaration of the OrxonoxOverlay class.
Definition: HUDRadar.h:46
float maximumDotSize_
Definition: HUDRadar.h:109
void set3DMaterial(std::string material3D)
Definition: HUDRadar.h:74
void setMaximumDotSize(float size)
Definition: HUDRadar.h:65
float getDetectionLimit() const
Definition: HUDRadar.h:62
Ogre::PanelOverlayElement * map3DFront_
Definition: HUDRadar.h:118
std::string material3DBack_
Definition: HUDRadar.h:116
std::map< RadarViewable *, Ogre::PanelOverlayElement * > radarObjects_
Definition: HUDRadar.h:103
The ControllableEntity is derived from the orxonox::MobileEntity.
Definition: ControllableEntity.h:48
virtual float getRadarSensitivity() const override
Definition: HUDRadar.h:82
void set2DMaterial(std::string material2D)
Definition: HUDRadar.h:71