|
Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
|
This class is used for the creation of a camera. More...
#include <Camera.hpp>
Public Member Functions | |
| Camera ()=delete | |
| Camera (glm::vec3 position, glm::vec3 rotation, float fov, float aspectRatio, float zNear, float zFar) | |
| Default camera initialization. More... | |
| Camera (Camera const &other)=default | |
| Camera (Camera &&other) noexcept=default | |
| ~Camera () noexcept=default | |
| Camera & | operator= (Camera const &other)=default |
| Camera & | operator= (Camera &&other) noexcept=default |
| float | GetFoV () const |
| float | GetAspectRatio () const |
| glm::vec2 | GetClippingPlanes () const |
| glm::vec3 | GetUp () const |
| glm::vec3 | GetRight () const |
| glm::vec3 | GetPosition () const |
| glm::vec3 | GetRotation () const |
| glm::mat4x4 | GetView () const |
| glm::mat4x4 | GetProjection () const |
| glm::mat4x4 | GetViewProjection () const |
| Frustum | GetFrustum () const |
| void | SetProjection (float fov, float aspectRatio, float zNear, float zFar) |
| This function allows you to set the projection matrix of the camera. Automatically creates a projection matrix for you. More... | |
| void | SetView (glm::mat4x4 view) |
| Use this method to set the view matrix yourself. More... | |
| void | SetViewProjection (glm::mat4x4 view, float fov, float aspectRatio, float zNear, float zFar) |
| This method allows you to set the view and projection matrices of the camera. This method will simply call the SetView and SetProjection methods for you. More... | |
| void | UpdateFrustum (glm::vec3 right, glm::vec3 up) |
| This method will create a new frustum for you based on the new right and up values. More... | |
| void | UpdateRotationOffset (glm::vec2 rotationOffset) |
| This method can be used to update the rotation of the camera based on the defined offset. More... | |
| void | MoveLeft (float distanceToMove) |
| This method allows you to move X distance to the left axis of the camera. More... | |
| void | MoveRight (float distanceToMove) |
| This method allows you to move X distance to the right axis of the camera. More... | |
| void | MoveForwards (float distanceToMove) |
| This method allows you to move X distance to the forward axis of the camera. More... | |
| void | MoveBackwards (float distanceToMove) |
| This method allows you to move X distance to the backward axis of the camera. More... | |
| void | SetPostionAndRotation (glm::vec3 position, glm::vec3 rotation) |
| Use this method to set the position and the rotation of the camera. More... | |
| void | SetPosition (glm::vec3 position) |
| This method allows you to set the position of the camera. More... | |
| void | SetRotation (glm::vec3 rotation) |
| This method allows you to set the rotation of the camera. More... | |
This class is used for the creation of a camera.
Definition at line 12 of file Camera.hpp.
|
delete |
| Engine::Camera::Camera | ( | glm::vec3 | position, |
| glm::vec3 | rotation, | ||
| float | fov, | ||
| float | aspectRatio, | ||
| float | zNear, | ||
| float | zFar | ||
| ) |
Default camera initialization.
| position | Use this value to define the starting position of the camera. |
| rotation | Use this value to define the starting rotation of the camera. |
| fov | Use this value to define the field of view of the camera. |
| aspectRatio | Use this value to define the aspect ratio of the camera. |
| zNear | Use this value to define the minimal render distance from the camera to where it should start to render. |
| zFar | Use this value to define the maximal render distance from the zNear value to where it should end rendering. |
Definition at line 11 of file Camera.cpp.
|
default |
|
defaultnoexcept |
|
defaultnoexcept |
| float Engine::Camera::GetAspectRatio | ( | ) | const |
Definition at line 27 of file Camera.cpp.
| glm::vec2 Engine::Camera::GetClippingPlanes | ( | ) | const |
Definition at line 32 of file Camera.cpp.
| float Engine::Camera::GetFoV | ( | ) | const |
Definition at line 22 of file Camera.cpp.
| Frustum Engine::Camera::GetFrustum | ( | ) | const |
Definition at line 85 of file Camera.cpp.
| glm::vec3 Engine::Camera::GetPosition | ( | ) | const |
Definition at line 58 of file Camera.cpp.
| glm::mat4x4 Engine::Camera::GetProjection | ( | ) | const |
Definition at line 75 of file Camera.cpp.
| glm::vec3 Engine::Camera::GetRight | ( | ) | const |
Definition at line 42 of file Camera.cpp.
| glm::vec3 Engine::Camera::GetRotation | ( | ) | const |
Definition at line 63 of file Camera.cpp.
| glm::vec3 Engine::Camera::GetUp | ( | ) | const |
Definition at line 37 of file Camera.cpp.
| glm::mat4x4 Engine::Camera::GetView | ( | ) | const |
Definition at line 68 of file Camera.cpp.
| glm::mat4x4 Engine::Camera::GetViewProjection | ( | ) | const |
Definition at line 80 of file Camera.cpp.
| void Engine::Camera::MoveBackwards | ( | float | distanceToMove | ) |
This method allows you to move X distance to the backward axis of the camera.
| distanceToMove | expected value is postitive value of (camera movement speed * deltaTime) |
Definition at line 145 of file Camera.cpp.
| void Engine::Camera::MoveForwards | ( | float | distanceToMove | ) |
This method allows you to move X distance to the forward axis of the camera.
| distanceToMove | expected value is postitive value of (camera movement speed * deltaTime) |
Definition at line 139 of file Camera.cpp.
| void Engine::Camera::MoveLeft | ( | float | distanceToMove | ) |
This method allows you to move X distance to the left axis of the camera.
| distanceToMove | expected value is postitive value of (camera movement speed * deltaTime) |
Definition at line 127 of file Camera.cpp.
| void Engine::Camera::MoveRight | ( | float | distanceToMove | ) |
This method allows you to move X distance to the right axis of the camera.
| distanceToMove | expected value is postitive value of (camera movement speed * deltaTime) |
Definition at line 133 of file Camera.cpp.
| void Engine::Camera::SetPosition | ( | glm::vec3 | position | ) |
This method allows you to set the position of the camera.
| position | The new postion you want to use. |
Definition at line 157 of file Camera.cpp.
| void Engine::Camera::SetPostionAndRotation | ( | glm::vec3 | position, |
| glm::vec3 | rotation | ||
| ) |
Use this method to set the position and the rotation of the camera.
| position | This value is used to define the new position of the camera. |
| rotation | This value isu sed to define the new rotation of the camera. |
Definition at line 151 of file Camera.cpp.
| void Engine::Camera::SetProjection | ( | float | fov, |
| float | aspectRatio, | ||
| float | zNear, | ||
| float | zFar | ||
| ) |
This function allows you to set the projection matrix of the camera. Automatically creates a projection matrix for you.
| fov | Use this value to define the field of view of the camera. |
| aspectRatio | Use this value to define the aspect ratio of the camera. |
| zNear | Use this value to define the minimal render distance from the camera to where it should start to render. |
| zFar | Use this value to define the maximal render distance from the zNear value to where it should end rendering. |
Definition at line 90 of file Camera.cpp.
| void Engine::Camera::SetRotation | ( | glm::vec3 | rotation | ) |
This method allows you to set the rotation of the camera.
| rotation | The new rotation you want to use. |
Definition at line 162 of file Camera.cpp.
| void Engine::Camera::SetView | ( | glm::mat4x4 | view | ) |
Use this method to set the view matrix yourself.
| view | The new view matrix for the camera. |
Definition at line 100 of file Camera.cpp.
| void Engine::Camera::SetViewProjection | ( | glm::mat4x4 | view, |
| float | fov, | ||
| float | aspectRatio, | ||
| float | zNear, | ||
| float | zFar | ||
| ) |
This method allows you to set the view and projection matrices of the camera. This method will simply call the SetView and SetProjection methods for you.
| view | The new view matrix for the camera. |
| fov | Use this value to define the field of view of the camera. |
| aspectRatio | Use this value to define the aspect ratio of the camera. |
| zNear | Use this value to define the minimal render distance from the camera to where it should start to render. |
| zFar | Use this value to define the maximal render distance from the zNear value to where it should end rendering. |
Definition at line 105 of file Camera.cpp.
| void Engine::Camera::UpdateFrustum | ( | glm::vec3 | right, |
| glm::vec3 | up | ||
| ) |
This method will create a new frustum for you based on the new right and up values.
| right | The right direction of the new frustrum |
| up | The up direction of the new frustrum |
Definition at line 111 of file Camera.cpp.
| void Engine::Camera::UpdateRotationOffset | ( | glm::vec2 | rotationOffset | ) |
This method can be used to update the rotation of the camera based on the defined offset.
| rotationOffset |
Definition at line 116 of file Camera.cpp.
1.8.11