CSCI441 OpenGL Library 5.17.0
CS@Mines CSCI441 Computer Graphics Course Library
|
A camera that implements a FreeCam camera model. More...
#include <FreeCam.hpp>
Public Member Functions | |
FreeCam (GLfloat aspectRatio=1.0f, GLfloat fovy=45.0f, GLfloat nearClipPlane=0.001f, GLfloat farClipPlane=1000.0f) | |
FreeCam (const FreeCam &)=default | |
construct a copy an existing camera | |
FreeCam & | operator= (const FreeCam &)=default |
assign a copy of an existing camera | |
FreeCam (FreeCam &&)=default | |
construct a camera by moving ane existing camera object | |
FreeCam & | operator= (FreeCam &&)=default |
reassign an existing camera to ourselves | |
~FreeCam () override=default | |
properly destroy concrete children | |
void | recomputeOrientation () override |
converts spherical theta & phi to cartesian x,y,z direction vector | |
void | moveForward (GLfloat movementFactor) override |
updates the camera's position by the adding the camera's direction to the camera's position | |
void | moveBackward (GLfloat movementFactor) override |
updates the camera's position by the adding the camera's negative direction to the camera's position | |
![]() | |
PerspectiveCamera (GLfloat aspectRatio=1.0f, GLfloat fovy=45.0f, GLfloat nearClipPlane=0.001f, GLfloat farClipPlane=1000.0f) | |
initializes the Perspective Camera | |
~PerspectiveCamera () override=default | |
properly destroy concrete children | |
virtual void | setAspectRatio (GLfloat aspectRatio) final |
updates the camera's aspect ratio | |
virtual void | setVerticalFOV (GLfloat fovy) final |
updates the camera's vertical field of view | |
virtual void | setNearClipPlane (GLfloat near) final |
updates the camera's near clip plane | |
virtual void | setFarClipPlane (GLfloat far) final |
updates the camera's far clip plane | |
![]() | |
virtual | ~Camera ()=default |
properly destroy concrete children | |
virtual void | recomputeOrientation ()=0 |
Uses theta, phi, & radius to update the camera's view matrix parameters. The camera orientation is controlled via spherical coordinates and this method would orient and/or position the camera in cartesian coordinates. | |
virtual void | moveForward (GLfloat movementFactor)=0 |
steps forward along the camera's view | |
virtual void | moveBackward (GLfloat movementFactor)=0 |
steps backward along the camera's view | |
virtual void | rotate (GLfloat dTheta, GLfloat dPhi) |
rotates the camera's POV by adding to theta & phi then ensuring phi stays within the (0, pi) range and finally calls through to recomputeOrientation() to update the view parameters after the rotation | |
virtual void | computeViewMatrix () final |
creates the View Matrix based on the position, lookAt point, and up vector | |
virtual glm::mat4 | getProjectionMatrix () const final |
returns the current projection matrix for the associated camera | |
virtual glm::mat4 | getViewMatrix () const final |
returns the current view matrix for the associated camera | |
virtual glm::vec3 | getPosition () const final |
returns the current camera position in world space | |
virtual glm::vec3 | getLookAtPoint () const final |
returns the current lookAt point in world space | |
virtual glm::vec3 | getUpVector () const final |
returns the current up vector in world space | |
virtual GLfloat | getTheta () const final |
returns the current theta value in radians | |
virtual GLfloat | getPhi () const final |
returns the current phi value in radians | |
virtual GLfloat | getRadius () const final |
returns the current radius in world space | |
virtual void | setPosition (const glm::vec3 pos) final |
sets the camera's position in world space | |
virtual void | setLookAtPoint (const glm::vec3 lookAt) final |
sets the camera's lookAt point in world space | |
virtual void | setUpVector (const glm::vec3 up) final |
sets the camera's up vector in world space | |
virtual void | setTheta (const GLfloat t) final |
sets the camera's theta angle in radians | |
virtual void | setPhi (const GLfloat p) final |
sets the camera's phi angle in radians | |
virtual void | setRadius (const GLfloat r) final |
sets the camera's radius in world space | |
Additional Inherited Members | |
![]() | |
void | mUpdateProjectionMatrix () |
computes the perspective projection matrix for the camera | |
PerspectiveCamera (const PerspectiveCamera &)=default | |
construct a copy an existing camera | |
PerspectiveCamera & | operator= (const PerspectiveCamera &)=default |
assign a copy of an existing camera | |
PerspectiveCamera (PerspectiveCamera &&)=default | |
construct a camera by moving ane existing camera object | |
PerspectiveCamera & | operator= (PerspectiveCamera &&)=default |
reassign an existing camera to ourselves | |
![]() | |
Camera () | |
create a default camera at the origin, looking down the negative Z axis oriented with the world coordinate system | |
Camera (const Camera &)=default | |
construct a copy an existing camera | |
Camera & | operator= (const Camera &)=default |
assign a copy of an existing camera | |
Camera (Camera &&)=default | |
construct a camera by moving ane existing camera object | |
Camera & | operator= (Camera &&)=default |
reassign an existing camera to ourselves | |
![]() | |
glm::mat4 | mProjectionMatrix |
stores the Projection Matrix | |
glm::mat4 | mViewMatrix |
stores the View Matrix corresponding to the inverse of the Camera's Matrix | |
glm::vec3 | mCameraPosition |
the cartesian position in world space of the camera | |
glm::vec3 | mCameraDirection |
the cartesian direction the camera is facing in world space | |
glm::vec3 | mCameraLookAtPoint |
the world space point in front of the camera | |
glm::vec3 | mCameraUpVector |
the up vector of the camera specified in world space | |
GLfloat | mCameraTheta |
spherical angle for yaw direction in radians | |
GLfloat | mCameraPhi |
spherical angle for pitch direction in radians | |
GLfloat | mCameraRadius |
spherical magnitude for direction in world space | |
A camera that implements a FreeCam camera model.
|
inlineexplicit |
creates a FreeCam object with the specified perspective projection
aspectRatio | aspect ratio of view plane (defaults to 1.0f) |
fovy | vertical field of view (defaults to 45.0f) |
nearClipPlane | near z clip plane (defaults to 0.001f) |
farClipPlane | far z clip plane (defaults to 1000.0f) |
|
inlineoverridevirtual |
updates the camera's position by the adding the camera's negative direction to the camera's position
movementFactor | distance factor to scale the movement step |
Implements CSCI441::Camera.
|
inlineoverridevirtual |
updates the camera's position by the adding the camera's direction to the camera's position
movementFactor | distance factor to scale the movement step |
Implements CSCI441::Camera.
assign a copy of an existing camera
reassign an existing camera to ourselves
|
inlineoverridevirtual |
converts spherical theta & phi to cartesian x,y,z direction vector
Implements CSCI441::Camera.