SuperTuxKart
Loading...
Searching...
No Matches
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
26class AbstractKart;
27
34{
35public:
43 }; // CameraDebugType
44
45private:
46
47 static CameraDebugType m_default_debug_Type;
48
49 void getCameraSettings(float *above_kart, float *cam_angle,
50 float *side_way, float *distance );
51 void positionCamera(float dt, float above_kart, float cam_angle,
52 float side_way, float distance);
53
54 friend class Camera;
55 CameraDebug(int camera_index, AbstractKart* kart);
56 virtual ~CameraDebug();
57public:
58
59 void update(float dt);
60 // ------------------------------------------------------------------------
62 static void setDebugType(CameraDebugType type)
63 {
64 m_default_debug_Type = type;
65 } // setDebugType
66
67}; // CameraDebug
68
69#endif
70
71/* EOF */
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
Handles the debug camera.
Definition: camera_debug.hpp:34
virtual ~CameraDebug()
Removes the camera scene node from the scene.
Definition: camera_debug.cpp:44
void update(float dt)
Called once per time frame to move the camera to the right position.
Definition: camera_debug.cpp:92
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
CameraDebugType
Definition: camera_debug.hpp:36
@ CM_DEBUG_SIDE_OF_KART
Camera to the right of the kart.
Definition: camera_debug.hpp:40
@ CM_DEBUG_FRONT_OF_KART
Camera to the front of the kart.
Definition: camera_debug.hpp:42
@ CM_DEBUG_BEHIND_KART
Camera straight behind kart.
Definition: camera_debug.hpp:39
@ CM_DEBUG_GROUND
Camera at ground level, wheel debugging.
Definition: camera_debug.hpp:38
@ CM_DEBUG_INV_SIDE_OF_KART
Camera to the left of the kart.
Definition: camera_debug.hpp:41
@ CM_DEBUG_TOP_OF_KART
Camera hovering over kart.
Definition: camera_debug.hpp:37
static void setDebugType(CameraDebugType type)
Sets the debug type for all cameras.
Definition: camera_debug.hpp:62
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:173
Handles the normal racing camera.
Definition: camera_normal.hpp:33
This is the base class for all cameras.
Definition: camera.hpp:49