|
SuperTuxKart
|
Handles the debug camera. More...
#include <camera_debug.hpp>

Public Types | |
| enum | CameraDebugType { CM_DEBUG_TOP_OF_KART , CM_DEBUG_GROUND , CM_DEBUG_BEHIND_KART , CM_DEBUG_SIDE_OF_KART , CM_DEBUG_INV_SIDE_OF_KART , CM_DEBUG_FRONT_OF_KART } |
Public Types inherited from Camera | |
| enum | CameraType { CM_TYPE_NORMAL , CM_TYPE_DEBUG , CM_TYPE_FPS , CM_TYPE_END } |
| The different camera types that can be used. More... | |
| enum | Mode { CM_NORMAL , CM_CLOSEUP , CM_REVERSE , CM_LEADER_MODE , CM_SPECTATOR_SOCCER , CM_SPECTATOR_TOP_VIEW , CM_SIMPLE_REPLAY , CM_FALLING } |
Public Member Functions | |
| void | update (float dt) |
| Called once per time frame to move the camera to the right position. More... | |
Public Member Functions inherited from CameraNormal | |
| void | restart () |
| bool | isDebug () |
| bool | isFPS () |
| void | setAmbientLight (const video::SColor &color) |
| Sets the ambient light for this camera. | |
| void | setDistanceToKart (float distance) |
| float | getDistanceToKart () const |
| const video::SColor & | getAmbientLight () const |
| Returns the current ambient light. | |
Public Member Functions inherited from Camera | |
| void | setMode (Mode mode) |
| Sets the mode of the camera. More... | |
| Mode | getMode () |
| Set the camera to the given mode. More... | |
| Mode | getPreviousMode () |
| Returns the last known mode of the camera. | |
| bool | isSpectatorMode () |
| Returns true if camera is a spectator camera. | |
| void | setNextSpectatorMode () |
| Switch to next spectator mode (a -> soccer -> top view -> a) | |
| void | setKart (AbstractKart *new_kart) |
| Changes the owner of this camera to the new kart. More... | |
| virtual void | setInitialTransform () |
| Saves the current kart position as the initial starting position for the camera. | |
| virtual void | activate (bool alsoActivateInIrrlicht=true) |
| Sets viewport etc. More... | |
| CameraType | getType () |
| Returns the type of this camera. | |
| void | setFoV () |
| Sets the field of view for the irrlicht camera. | |
| int | getIndex () const |
| Returns the camera index (or player kart index, which is the same). | |
| core::matrix4 | getPreviousPVMatrix () const |
| Returns the project-view matrix of the previous frame. | |
| void | setPreviousPVMatrix (core::matrix4 mat) |
| Returns the project-view matrix of the previous frame. | |
| const AbstractKart * | getKart () const |
| Returns the kart to which this camera is attached. | |
| AbstractKart * | getKart () |
| Returns the kart to which this camera is attached. | |
| void | setAmbientLight (const video::SColor &color) |
| Sets the ambient light for this camera. | |
| const video::SColor & | getAmbientLight () const |
| Returns the current ambient light. | |
| const core::recti & | getViewport () const |
| Returns the viewport of this camera. | |
| const core::vector2df & | getScaling () const |
| Returns the scaling in x/y direction for this camera. | |
| scene::ICameraSceneNode * | getCameraSceneNode () |
| Returns the camera scene node. | |
| Vec3 | getXYZ () |
| Returs the absolute position of the camera. | |
| void | setupCamera () |
| Sets up the viewport, aspect ratio, field of view, and scaling for this camera. | |
Static Public Member Functions | |
| static void | setDebugType (CameraDebugType type) |
| Sets the debug type for all cameras. | |
Static Public Member Functions inherited from Camera | |
| static Camera * | createCamera (AbstractKart *kart, const int index) |
| Creates a new camera and adds it to the list of all cameras. More... | |
| static void | resetAllCameras () |
| static void | changeCamera (unsigned int camera_index, CameraType type) |
| static void | setDefaultCameraType (CameraType type) |
| Sets the default type for each camera that will be created. More... | |
| static CameraType | getDefaultCameraType () |
| Returns the default type for each camera that will be created. More... | |
| static unsigned int | getNumCameras () |
| Returns the number of cameras used. | |
| static Camera * | getCamera (unsigned int n) |
| Returns a camera. | |
| static Camera * | getActiveCamera () |
| Returns the currently active camera. | |
| static void | removeAllCameras () |
| Remove all cameras. | |
Private Member Functions | |
| void | getCameraSettings (float *above_kart, float *cam_angle, float *side_way, float *distance) |
| Determine the camera settings for the current frame. More... | |
| void | positionCamera (float dt, float above_kart, float cam_angle, float side_way, float distance) |
| Actually sets the camera based on the given parameter. More... | |
| CameraDebug (int camera_index, AbstractKart *kart) | |
| virtual | ~CameraDebug () |
| Removes the camera scene node from the scene. | |
Static Private Attributes | |
| static CameraDebugType | m_default_debug_Type |
Friends | |
| class | Camera |
Additional Inherited Members | |
Protected Member Functions inherited from Camera | |
| Camera (CameraType type, int camera_index, AbstractKart *kart) | |
| virtual | ~Camera () |
| Removes the camera scene node from the scene. | |
| virtual void | reset () |
| Reset is called when a new race starts. More... | |
Static Protected Member Functions inherited from Camera | |
| static Camera * | createCamera (unsigned int index, CameraType type, AbstractKart *kart) |
| Creates a camera of the specified type, but does not add it to the list of all cameras. More... | |
Protected Attributes inherited from Camera | |
| scene::ICameraSceneNode * | m_camera |
| The camera scene node. | |
| AbstractKart * | m_kart |
| The kart that the camera follows. More... | |
Handles the debug camera.
Inherits from CameraNormal to make use of the smoothing function.
| Enumerator | |
|---|---|
| CM_DEBUG_TOP_OF_KART | Camera hovering over kart. |
| CM_DEBUG_GROUND | Camera at ground level, wheel debugging. |
| CM_DEBUG_BEHIND_KART | Camera straight behind kart. |
| CM_DEBUG_SIDE_OF_KART | Camera to the right of the kart. |
| CM_DEBUG_INV_SIDE_OF_KART | Camera to the left of the kart. |
| CM_DEBUG_FRONT_OF_KART | Camera to the front of the kart. |
|
private |
Determine the camera settings for the current frame.
| above_kart | How far above the camera should aim at. |
| cam_angle | Angle above the kart plane for the camera. |
| sideway | Sideway movement of the camera. |
| distance | Distance from kart. |
|
private |
Actually sets the camera based on the given parameter.
| above_kart | How far above the camera should aim at. |
| cam_angle | Angle above the kart plane for the camera. |
| sideway | Sideway movement of the camera. |
| distance | Distance from kart. |
|
virtual |
Called once per time frame to move the camera to the right position.
| dt | Time step. |
Reimplemented from CameraNormal.
|
staticprivate |