1#ifndef CSCI441_PERSPECTIVE_CAMERA_HPP
2#define CSCI441_PERSPECTIVE_CAMERA_HPP
21 explicit PerspectiveCamera(GLfloat aspectRatio = 1.0f, GLfloat fovy = 45.0f, GLfloat nearClipPlane = 0.001f, GLfloat farClipPlane = 1000.0f);
28 [[maybe_unused]]
virtual void setAspectRatio(GLfloat aspectRatio)
final;
70 GLfloat _nearClipPlane;
74 GLfloat _farClipPlane;
80 const GLfloat aspectRatio,
82 const GLfloat nearClipPlane,
83 const GLfloat farClipPlane
85 _aspectRatio(aspectRatio),
86 _nearClipPlane(nearClipPlane),
87 _farClipPlane(farClipPlane)
94 _aspectRatio = aspectRatio;
95 mUpdateProjectionMatrix();
101 mUpdateProjectionMatrix();
106 _nearClipPlane = near;
107 mUpdateProjectionMatrix();
113 mUpdateProjectionMatrix();
117 mProjectionMatrix = glm::perspective(_fovy, _aspectRatio, _nearClipPlane, _farClipPlane);
Abstract Camera class to be placed (position and orientation) within our scene.
Abstract Class to represent a synthetic camera. The following methods must be overridden:
Definition: Camera.hpp:37
Abstract Class to represent a perspective camera. Stores aspect ratio and field of view.
Definition: PerspectiveCamera.hpp:11
void mUpdateProjectionMatrix()
computes the perspective projection matrix for the camera
Definition: PerspectiveCamera.hpp:116
virtual void setNearClipPlane(GLfloat near) final
updates the camera's near clip plane
Definition: PerspectiveCamera.hpp:105
virtual void setFarClipPlane(GLfloat far) final
updates the camera's far clip plane
Definition: PerspectiveCamera.hpp:111
virtual void setAspectRatio(GLfloat aspectRatio) final
updates the camera's aspect ratio
Definition: PerspectiveCamera.hpp:93
PerspectiveCamera(GLfloat aspectRatio=1.0f, GLfloat fovy=45.0f, GLfloat nearClipPlane=0.001f, GLfloat farClipPlane=1000.0f)
initializes the Perspective Camera
Definition: PerspectiveCamera.hpp:79
virtual void setVerticalFOV(GLfloat fovy) final
updates the camera's vertical field of view
Definition: PerspectiveCamera.hpp:99
CSCI441 Helper Functions for OpenGL.
Definition: ArcballCam.hpp:17