/** ******************************************************************************* @file /gui/engine/MapCamera.h @brief Kamera mapy @author Pavel @version 0.1 ******************************************************************************/ #ifndef MAPCAMERA_H #define MAPCAMERA_H #include "gui/engine/Scene.h" #include "gui/engine/Camera.h" #include "gui/engine/MapControllers.h" #include "gui/common/mymath.h" #include "gui/GUI.h" #include "gui/model/guimap.h" namespace gui{ //FWD class TguiMap; /// Standartni nastaveni perspektivy #define VIEW_ANGLE 60 #define ASPECT_RATIO 1.33f #define NEAR_CLIP 1 #define FAR_CLIP (8*HEX_EDGE_LENGTH) /// Kamera. //@{ const float CAM_MAX_HEIGHT = (float)(M_PI/2-M_PI/20); const float CAM_MIN_HEIGHT = (float)(M_PI/6); const float CAM_MIN_RADIUS = HEX_EDGE_LENGTH; const float CAM_MAX_RADIUS = FAR_CLIP-3*HEX_EDGE_LENGTH; const float CAM_BASE_HEIGHT = CAM_MAX_HEIGHT; const float CAM_BASE_WIDTH = (float)M_PI; const float CAM_BASE_RADIUS = HEX_EDGE_LENGTH*2.5f; const float CAM_TURN_STEP = (float)(M_PI/700); const float CAM_SCROLL_STEP = 30.0f; const float CAM_RADIUS_STEP = 50.0f; //@} /// Nejnizsi vyska kamery nad terenem const float CAM_ABOVE_MAP = (HEX_EDGE_LENGTH/10.0f); /** Hlavni kamera na scene. */ class TMainCamera : public TCamera { protected: TguiMap *guiMap; ///< guimapa V2I startEdit; ///< Souradnice kursoru bool editing; ///< meni se orientace kamery /** Prepocet parametru kamery */ void calculateCameraLook(); public: P3F centre; ///< stred pohledu float width; ///< ?? float height; ///< ?? float radius; ///< ?? /** Konstruktor. @param map Mapa. */ TMainCamera(TguiMap *map); /** ?? */ void base(); /** Inicializace kamery. */ virtual void initCam(); /// Hlavni operace. //@{ void turn(double dw,double dh); void scroll(float _dx, float _dy); void incRadius(float dr); void setCentre(float _x, float _y); //@} /// Obdelnik, ve kterem se muze kamera pohybovat. //@{ float xmin; float xmax; float ymin; float ymax; //@} friend class TguiMap; friend class TMainCameraController; }; } // namespace; #endif /******************************************************************************/