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