hx3d  1
2D/3D Simple Game Framework
Public Member Functions | Public Attributes | List of all members
hx3d::graphics::PerspectiveCamera Class Reference

3D perspective camera. More...

#include <perspective_camera.hpp>

Public Member Functions

 PerspectiveCamera (const float near, const float far)
 Create a perspective camera with the screen size and the near and far. More...
 
 PerspectiveCamera (const float width, const float height, const float near, const float far)
 Create a perspective camera with a viewport width and height. More...
 
 PerspectiveCamera (const float width, const float height, const float near, const float far, const float fov)
 Create a perspective camera with a viewport width and height, and a custom field of view. More...
 
virtual void update () override
 Update the camera.
 
- Public Member Functions inherited from hx3d::graphics::Camera
 Camera (const float width, const float height, const float near, const float far)
 Create a camera with a viewport width and height. More...
 
void lookAt (glm::vec3 target)
 Look at target. More...
 
void translate (const glm::vec3 vec)
 Translate the camera. More...
 
void rotate (const float angle, const glm::vec3 axis)
 Rotate the camera on one/multiple axes. More...
 
void rotateAround (const glm::vec3 center, const float angle, const glm::vec3 axis)
 Rotate the camera around one point, on one/multiple axes. More...
 

Public Attributes

float fieldOfView
 Field of view (FOV)
 
- Public Attributes inherited from hx3d::graphics::Camera
glm::vec3 position
 Camera position.
 
glm::vec3 direction
 Camera direction.
 
glm::vec3 up
 Camera up vector.
 
glm::mat4 projection
 Projection matrix.
 
glm::mat4 view
 View matrix.
 
float near
 Near pane.
 
float far
 Far pane.
 
float viewportWidth
 Viewport width.
 
float viewportHeight
 Viewport height.
 

Detailed Description

3D perspective camera.

Definition at line 34 of file perspective_camera.hpp.

Constructor & Destructor Documentation

hx3d::graphics::PerspectiveCamera::PerspectiveCamera ( const float  near,
const float  far 
)

Create a perspective camera with the screen size and the near and far.

The default field of view is 70.

Parameters
nearNear
farFar

Definition at line 33 of file perspective_camera.cpp.

hx3d::graphics::PerspectiveCamera::PerspectiveCamera ( const float  width,
const float  height,
const float  near,
const float  far 
)

Create a perspective camera with a viewport width and height.

The default field of view is 70.

Parameters
widthViewport width
heightViewport height
nearNear
farFar

Definition at line 37 of file perspective_camera.cpp.

hx3d::graphics::PerspectiveCamera::PerspectiveCamera ( const float  width,
const float  height,
const float  near,
const float  far,
const float  fov 
)

Create a perspective camera with a viewport width and height, and a custom field of view.

Parameters
widthViewport width
heightViewport height
nearNear
farFar
fovField of view

Definition at line 41 of file perspective_camera.cpp.


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