mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
fix: PVS-Studio V550
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
3621e7ce1b
commit
ab28b4df70
4 changed files with 19 additions and 14 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "Camera.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <glm/ext.hpp>
|
||||
|
||||
#include "Window.hpp"
|
||||
|
|
@ -29,8 +30,9 @@ void Camera::rotate(float x, float y, float z) {
|
|||
}
|
||||
|
||||
glm::mat4 Camera::getProjection() {
|
||||
constexpr float epsilon = 1e-6f; // 0.000001
|
||||
float aspect = this->aspect;
|
||||
if (aspect == 0.0f) {
|
||||
if (std::fabs(aspect) < epsilon) {
|
||||
aspect = (float)Window::width / (float)Window::height;
|
||||
}
|
||||
if (perspective)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue