Game Develop C++ Platform: RuntimeCamera Class Reference

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | List of all members
RuntimeCamera Class Reference
Game engine

A camera which is displayed on a part of a window ( see Viewport related methods ) rendering an area of the scene. More...

`#include <RuntimeLayer.h>`

## Public Member Functions

| RuntimeCamera ()
| RuntimeCamera (sf::View &view)
| RuntimeCamera (gd::Camera &camera, const sf::View &defaultView)
const sf::View & | GetSFMLView () const
void | SetZoom (float newZoom)
float | GetZoom () const
void | SetRotation (float newAngle)
float | GetRotation () const
void | SetViewCenter (const sf::Vector2f &newCenter)
const sf::Vector2f & | GetViewCenter () const
void | SetSize (float width, float height)
float | GetWidth () const
float | GetHeight () const
void | SetViewport (float x1, float y1, float x2, float y2)

## Detailed Description

A camera which is displayed on a part of a window ( see Viewport related methods ) rendering an area of the scene.

## Constructor & Destructor Documentation

RuntimeCamera::RuntimeCamera | ( | ) |  |

inline

Construct a runtime camera from a nothing.

Warning
  This constructor should not be used: See the two other alternatives.

RuntimeCamera::RuntimeCamera | ( | sf::View & | view) |  |

Construct a runtime camera from a sf::View ( The SFML equivalent of a camera ).

RuntimeCamera::RuntimeCamera | ( | gd::Camera & | camera,
|  | const sf::View & | defaultView
| ) |  |

Construct a runtime camera from a Camera and a default view.

## Member Function Documentation

float RuntimeCamera::GetHeight | ( | ) |  | const

inline

Get the height of the rendered area

float RuntimeCamera::GetRotation | ( | ) |  | const

inline

Get the rotation of the camera

const sf::View& RuntimeCamera::GetSFMLView | ( | ) |  | const

inline

Provide a read only access to the sf::View associated with the camera.

const sf::Vector2f& RuntimeCamera::GetViewCenter | ( | ) |  | const

inline

Get the position of the view on the scene.

float RuntimeCamera::GetWidth | ( | ) |  | const

inline

Get the width of the rendered area

float RuntimeCamera::GetZoom | ( | ) |  | const

inline

Get the zoom of the camera

void RuntimeCamera::SetRotation | ( | float | newAngle) |  |

Set the rotation of the camera.

Parameters

  newAngle | the new angle of the camera, in radians.

void RuntimeCamera::SetSize | ( | float | width,
|  | float | height
| ) |  |

Change the size of the rendered area of the scene. Zoom is reset to 1.

void RuntimeCamera::SetViewCenter | ( | const sf::Vector2f & | newCenter) |  |

Change the position of the view on the scene.

void RuntimeCamera::SetViewport | ( | float | x1,
|  | float | y1,
|  | float | x2,
|  | float | y2
| ) |  |

Change the position of the view on the scene.

void RuntimeCamera::SetZoom | ( | float | newZoom) |  |

Change the zoom of the camera.

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

- RuntimeLayer.h
- RuntimeLayer.cpp