[1505] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
[1454] | 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 | * |
---|
[1454] | 22 | * Author: |
---|
| 23 | * Felix Schulthess |
---|
| 24 | * Co-authors: |
---|
[1590] | 25 | * Reto Grieder |
---|
[1454] | 26 | * |
---|
| 27 | */ |
---|
[1393] | 28 | |
---|
[1601] | 29 | #ifndef _HUDNavigation_H__ |
---|
| 30 | #define _HUDNavigation_H__ |
---|
[1393] | 31 | |
---|
[6849] | 32 | #include <utility> |
---|
| 33 | #include <map> |
---|
[5693] | 34 | #include "overlays/OverlaysPrereqs.h" |
---|
[1410] | 35 | |
---|
[6849] | 36 | #include "interfaces/RadarListener.h" |
---|
[3196] | 37 | #include "util/OgreForwardRefs.h" |
---|
[5693] | 38 | #include "tools/interfaces/Tickable.h" |
---|
[1601] | 39 | #include "overlays/OrxonoxOverlay.h" |
---|
[1393] | 40 | |
---|
[6796] | 41 | #include <pair> |
---|
| 42 | #include <vector> |
---|
| 43 | |
---|
[1393] | 44 | namespace orxonox |
---|
| 45 | { |
---|
[6849] | 46 | class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener |
---|
[1393] | 47 | { |
---|
[1615] | 48 | public: |
---|
[2087] | 49 | HUDNavigation(BaseObject* creator); |
---|
[3196] | 50 | virtual ~HUDNavigation(); |
---|
[1393] | 51 | |
---|
[1747] | 52 | virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); |
---|
| 53 | virtual void tick(float dt); |
---|
[6849] | 54 | virtual void addObject(RadarViewable* object); |
---|
| 55 | |
---|
| 56 | virtual void removeObject(RadarViewable* viewable); |
---|
| 57 | virtual void objectChanged(RadarViewable* viewable){} |
---|
| 58 | inline float getRadarSensitivity() const{} |
---|
| 59 | inline void radarTick(float dt) {} |
---|
[1590] | 60 | |
---|
[1615] | 61 | private: |
---|
[6796] | 62 | |
---|
| 63 | void sizeChanged(); |
---|
[1604] | 64 | void angleChanged() { } |
---|
| 65 | void positionChanged() { } |
---|
[6796] | 66 | |
---|
| 67 | |
---|
[1604] | 68 | |
---|
| 69 | // XMLPort accessors |
---|
[6849] | 70 | void setNavMarkerSize(float size) { this->navMarkerSize_ = size; this->sizeChanged(); } |
---|
[1615] | 71 | float getNavMarkerSize() const { return this->navMarkerSize_; } |
---|
| 72 | |
---|
[6417] | 73 | /* |
---|
[1627] | 74 | void setAimMarkerSize(float size) { this->aimMarkerSize_ = size; this->sizeChanged(); } |
---|
[1615] | 75 | float getAimMarkerSize() const { return this->aimMarkerSize_; } |
---|
[6417] | 76 | */ |
---|
[1615] | 77 | |
---|
[1590] | 78 | void setTextSize(float size); |
---|
| 79 | float getTextSize() const; |
---|
[1615] | 80 | |
---|
[1590] | 81 | void setFont(const std::string& font); |
---|
[1615] | 82 | const std::string& getFont() const; |
---|
[1590] | 83 | |
---|
[1615] | 84 | void updateMarker(); |
---|
| 85 | void updateFocus(); |
---|
| 86 | float getDist2Focus() const; |
---|
[6796] | 87 | void getSingleton(); |
---|
| 88 | void getSingleton(); |
---|
| 89 | |
---|
| 90 | void updateActiveObjectMap(); |
---|
| 91 | |
---|
[1595] | 92 | Ogre::PanelOverlayElement* navMarker_; //!< the panel used to show the arrow and the target marker |
---|
| 93 | float navMarkerSize_; //!< One paramter size of the navigation marker |
---|
[6417] | 94 | /* |
---|
[1595] | 95 | Ogre::PanelOverlayElement* aimMarker_; //!< Panel used to show the aim Marker |
---|
| 96 | float aimMarkerSize_; //!< One paramter size of the aim marker |
---|
[6417] | 97 | */ |
---|
[1595] | 98 | Ogre::TextAreaOverlayElement* navText_; //!< Text overlay to display the target distance |
---|
[1604] | 99 | bool wasOutOfView_; //!< Performance booster variable: setMaterial is not cheap |
---|
[6796] | 100 | |
---|
[6849] | 101 | std::map<RadarViewable*, std::pair<Ogre::PanelOverlayElement*, Ogre::TextAreaOverlayElement*> > activeObjectList_; |
---|
[6796] | 102 | |
---|
[1615] | 103 | }; |
---|
[6849] | 104 | |
---|
[1393] | 105 | } |
---|
| 106 | |
---|
[1601] | 107 | #endif /* _HUDNavigation_H__ */ |
---|