too much fixes

This commit is contained in:
2026-10-18 12:07:20 -04:00
parent d84d59a444
commit 380e59c285
4 changed files with 48 additions and 37 deletions
+5 -3
View File
@@ -25,7 +25,7 @@ public:
const float originalspeed = 0.08f;
float speed = 0.08f;
float sensitivity = 0.001f;
float FOV = 90.0f;
float FOV = 100.0f;
float screenshake = 0.0f;
Camera() {}
@@ -66,8 +66,10 @@ public:
}
glm::mat4 GetProjectionMatrix(float nearPlane, float farPlane) {
return glm::perspective(glm::radians(FOV),
(float)window->width / (float)window->height, nearPlane, farPlane);
// FOV is horizontal; convert to the vertical angle glm expects so wide screens aren't stretched
const float aspect = (float)window->width / (float)window->height;
const float vfov = 2.0f * atan(tan(glm::radians(FOV) * 0.5f) / aspect);
return glm::perspective(vfov, aspect, nearPlane, farPlane);
}
void Step(float dt) {