hx3d
1
2D/3D Simple Game Framework
|
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. | |
![]() | |
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) | |
![]() | |
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. | |
3D perspective camera.
Definition at line 34 of file perspective_camera.hpp.
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.
near | Near |
far | Far |
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.
width | Viewport width |
height | Viewport height |
near | Near |
far | Far |
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.
width | Viewport width |
height | Viewport height |
near | Near |
far | Far |
fov | Field of view |
Definition at line 41 of file perspective_camera.cpp.