too much fixes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user