X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcamera.cpp;h=f4e3171b01fb2697062cbb1bea6180f00a9ec109;hb=e53a0e2e711a7d8bd9b0ddacd1360aa14370643f;hp=7bf15bf66ccc1209101ce711c2b69c5cf14d72cb;hpb=4ef32c5a4a5bdb6da8383f66d8265715eb2ed4f9;p=blank.git diff --git a/src/camera.cpp b/src/camera.cpp index 7bf15bf..f4e3171 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -8,7 +8,7 @@ namespace blank { -Camera::Camera() +Camera::Camera() noexcept : fov(PI_0p25) , aspect(1.0f) , near_clip(0.1f) @@ -18,37 +18,37 @@ Camera::Camera() } -void Camera::Viewport(int width, int height) { +void Camera::Viewport(int width, int height) noexcept { Viewport(0, 0, width, height); } -void Camera::Viewport(int x, int y, int width, int height) { +void Camera::Viewport(int x, int y, int width, int height) noexcept { glViewport(x, y, width, height); Aspect(width, height); } -void Camera::FOV(float f) { +void Camera::FOV(float f) noexcept { fov = f; UpdateProjection(); } -void Camera::Aspect(float r) { +void Camera::Aspect(float r) noexcept { aspect = r; UpdateProjection(); } -void Camera::Aspect(float w, float h) { +void Camera::Aspect(float w, float h) noexcept { Aspect(w / h); } -void Camera::Clip(float near, float far) { +void Camera::Clip(float near, float far) noexcept { near_clip = near; far_clip = far; UpdateProjection(); } -void Camera::UpdateProjection() { +void Camera::UpdateProjection() noexcept { projection = glm::perspective(fov, aspect, near_clip, far_clip); }