SuperTuxKart
camera_debug.hpp
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 
33 class CameraDebug : public CameraNormal
34 {
35 public:
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  // ------------------------------------------------------------------------
60  static void setDebugType(CameraDebugType type)
61  {
62  m_default_debug_Type = type;
63  } // setDebugType
64 
65 }; // CameraDebug
66 
67 #endif
68 
69 /* EOF */
Camera at ground level, wheel debugging.
Definition: camera_debug.hpp:38
Handles the debug camera.
Definition: camera_debug.hpp:33
Handles the normal racing camera.
Definition: camera_normal.hpp:32
void getCameraSettings(float *above_kart, float *cam_angle, float *side_way, float *distance)
Determine the camera settings for the current frame.
Definition: camera_debug.cpp:55
void update(float dt)
Called once per time frame to move the camera to the right position.
Definition: camera_debug.cpp:92
void positionCamera(float dt, float above_kart, float cam_angle, float side_way, float distance)
Actually sets the camera based on the given parameter.
Definition: camera_debug.cpp:157
Camera hovering over kart.
Definition: camera_debug.hpp:37
virtual ~CameraDebug()
Removes the camera scene node from the scene.
Definition: camera_debug.cpp:44
CameraDebugType
Definition: camera_debug.hpp:36
Camera to the right of the kart.
Definition: camera_debug.hpp:40
This is the base class for all cameras.
Definition: camera.hpp:48
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:61
static void setDebugType(CameraDebugType type)
Sets the debug type for all cameras.
Definition: camera_debug.hpp:60
Camera straight behind kart.
Definition: camera_debug.hpp:39