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 | * Si Sun |
---|
24 | * |
---|
25 | */ |
---|
26 | |
---|
27 | #ifndef _MAP_H__ |
---|
28 | #define _MAP_H__ |
---|
29 | |
---|
30 | #include <string> |
---|
31 | #include "OrxonoxPrereqs.h" |
---|
32 | #include <OgrePrerequisites.h> |
---|
33 | #include <OgreSceneManager.h> |
---|
34 | #include <OgreSceneNode.h> |
---|
35 | #include <OgreEntity.h> |
---|
36 | #include <OgreOverlay.h> |
---|
37 | #include <OgreOverlayElement.h> |
---|
38 | #include <OgreOverlayManager.h> |
---|
39 | #include <OgreOverlayContainer.h> |
---|
40 | #include <OgreMovablePlane.h> |
---|
41 | |
---|
42 | #include <OgreBorderPanelOverlayElement.h> |
---|
43 | #include <OgreTextAreaOverlayElement.h> |
---|
44 | |
---|
45 | #include "overlays/OrxonoxOverlay.h" |
---|
46 | #include "objects/Tickable.h" |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | namespace orxonox |
---|
51 | { |
---|
52 | class _OrxonoxExport Map : public OrxonoxOverlay, public Tickable |
---|
53 | { |
---|
54 | |
---|
55 | public: // functions |
---|
56 | Map(BaseObject* creator); |
---|
57 | ~Map(); |
---|
58 | |
---|
59 | virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); |
---|
60 | virtual void tick(float dt); |
---|
61 | virtual void changedOwner(); |
---|
62 | |
---|
63 | static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, std::string matName); |
---|
64 | |
---|
65 | static void openMap(); |
---|
66 | |
---|
67 | //Not yet implemented |
---|
68 | static const int maxRange_s=1000; |
---|
69 | |
---|
70 | static void rotateYaw(const Vector2& value); |
---|
71 | static void rotatePitch(const Vector2& value); |
---|
72 | static void Zoom(const Vector2& value); |
---|
73 | // variables |
---|
74 | |
---|
75 | |
---|
76 | bool inline getVisibility() |
---|
77 | { return this->isVisible_; }; |
---|
78 | |
---|
79 | static inline Ogre::SceneManager* getMapSceneManagerPtr() |
---|
80 | { |
---|
81 | return Map::singletonMap_s->mapSceneM_s; |
---|
82 | } |
---|
83 | static inline Map* getSingletonPtr() |
---|
84 | { |
---|
85 | return Map::singletonMap_s; |
---|
86 | } |
---|
87 | |
---|
88 | static inline Ogre::SceneManager* getMapSceneManager() |
---|
89 | { |
---|
90 | return Map::mapSceneM_s; |
---|
91 | } |
---|
92 | |
---|
93 | |
---|
94 | |
---|
95 | private: // functions |
---|
96 | |
---|
97 | void toggleVisibility(); |
---|
98 | void updatePositions(); |
---|
99 | // void changedPlayerNode(); |
---|
100 | static inline void setMapSceneManager( Ogre::SceneManager * sm) |
---|
101 | { |
---|
102 | Map::mapSceneM_s = sm; |
---|
103 | } |
---|
104 | //static Ogre::MaterialPtr init(); |
---|
105 | |
---|
106 | private: // variables |
---|
107 | static Map* singletonMap_s; |
---|
108 | |
---|
109 | Ogre::SceneManager* sManager_; |
---|
110 | Ogre::OverlayManager * oManager_; |
---|
111 | |
---|
112 | static Ogre::SceneManager* mapSceneM_s; |
---|
113 | static Ogre::SceneNode* CamNode_; |
---|
114 | static Ogre::Camera* Cam_; |
---|
115 | static Ogre::MaterialPtr OverlayMaterial_; |
---|
116 | static Ogre::Overlay* overlay_; |
---|
117 | //Ogre::SceneNode* CamNodeHelper_; |
---|
118 | Ogre::SceneNode* playerShipNode_; |
---|
119 | Ogre::SceneNode* planeNode_; |
---|
120 | Ogre::MovablePlane* movablePlane_; |
---|
121 | int mouseLookSpeed_; |
---|
122 | bool isVisible_; |
---|
123 | |
---|
124 | friend class RadarViewable; |
---|
125 | }; |
---|
126 | } |
---|
127 | |
---|
128 | #endif /* _MAP_H__ */ |
---|