wertergfdv

This commit is contained in:
2026-10-18 12:09:24 -04:00
parent 380e59c285
commit 36f6aa24f0
+3 -2
View File
@@ -66,9 +66,10 @@ public:
}
glm::mat4 GetProjectionMatrix(float nearPlane, float farPlane) {
// FOV is horizontal; convert to the vertical angle glm expects so wide screens aren't stretched
// Quake Pro style: FOV is the horizontal angle on a 4:3 screen, so the vertical angle is fixed
// and wider windows/fullscreen reveal more to the sides instead of zooming in.
const float aspect = (float)window->width / (float)window->height;
const float vfov = 2.0f * atan(tan(glm::radians(FOV) * 0.5f) / aspect);
const float vfov = 2.0f * atan(tan(glm::radians(FOV) * 0.5f) * 3.0f / 4.0f);
return glm::perspective(vfov, aspect, nearPlane, farPlane);
}