| [1505] | 1 | /* | 
|---|
 | 2 |  *   ORXONOX - the hottest 3D action shooter ever to exist | 
|---|
 | 3 |  *                    > www.orxonox.net < | 
|---|
| [1502] | 4 |  * | 
|---|
| [1505] | 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 |  * | 
|---|
| [1502] | 22 |  *   Author: | 
|---|
 | 23 |  *      Yuning Chai | 
|---|
| [1614] | 24 |  *      Felix Schulthess | 
|---|
| [1502] | 25 |  *   Co-authors: | 
|---|
| [1614] | 26 |  *      Reto Grieder | 
|---|
| [1502] | 27 |  * | 
|---|
 | 28 |  */ | 
|---|
| [1283] | 29 |  | 
|---|
| [1604] | 30 | #ifndef _HUDRadar_H__ | 
|---|
 | 31 | #define _HUDRadar_H__ | 
|---|
| [1283] | 32 |  | 
|---|
| [5693] | 33 | #include "overlays/OverlaysPrereqs.h" | 
|---|
| [1502] | 34 |  | 
|---|
| [3196] | 35 | #include <map> | 
|---|
| [1614] | 36 | #include <vector> | 
|---|
| [3196] | 37 |  | 
|---|
 | 38 | #include "util/OgreForwardRefs.h" | 
|---|
 | 39 | #include "interfaces/RadarListener.h" | 
|---|
 | 40 | #include "interfaces/RadarViewable.h" | 
|---|
| [1604] | 41 | #include "overlays/OrxonoxOverlay.h" | 
|---|
| [1407] | 42 |  | 
|---|
| [1283] | 43 | namespace orxonox | 
|---|
 | 44 | { | 
|---|
| [5693] | 45 |     class _OverlaysExport HUDRadar : public OrxonoxOverlay, public RadarListener | 
|---|
| [1329] | 46 |     { | 
|---|
| [1615] | 47 |     public: | 
|---|
| [2087] | 48 |         HUDRadar(BaseObject* creator); | 
|---|
| [3196] | 49 |         virtual ~HUDRadar(); | 
|---|
| [1400] | 50 |  | 
|---|
| [1747] | 51 |         virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); | 
|---|
| [2662] | 52 |         virtual void changedOwner(); | 
|---|
| [1604] | 53 |  | 
|---|
| [1615] | 54 |     private: | 
|---|
 | 55 |         // XML accessors | 
|---|
| [1613] | 56 |         float getHalfDotSizeDistance() const { return this->halfDotSizeDistance_; } | 
|---|
 | 57 |         void setHalfDotSizeDistance(float distance) { this->halfDotSizeDistance_ = distance; } | 
|---|
| [1604] | 58 |  | 
|---|
| [1613] | 59 |         float getMaximumDotSize() const { return this->maximumDotSize_; } | 
|---|
 | 60 |         void setMaximumDotSize(float size) { this->maximumDotSize_ = size; } | 
|---|
 | 61 |  | 
|---|
| [1615] | 62 |         float getRadarSensitivity() const { return this->sensitivity_; } | 
|---|
 | 63 |         // used also by RadarListener interface! | 
|---|
 | 64 |         void setRadarSensitivity(float sensitivity) { this->sensitivity_ = sensitivity; } | 
|---|
 | 65 |  | 
|---|
 | 66 |         // RadarListener interface | 
|---|
| [1613] | 67 |         void displayObject(RadarViewable* viewable, bool bIsMarked); | 
|---|
 | 68 |         void radarTick(float dt); | 
|---|
| [1604] | 69 |  | 
|---|
| [1613] | 70 |         std::map<RadarViewable::Shape, std::string> shapeMaterials_; | 
|---|
| [1604] | 71 |  | 
|---|
| [1614] | 72 |         std::vector<Ogre::PanelOverlayElement*> radarDots_; | 
|---|
 | 73 |         std::vector<Ogre::PanelOverlayElement*>::iterator itRadarDots_; | 
|---|
| [1613] | 74 |         Ogre::PanelOverlayElement* marker_; | 
|---|
 | 75 |  | 
|---|
 | 76 |         float halfDotSizeDistance_; | 
|---|
 | 77 |         float maximumDotSize_; | 
|---|
 | 78 |  | 
|---|
 | 79 |         float sensitivity_; | 
|---|
| [2662] | 80 |  | 
|---|
 | 81 |         Pawn* owner_; | 
|---|
| [1604] | 82 |     }; | 
|---|
| [1302] | 83 | } | 
|---|
| [1283] | 84 |  | 
|---|
| [1604] | 85 | #endif /* _HUDRadar_H__ */ | 
|---|