12#ifndef CSCI441_FREE_CAM_HPP
13#define CSCI441_FREE_CAM_HPP
15#include "PerspectiveCamera.hpp"
33 explicit FreeCam(GLfloat aspectRatio = 1.0f, GLfloat fovy = 45.0f, GLfloat nearClipPlane = 0.001f, GLfloat farClipPlane = 1000.0f);
60 void _updateFreeCameraViewMatrix();
65 const GLfloat aspectRatio,
67 const GLfloat nearClipPlane,
68 const GLfloat farClipPlane
76 mCameraDirection.x = glm::sin(mCameraTheta ) * glm::sin(mCameraPhi );
77 mCameraDirection.y = -glm::cos(mCameraPhi );
78 mCameraDirection.z = -glm::cos(mCameraTheta ) * glm::sin(mCameraPhi );
81 mCameraDirection = glm::normalize(mCameraDirection );
83 _updateFreeCameraViewMatrix();
87 mCameraPosition += mCameraDirection * movementFactor;
88 _updateFreeCameraViewMatrix();
92 mCameraPosition -= mCameraDirection * movementFactor;
93 _updateFreeCameraViewMatrix();
96inline void CSCI441::FreeCam::_updateFreeCameraViewMatrix() {
97 setLookAtPoint(mCameraPosition + mCameraDirection );
A camera that implements a FreeCam camera model.
Definition: FreeCam.hpp:23
FreeCam(GLfloat aspectRatio=1.0f, GLfloat fovy=45.0f, GLfloat nearClipPlane=0.001f, GLfloat farClipPlane=1000.0f)
Definition: FreeCam.hpp:64
void moveForward(GLfloat movementFactor) final
updates the camera's position by the adding the camera's direction to the camera's position
Definition: FreeCam.hpp:86
void moveBackward(GLfloat movementFactor) final
updates the camera's position by the adding the camera's negative direction to the camera's position
Definition: FreeCam.hpp:91
void recomputeOrientation() final
converts spherical theta & phi to cartesian x,y,z direction vector
Definition: FreeCam.hpp:74
Abstract Class to represent a perspective camera. Stores aspect ratio and field of view.
Definition: PerspectiveCamera.hpp:11
CSCI441 Helper Functions for OpenGL.
Definition: ArcballCam.hpp:17