#include "camera.hpp"
+#include "geometry.hpp"
+
#include <GL/glew.h>
#include <glm/gtc/matrix_transform.hpp>
namespace blank {
Camera::Camera()
-: fov(45.0f)
+: fov(PI_0p25)
, aspect(1.0f)
, near_clip(0.1f)
-, far_clip(100.0f)
-, position(0, 0, 0)
-, target(0, 0, -1)
-, up(0, 1, 0)
-, projection(glm::perspective(fov, aspect, near_clip, far_clip))
-, view(glm::lookAt(position, target, up))
-, vp(projection * view) {
-
-}
-
-Camera::~Camera() {
+, far_clip(256.0f)
+, projection(glm::perspective(fov, aspect, near_clip, far_clip)) {
}
void Camera::UpdateProjection() {
projection = glm::perspective(fov, aspect, near_clip, far_clip);
- vp = projection * view;
-}
-
-void Camera::UpdateView() {
- view = glm::lookAt(position, target, up);
- vp = projection * view;
}
}