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