4 #include <glm/gtc/matrix_transform.hpp>
15 , projection(glm::perspective(fov, aspect, near_clip, far_clip))
25 void Camera::Viewport(int width, int height) {
26 Viewport(0, 0, width, height);
29 void Camera::Viewport(int x, int y, int width, int height) {
30 glViewport(x, y, width, height);
31 Aspect(width, height);
34 void Camera::FOV(float f) {
39 void Camera::Aspect(float r) {
44 void Camera::Aspect(float w, float h) {
48 void Camera::Clip(float near, float far) {
55 void Camera::Update(int dt) {
57 vp = projection * glm::inverse(Transform());
60 void Camera::UpdateProjection() {
61 projection = glm::perspective(fov, aspect, near_clip, far_clip);