[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 <vector> |
---|
| 42 | |
---|
[1393] | 43 | namespace orxonox |
---|
| 44 | { |
---|
[6849] | 45 | class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener |
---|
[1393] | 46 | { |
---|
[1615] | 47 | public: |
---|
[2087] | 48 | HUDNavigation(BaseObject* creator); |
---|
[3196] | 49 | virtual ~HUDNavigation(); |
---|
[1393] | 50 | |
---|
[1747] | 51 | virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); |
---|
| 52 | virtual void tick(float dt); |
---|
[6849] | 53 | virtual void addObject(RadarViewable* object); |
---|
| 54 | |
---|
| 55 | virtual void removeObject(RadarViewable* viewable); |
---|
| 56 | virtual void objectChanged(RadarViewable* viewable){} |
---|
| 57 | inline float getRadarSensitivity() const{} |
---|
| 58 | inline void radarTick(float dt) {} |
---|
[1590] | 59 | |
---|
[1615] | 60 | private: |
---|
[6796] | 61 | |
---|
| 62 | void sizeChanged(); |
---|
[1604] | 63 | void angleChanged() { } |
---|
| 64 | void positionChanged() { } |
---|
[6796] | 65 | |
---|
[6865] | 66 | // void updateActiveObjectList(map activeObjectList_); |
---|
[6796] | 67 | |
---|
[6865] | 68 | |
---|
[1604] | 69 | |
---|
| 70 | // XMLPort accessors |
---|
[6849] | 71 | void setNavMarkerSize(float size) { this->navMarkerSize_ = size; this->sizeChanged(); } |
---|
[1615] | 72 | float getNavMarkerSize() const { return this->navMarkerSize_; } |
---|
| 73 | |
---|
[6417] | 74 | /* |
---|
[1627] | 75 | void setAimMarkerSize(float size) { this->aimMarkerSize_ = size; this->sizeChanged(); } |
---|
[1615] | 76 | float getAimMarkerSize() const { return this->aimMarkerSize_; } |
---|
[6417] | 77 | */ |
---|
[1615] | 78 | |
---|
[1590] | 79 | void setTextSize(float size); |
---|
| 80 | float getTextSize() const; |
---|
[1615] | 81 | |
---|
[1590] | 82 | void setFont(const std::string& font); |
---|
[1615] | 83 | const std::string& getFont() const; |
---|
[1590] | 84 | |
---|
[1615] | 85 | void updateMarker(); |
---|
| 86 | void updateFocus(); |
---|
| 87 | float getDist2Focus() const; |
---|
[6796] | 88 | void getSingleton(); |
---|
[6865] | 89 | |
---|
[6796] | 90 | |
---|
| 91 | void updateActiveObjectMap(); |
---|
| 92 | |
---|
[1595] | 93 | Ogre::PanelOverlayElement* navMarker_; //!< the panel used to show the arrow and the target marker |
---|
| 94 | float navMarkerSize_; //!< One paramter size of the navigation marker |
---|
[6417] | 95 | /* |
---|
[1595] | 96 | Ogre::PanelOverlayElement* aimMarker_; //!< Panel used to show the aim Marker |
---|
| 97 | float aimMarkerSize_; //!< One paramter size of the aim marker |
---|
[6417] | 98 | */ |
---|
[1595] | 99 | Ogre::TextAreaOverlayElement* navText_; //!< Text overlay to display the target distance |
---|
[1604] | 100 | bool wasOutOfView_; //!< Performance booster variable: setMaterial is not cheap |
---|
[6796] | 101 | |
---|
[6865] | 102 | typedef std::map<RadarViewable*, std::pair<Ogre::PanelOverlayElement*, Ogre::TextAreaOverlayElement*> > activeObjectListType; |
---|
| 103 | activeObjectListType activeObjectList_; |
---|
| 104 | activeObjectListType::iterator tempRadarViewable; |
---|
[6796] | 105 | |
---|
[1615] | 106 | }; |
---|
[6849] | 107 | |
---|
[1393] | 108 | } |
---|
| 109 | |
---|
[1601] | 110 | #endif /* _HUDNavigation_H__ */ |
---|