1 // 2 // SuperTuxKart - a fun racing game with go-kart 3 // Copyright (C) 2004-2015 Steve Baker <sjbaker1@airmail.net> 4 // Copyright (C) 2006-2015 SuperTuxKart-Team, Steve Baker 5 // 6 // This program is free software; you can redistribute it and/or 7 // modify it under the terms of the GNU General Public License 8 // as published by the Free Software Foundation; either version 3 9 // of the License, or (at your option) any later version. 10 // 11 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 // 17 // You should have received a copy of the GNU General Public License 18 // along with this program; if not, write to the Free Software 19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 21 #ifndef HEADER_CAMERA_DEBUG_HPP 22 #define HEADER_CAMERA_DEBUG_HPP 23 24 #include "graphics/camera_normal.hpp" 25 26 class AbstractKart; 27 28 /** 29 * Handles the debug camera. Inherits from CameraNormal to make use 30 * of the smoothing function. 31 * \ingroup graphics 32 */ 33 class CameraDebug : public CameraNormal 34 { 35 public: 36 enum CameraDebugType { 37 CM_DEBUG_TOP_OF_KART, //!< Camera hovering over kart 38 CM_DEBUG_GROUND, //!< Camera at ground level, wheel debugging 39 CM_DEBUG_BEHIND_KART, //!< Camera straight behind kart 40 CM_DEBUG_SIDE_OF_KART, //!< Camera to the right of the kart 41 }; // CameraDebugType 42 43 private: 44 45 static CameraDebugType m_default_debug_Type; 46 47 void getCameraSettings(float *above_kart, float *cam_angle, 48 float *side_way, float *distance ); 49 void positionCamera(float dt, float above_kart, float cam_angle, 50 float side_way, float distance); 51 52 friend class Camera; 53 CameraDebug(int camera_index, AbstractKart* kart); 54 virtual ~CameraDebug(); 55 public: 56 57 void update(float dt); 58 // ------------------------------------------------------------------------ 59 /** Sets the debug type for all cameras. */ setDebugType(CameraDebugType type)60 static void setDebugType(CameraDebugType type) 61 { 62 m_default_debug_Type = type; 63 } // setDebugType 64 65 }; // CameraDebug 66 67 #endif 68 69 /* EOF */ 70