SuperTuxKart
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
CameraEnd Class Reference

Handles the end race camera. More...

#include <camera_end.hpp>

Inheritance diagram for CameraEnd:
Inheritance graph
[legend]

Classes

class  EndCameraInformation
 A class that stores information about the different end cameras which can be specified in the scene.xml file. More...
 

Public Member Functions

virtual void update (float dt) OVERRIDE
 Called once per time frame to move the camera to the right position. More...
 
- Public Member Functions inherited from CameraNormal
void snapToPosition ()
 
bool isDebug ()
 
bool isFPS ()
 
void setAmbientLight (const video::SColor &color)
 Sets the ambient light for this camera. More...
 
float getDistanceToKart () const
 
const video::SColor & getAmbientLight () const
 Returns the current ambient light. More...
 
- 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...
 
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 initial starting position for the camera.
 
virtual void activate (bool alsoActivateInIrrlicht=true)
 Sets viewport etc. More...
 
CameraType getType ()
 Returns the type of this camera. More...
 
void setFoV ()
 Sets the field of view for the irrlicht camera. More...
 
int getIndex () const
 Returns the camera index (or player kart index, which is the same). More...
 
core::matrix4 getPreviousPVMatrix () const
 Returns the project-view matrix of the previous frame. More...
 
void setPreviousPVMatrix (core::matrix4 mat)
 Returns the project-view matrix of the previous frame. More...
 
const AbstractKartgetKart () const
 Returns the kart to which this camera is attached. More...
 
AbstractKartgetKart ()
 Returns the kart to which this camera is attached. More...
 
void setAmbientLight (const video::SColor &color)
 Sets the ambient light for this camera. More...
 
const video::SColor & getAmbientLight () const
 Returns the current ambient light. More...
 
const core::recti & getViewport () const
 Returns the viewport of this camera. More...
 
const core::vector2df & getScaling () const
 Returns the scaling in x/y direction for this camera. More...
 
scene::ICameraSceneNode * getCameraSceneNode ()
 Returns the camera scene node. More...
 
Vec3 getXYZ ()
 Returs the absolute position of the camera. More...
 

Static Public Member Functions

static void readEndCamera (const XMLNode &root)
 Reads the information about the end camera. More...
 
static void clearEndCameras ()
 This function clears all end camera data structure. More...
 
- Static Public Member Functions inherited from Camera
static CameracreateCamera (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. More...
 
static CameragetCamera (unsigned int n)
 Returns a camera. More...
 
static CameragetActiveCamera ()
 Returns the currently active camera. More...
 
static void removeAllCameras ()
 Remove all cameras. More...
 

Private Member Functions

void handleEndCamera (float dt)
 
 CameraEnd (int camera_index, AbstractKart *kart)
 

Private Attributes

unsigned int m_current_end_camera
 Index of the current end camera. More...
 
unsigned int m_next_end_camera
 The next end camera to be activated. More...
 

Static Private Attributes

static AlignedArray< EndCameraInformationm_end_cameras
 List of all end camera information. More...
 

Friends

class Camera
 

Additional Inherited Members

- 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_SIMPLE_REPLAY, CM_FALLING
}
 
- 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 CameracreateCamera (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. More...
 
AbstractKartm_kart
 The kart that the camera follows. More...
 

Detailed Description

Handles the end race camera.

It inherits from CameraNormal to make use of the normal camera implementation of a reverse camera.

Member Function Documentation

◆ clearEndCameras()

void CameraEnd::clearEndCameras ( )
static

This function clears all end camera data structure.

This is necessary since all end cameras are shared between all camera instances (i.e. are static), otherwise (if no end camera is defined for a track) the old end camera structure would be used.

◆ readEndCamera()

void CameraEnd::readEndCamera ( const XMLNode root)
static

Reads the information about the end camera.

This information is shared between all cameras, so this is a static function.

Parameters
nodeThe XML node containing all end camera informations

◆ update()

void CameraEnd::update ( float  dt)
virtual

Called once per time frame to move the camera to the right position.

This function handles the end camera. It adjusts the camera position according to the current camera type, and checks if a switch to the next camera should be made.

Parameters
dtTime step size.

Reimplemented from CameraNormal.

Member Data Documentation

◆ m_current_end_camera

unsigned int CameraEnd::m_current_end_camera
private

Index of the current end camera.

◆ m_end_cameras

AlignedArray< CameraEnd::EndCameraInformation > CameraEnd::m_end_cameras
staticprivate

List of all end camera information.

This information is shared between all cameras, so it's static.

◆ m_next_end_camera

unsigned int CameraEnd::m_next_end_camera
private

The next end camera to be activated.


The documentation for this class was generated from the following files: