Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.h @ 9429

Last change on this file since 9429 was 9429, checked in by mottetb, 12 years ago

aimMarkerSize Problem

  • Property svn:eol-style set to native
File size: 4.4 KB
RevLine 
[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
[9016]26 *      Matthias Spalinger
[1454]27 *
28 */
[1393]29
[1601]30#ifndef _HUDNavigation_H__
31#define _HUDNavigation_H__
[1393]32
[5693]33#include "overlays/OverlaysPrereqs.h"
[1410]34
[7163]35#include <map>
36#include <string>
37
[3196]38#include "util/OgreForwardRefs.h"
[5693]39#include "tools/interfaces/Tickable.h"
[7163]40#include "interfaces/RadarListener.h"
[1601]41#include "overlays/OrxonoxOverlay.h"
[1393]42
43namespace orxonox
44{
[9348]45    class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
46    {
47        public:
48            HUDNavigation(BaseObject* creator);
49            virtual ~HUDNavigation();
[7163]50
[9348]51            void setConfigValues();
[7163]52
[9348]53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
54            virtual void tick(float dt);
[7163]55
[9348]56            // RadarListener interface
57            virtual void addObject(RadarViewable* object);
58            virtual void removeObject(RadarViewable* viewable);
59            virtual void objectChanged(RadarViewable* viewable);
[7163]60
[9348]61            virtual void changedOwner();
62            virtual void sizeChanged();
63            virtual void angleChanged() { }
64            virtual void positionChanged() { }
65            virtual void radarTick(float dt) {}
[7163]66
[9348]67            inline float getRadarSensitivity() const
68                { return 1.0f; }
[7163]69
[9348]70            inline unsigned int getMarkerLimit() const
71                { return this->markerLimit_; }
[9016]72
[9348]73        private:
74            struct ObjectInfo
75            {
76                Ogre::PanelOverlayElement* panel_;
[9421]77                Ogre::PanelOverlayElement* target_;
[9348]78                Ogre::TextAreaOverlayElement* text_;
79                bool outOfView_;
80                bool wasOutOfView_;
81            };
[1393]82
[9348]83            bool showObject(RadarViewable* rv);
[1590]84
[9348]85            // XMLPort accessors
86            inline void setNavMarkerSize(float size)
87            {
88                navMarkerSize_ = size;
89                this->sizeChanged();
90            }
91            inline float getNavMarkerSize() const
92                { return navMarkerSize_; }
[9429]93            inline void setAimMarkerSize(float size)
94            {
95                aimMarkerSize_ = size;
96                this->sizeChanged();
97            }
98            inline float getAimMarkerSize() const
99                { return aimMarkerSize_; }
[9348]100            inline void setDetectionLimit(float limit)
101                { this->detectionLimit_ = limit; }
102            inline float getDetectionLimit() const
103                { return this->detectionLimit_; }
[1604]104
[9348]105            void setTextSize(float size);
106            float getTextSize() const;
[1615]107
[9348]108            void setFont(const std::string& font);
109            const std::string& getFont() const;
[1615]110
[9348]111            float getArrowSizeX(int dist) const;
112            float getArrowSizeY(int dist) const;
[1615]113
[9421]114            Vector3* toAimPosition(RadarViewable* target) const;
115
[9348]116            std::map<RadarViewable*, ObjectInfo> activeObjectList_;
117            std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
[1590]118
[9348]119            float navMarkerSize_;
[9429]120            float aimMarkerSize_;
[9348]121            std::string fontName_;
122            float textSize_;
123            bool showDistance_;
[1615]124
[9421]125            static const float LIGHTNING_GUN_SPEED_ = 700.0f;
126            static const float HSW01_SPEED_ = 2500.0f;
127
128            float currentMunitionSpeed_;
129
130            Pawn* ship_;
131
[9348]132            unsigned int markerLimit_;
133            float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
134    };
[1393]135}
136
[1601]137#endif /* _HUDNavigation_H__ */
Note: See TracBrowser for help on using the repository browser.