From c97d9b2568240f35c80ececdf116e8928546fc8d Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Fri, 24 Jan 2025 16:28:06 +0300 Subject: [PATCH] twn_draw.c: fix upper limit for camera fov warn --- src/rendering/twn_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rendering/twn_draw.c b/src/rendering/twn_draw.c index f2a9ffd..853d931 100644 --- a/src/rendering/twn_draw.c +++ b/src/rendering/twn_draw.c @@ -414,7 +414,7 @@ void render(void) { void draw_camera(Vec3 position, float fov, Vec3 up, Vec3 direction) { - if (fabsf(0.0f - fov) < 0.00001f || fov > (M_PIf / 2)) + if (fabsf(0.0f - fov) < 0.00001f || fov >= M_PIf) log_warn("Invalid fov given (%f)", (double)fov); Camera const camera = { @@ -431,7 +431,7 @@ void draw_camera(Vec3 position, float fov, Vec3 up, Vec3 direction) { /* TODO: https://stackoverflow.com/questions/62493770/how-to-add-roll-in-camera-class */ DrawCameraFromPrincipalAxesResult draw_camera_from_principal_axes(Vec3 position, float fov, float roll, float pitch, float yaw) { - if (fabsf(0.0f - fov) < 0.00001f || fov > (M_PIf / 2)) + if (fabsf(0.0f - fov) < 0.00001f || fov >= M_PIf) log_warn("Invalid fov given (%f)", (double)fov); (void)roll;