Фикс ортогональной камеры

This commit is contained in:
parent 87efd6fa96
commit 00c01a6354
1 changed files with 2 additions and 1 deletions

View File

@ -129,7 +129,8 @@ void Camera::setPerspective(float fovy, float aspect)
// Устанавливает заданную ортографическую матрицу
void Camera::setOrtho(float width, float height)
{
projection = glm::ortho(0.0f, width, 0.0f, height, CAMERA_NEAR, CAMERA_FAR);
const float aspect = width / height;
projection = glm::ortho(-1.0f, 1.0f, -1.0f/aspect, 1.0f/aspect, CAMERA_NEAR, CAMERA_FAR);
requiredRecalcVP = true;
}