DubiousEngine  0.2.0
Simple Game Engine
Dubious::Renderer::Camera Class Reference

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
 
Cameraoperator= (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_spacecoordinate_space ()
 Accessor. More...
 
float & z_axis_offset ()
 Accessor. More...
 
float & max_depth ()
 Accessor - gets the max depth. More...
 

Detailed Description

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

Constructor & Destructor Documentation

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.

Parameters
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
Dubious::Renderer::Camera::Camera ( const Camera Other)
delete

Member Function Documentation

Math::Coordinate_space& Dubious::Renderer::Camera::coordinate_space ( )
inline

Accessor.

Returns the coordinate space. See above for the difference between 1st and 3rd person view

Returns
coordinate space reference
float& Dubious::Renderer::Camera::max_depth ( )
inline

Accessor - gets the max depth.

Returns
max depth reference
Camera& Dubious::Renderer::Camera::operator= ( const Camera Other)
delete
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.

Parameters
p- [in] Point to convert
Returns
The resulting vector
float& Dubious::Renderer::Camera::z_axis_offset ( )
inline

Accessor.

Returns the ZAxisOffset. See above for the difference between 1st and 3rd person view

Returns
ZAxis Offset reference

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