|
DubiousEngine
0.2.0
Simple Game Engine
|
Abstraction of a camera. More...
#include <Camera.h>
Public Member Functions | |
| Camera (int x, int y, int width, int height, float fovy) | |
| Constructor. More... | |
| Camera (const Camera &Other)=delete | |
| Camera & | operator= (const Camera &Other)=delete |
| void | ready_for_photo () const |
| Prepare Camera for rendering. More... | |
| Math::Point | unproject (const std::pair< int, int > &p) const |
| Unroject a 2D point. More... | |
| Math::Coordinate_space & | coordinate_space () |
| Accessor. More... | |
| float & | z_axis_offset () |
| Accessor. More... | |
| float & | max_depth () |
| Accessor - gets the max depth. More... | |
Abstraction of a camera.
Handles pointing the camera and readying the scene for drawing. This camera can work as a first or third person camera. If you set the ZAxisOffset to 0 then the coordinate space is centered in the camera and any rotations will turn the camera directly. If ZAxisOffset is not 0 then it is the distance from the camera to the coordinate space along the Z axis. In this mode, rotations to the coordinate space will circle the camera around the target
| Dubious::Renderer::Camera::Camera | ( | int | x, |
| int | y, | ||
| int | width, | ||
| int | height, | ||
| float | fovy | ||
| ) |
Constructor.
Creates a camera at position (0,0,0) looking down the positive Z axis in first person mode.
| x | - [in] the viewport X |
| y | - [in] the viewport Y |
| width | - [in] the viewport Width |
| height | - [in] the viewport Height |
| fovy | - [in] The Field Of View Y axis |
|
delete |
|
inline |
Accessor.
Returns the coordinate space. See above for the difference between 1st and 3rd person view
|
inline |
Accessor - gets the max depth.
| void Dubious::Renderer::Camera::ready_for_photo | ( | ) | const |
Prepare Camera for rendering.
This function should be the first thing called during the drawing function. It applies the camera information to the OpenGL buffers.
| Math::Point Dubious::Renderer::Camera::unproject | ( | const std::pair< int, int > & | p | ) | const |
Unroject a 2D point.
Takes the given 2D point and converts it into a point in 3D space.
| p | - [in] Point to convert |
|
inline |
Accessor.
Returns the ZAxisOffset. See above for the difference between 1st and 3rd person view