Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.h @ 6865

Last change on this file since 6865 was 6865, checked in by sfluecki, 14 years ago

tick funktion angepasst

  • Property svn:eol-style set to native
File size: 3.5 KB
Line 
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 *      Felix Schulthess
24 *   Co-authors:
25 *      Reto Grieder
26 *
27 */
28
29#ifndef _HUDNavigation_H__
30#define _HUDNavigation_H__
31
32#include <utility>
33#include <map>
34#include "overlays/OverlaysPrereqs.h"
35
36#include "interfaces/RadarListener.h"
37#include "util/OgreForwardRefs.h"
38#include "tools/interfaces/Tickable.h"
39#include "overlays/OrxonoxOverlay.h"
40
41#include <vector>
42
43namespace orxonox
44{
45    class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
46    {
47    public:
48        HUDNavigation(BaseObject* creator);
49        virtual ~HUDNavigation();
50
51        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
52        virtual void tick(float dt);
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) {}
59
60    private:
61
62        void sizeChanged();
63        void angleChanged() { }
64        void positionChanged() { }
65       
66//      void updateActiveObjectList(map activeObjectList_);
67       
68       
69
70        // XMLPort accessors
71        void setNavMarkerSize(float size) { this->navMarkerSize_ = size; this->sizeChanged(); } 
72        float getNavMarkerSize() const    { return this->navMarkerSize_; }
73
74/*
75        void setAimMarkerSize(float size) { this->aimMarkerSize_ = size; this->sizeChanged(); }
76        float getAimMarkerSize() const    { return this->aimMarkerSize_; }
77*/
78
79        void setTextSize(float size);
80        float getTextSize() const;
81
82        void setFont(const std::string& font);
83        const std::string& getFont() const;
84
85        void updateMarker();
86        void updateFocus();
87        float getDist2Focus() const;
88        void getSingleton();
89
90   
91        void updateActiveObjectMap();
92       
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
95/*
96        Ogre::PanelOverlayElement* aimMarker_;      //!< Panel used to show the aim Marker
97        float aimMarkerSize_;                       //!< One paramter size of the aim marker
98*/
99        Ogre::TextAreaOverlayElement* navText_;     //!< Text overlay to display the target distance
100        bool wasOutOfView_;                         //!< Performance booster variable: setMaterial is not cheap
101       
102        typedef std::map<RadarViewable*, std::pair<Ogre::PanelOverlayElement*, Ogre::TextAreaOverlayElement*> > activeObjectListType;
103        activeObjectListType activeObjectList_;
104        activeObjectListType::iterator tempRadarViewable;
105       
106    };
107   
108}
109
110#endif /* _HUDNavigation_H__ */
Note: See TracBrowser for help on using the repository browser.