]> git.localhorst.tv Git - blank.git/blobdiff - src/camera.cpp
fix dec/rad error in camera FOV
[blank.git] / src / camera.cpp
index 21df87414cee2ce382a3e2014efb94187c602240..7bf15bf66ccc1209101ce711c2b69c5cf14d72cb 100644 (file)
@@ -1,5 +1,7 @@
 #include "camera.hpp"
 
+#include "geometry.hpp"
+
 #include <GL/glew.h>
 #include <glm/gtc/matrix_transform.hpp>
 
@@ -7,18 +9,11 @@
 namespace blank {
 
 Camera::Camera()
-: fov(45.0f)
+: fov(PI_0p25)
 , aspect(1.0f)
 , near_clip(0.1f)
-, far_clip(100.0f)
-, model()
-, projection(glm::perspective(fov, aspect, near_clip, far_clip))
-, view(model.Transform())
-, vp(projection * view) {
-
-}
-
-Camera::~Camera() {
+, far_clip(256.0f)
+, projection(glm::perspective(fov, aspect, near_clip, far_clip)) {
 
 }
 
@@ -55,12 +50,6 @@ void Camera::Clip(float near, float far) {
 
 void Camera::UpdateProjection() {
        projection = glm::perspective(fov, aspect, near_clip, far_clip);
-       vp = projection * view;
-}
-
-void Camera::UpdateView() {
-       view = glm::inverse(model.Transform());
-       vp = projection * view;
 }
 
 }