4 #include <glm/gtc/matrix_transform.hpp>
15 , projection(glm::perspective(fov, aspect, near_clip, far_clip))
16 , view(glm::inverse(Transform()))
26 void Camera::Viewport(int width, int height) {
27 Viewport(0, 0, width, height);
30 void Camera::Viewport(int x, int y, int width, int height) {
31 glViewport(x, y, width, height);
32 Aspect(width, height);
35 void Camera::FOV(float f) {
40 void Camera::Aspect(float r) {
45 void Camera::Aspect(float w, float h) {
49 void Camera::Clip(float near, float far) {
56 void Camera::Update(int dt) {
57 FPSController::Update(dt);
58 view = glm::inverse(Transform());
59 vp = projection * view;
62 void Camera::UpdateProjection() {
63 projection = glm::perspective(fov, aspect, near_clip, far_clip);