From 4ef32c5a4a5bdb6da8383f66d8265715eb2ed4f9 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Wed, 27 May 2015 17:22:27 +0200 Subject: [PATCH] fix dec/rad error in camera FOV --- src/camera.cpp | 4 +++- src/camera.hpp | 1 + src/geometry.hpp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/camera.cpp b/src/camera.cpp index eeb4dce..7bf15bf 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -1,5 +1,7 @@ #include "camera.hpp" +#include "geometry.hpp" + #include #include @@ -7,7 +9,7 @@ namespace blank { Camera::Camera() -: fov(45.0f) +: fov(PI_0p25) , aspect(1.0f) , near_clip(0.1f) , far_clip(256.0f) diff --git a/src/camera.hpp b/src/camera.hpp index 22e2ba5..1477a47 100644 --- a/src/camera.hpp +++ b/src/camera.hpp @@ -14,6 +14,7 @@ public: void Viewport(int width, int height); void Viewport(int x, int y, int width, int height); + /// FOV in radians void FOV(float f); void Aspect(float r); void Aspect(float w, float h); diff --git a/src/geometry.hpp b/src/geometry.hpp index 16651d8..78fe5f5 100644 --- a/src/geometry.hpp +++ b/src/geometry.hpp @@ -8,6 +8,7 @@ namespace blank { constexpr float PI = 3.141592653589793238462643383279502884; +constexpr float PI_0p25 = PI * 0.25f; constexpr float PI_0p5 = PI * 0.5f; constexpr float PI_1p5 = PI * 1.5f; constexpr float PI_2p0 = PI * 2.0f; -- 2.39.2