4 #include <glm/gtc/matrix_transform.hpp>
17 , projection(glm::perspective(fov, aspect, near_clip, far_clip))
18 , view(glm::lookAt(position, target, up))
19 , vp(projection * view) {
28 void Camera::Viewport(int width, int height) {
29 Viewport(0, 0, width, height);
32 void Camera::Viewport(int x, int y, int width, int height) {
33 glViewport(x, y, width, height);
34 Aspect(width, height);
37 void Camera::FOV(float f) {
42 void Camera::Aspect(float r) {
47 void Camera::Aspect(float w, float h) {
51 void Camera::Clip(float near, float far) {
58 void Camera::UpdateProjection() {
59 projection = glm::perspective(fov, aspect, near_clip, far_clip);
60 vp = projection * view;
63 void Camera::UpdateView() {
64 view = glm::lookAt(position, target, up);
65 vp = projection * view;