hx3d
1
2D/3D Simple Game Framework
|
2D/3D camera. More...
#include <camera.hpp>
Public Member Functions | |
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... | |
virtual void | update ()=0 |
Update the camera. | |
Public Attributes | |
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. | |
2D/3D camera.
Definition at line 41 of file camera.hpp.
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.
width | Viewport width |
height | Viewport height |
near | Near |
far | Far |
Definition at line 31 of file camera.cpp.
void hx3d::graphics::Camera::lookAt | ( | glm::vec3 | target | ) |
void hx3d::graphics::Camera::rotate | ( | const float | angle, |
const glm::vec3 | axis | ||
) |
Rotate the camera on one/multiple axes.
angle | Angle in degrees |
axis | Direction(s) |
Definition at line 71 of file camera.cpp.
void hx3d::graphics::Camera::rotateAround | ( | const glm::vec3 | center, |
const float | angle, | ||
const glm::vec3 | axis | ||
) |
Rotate the camera around one point, on one/multiple axes.
center | Point |
angle | Angle in degrees |
axis | Direction(s) |
Definition at line 76 of file camera.cpp.
void hx3d::graphics::Camera::translate | ( | const glm::vec3 | vec | ) |