[1454] | 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 | * Yuning Chai |
---|
| 24 | * Co-authors: |
---|
| 25 | * Felix Schulthess |
---|
| 26 | * |
---|
| 27 | */ |
---|
[1362] | 28 | |
---|
| 29 | |
---|
| 30 | #ifndef _HUD_H__ |
---|
| 31 | #define _HUD_H__ |
---|
| 32 | |
---|
[1410] | 33 | #include "OrxonoxPrereqs.h" |
---|
| 34 | |
---|
[1406] | 35 | #include <OgrePrerequisites.h> |
---|
[1362] | 36 | #include <OgreTextAreaOverlayElement.h> |
---|
[1450] | 37 | #include <OgreSceneNode.h> |
---|
[1362] | 38 | #include "core/Tickable.h" |
---|
[1410] | 39 | #include "util/Math.h" |
---|
[1362] | 40 | |
---|
| 41 | namespace orxonox |
---|
| 42 | { |
---|
| 43 | class _OrxonoxExport HUD : public Tickable |
---|
| 44 | { |
---|
[1410] | 45 | private: |
---|
| 46 | HUD(); |
---|
| 47 | HUD(HUD& instance); |
---|
| 48 | ~HUD(); |
---|
| 49 | Ogre::OverlayManager* om; |
---|
[1450] | 50 | Ogre::SceneManager* sm; |
---|
[1410] | 51 | Ogre::Overlay* orxonoxHUD; |
---|
| 52 | Ogre::OverlayContainer* container; |
---|
| 53 | Ogre::TextAreaOverlayElement* fpsText; |
---|
[1422] | 54 | Ogre::TextAreaOverlayElement* rTRText; |
---|
[1410] | 55 | BarOverlayElement* energyBar; |
---|
| 56 | BarOverlayElement* speedoBar; |
---|
| 57 | RadarOverlayElement* radar; |
---|
| 58 | Navigation* nav; |
---|
[1362] | 59 | |
---|
[1451] | 60 | bool showFPS; |
---|
| 61 | bool showRenderTime; |
---|
| 62 | |
---|
[1410] | 63 | public: |
---|
| 64 | virtual void tick(float); |
---|
[1450] | 65 | void addRadarObject(Ogre::SceneNode* node, int colour = 0); |
---|
[1456] | 66 | void removeRadarObject(Ogre::SceneNode* node); |
---|
[1422] | 67 | void setRenderTimeRatio(float ratio); |
---|
[1451] | 68 | void setFPS(); |
---|
[1362] | 69 | |
---|
[1456] | 70 | std::set<RadarObject*> roSet; |
---|
| 71 | |
---|
[1410] | 72 | static HUD* instance_s; |
---|
| 73 | static HUD& getSingleton(); |
---|
| 74 | static void setEnergy(float value); |
---|
| 75 | static void cycleNavigationFocus(); |
---|
[1451] | 76 | static void toggleFPS(); |
---|
| 77 | static void toggleRenderTime(); |
---|
[1362] | 78 | }; |
---|
| 79 | } |
---|
| 80 | |
---|
[1410] | 81 | #endif /* _HUD_H__ */ |
---|