CSCI441 OpenGL Library 5.9.0
CS@Mines CSCI441 Computer Graphics Course Library
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
CSCI441::MD5Camera Class Referencefinal

A camera that implements the MD5Camera specification. More...

#include <MD5Camera.hpp>

Inheritance diagram for CSCI441::MD5Camera:
CSCI441::Camera

Public Types

enum class  AdvancementStrategy { RUN_SINGLE_CUT , LOOP_SINGLE_CUT , RUN_ALL_CUTS , LOOP_ALL_CUTS }
 what to do when the end of a cut is reached More...
 

Public Member Functions

 MD5Camera ()=delete
 must create camera object from parameterized constructor
 
 MD5Camera (const char *MD5CAMERA_FILE, AdvancementStrategy advancementStrategy, GLuint firstCutToRun=0, GLfloat aspectRatio=1.0f, GLfloat fovy=45.0f, GLfloat nearClipPlane=0.001f, GLfloat farClipPlane=1000.0f, GLboolean INFO=true, GLboolean ERRORS=true)
 
 MD5Camera (const MD5Camera &)
 deep copy another MD5Camera
 
MD5Cameraoperator= (const MD5Camera &)
 deep copy another MD5Camera
 
 ~MD5Camera () final
 delete cuts and frames
 
void recomputeOrientation () final
 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.
 
void moveForward (GLfloat unused) final
 steps forward along the camera's view
 
void moveBackward (GLfloat unused) final
 steps backward along the camera's view
 
- Public Member Functions inherited from CSCI441::Camera
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
 
GLfloat getRadius () const
 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

- Protected Member Functions inherited from CSCI441::Camera
 Camera ()
 create a default camera at the origin, looking down the negative Z axis oriented with the world coordinate system
 
- Protected Attributes inherited from CSCI441::Camera
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
 

Detailed Description

A camera that implements the MD5Camera specification.

Note
camera direction is controlled by file contents

Member Enumeration Documentation

◆ AdvancementStrategy

what to do when the end of a cut is reached

Enumerator
RUN_SINGLE_CUT 

run through just the initial specified cut, stop when end is reached

LOOP_SINGLE_CUT 

run through just the initial specified cut, looping back to the beginning when the end is reached

RUN_ALL_CUTS 

run through all cuts beginning at initial specified cut, advancing to next cut when the end of the current cut is reached and stopping at the end of the last cut

LOOP_ALL_CUTS 

run through all cuts beginning at initial specified cut, advancing to next cut when the end of the current cut is reached and looping to the first cut when the last cut is completed

Constructor & Destructor Documentation

◆ MD5Camera()

CSCI441::MD5Camera::MD5Camera ( const char *  MD5CAMERA_FILE,
AdvancementStrategy  advancementStrategy,
GLuint  firstCutToRun = 0,
GLfloat  aspectRatio = 1.0f,
GLfloat  fovy = 45.0f,
GLfloat  nearClipPlane = 0.001f,
GLfloat  farClipPlane = 1000.0f,
GLboolean  INFO = true,
GLboolean  ERRORS = true 
)
inlineexplicit

creates a MD5Camera object with the specified initial perspective projection

Parameters
MD5CAMERA_FILEfilename of .md5camera file to load
advancementStrategywhat to do after last frame of cut - one of RUN_SINGLE_CUT, LOOP_SINGLE_CUT, RUN_ALL_CUTS, LOOP_ALL_CUTS
firstCutToRunindex of first cut scene to run (defaults to 0)
aspectRatioaspect ratio of view plane (defaults to 1.0f)
fovyvertical field of view (defaults to 45.0f)
nearClipPlanenear z clip plane (defaults to 0.001f)
farClipPlanefar z clip plane (defaults to 1000.0f)
INFOif file loading information should be printed to standard out (defaults to true)
ERRORSif file loading errors should be printed to standard error (defaults to true)
Note
field of view specified in degrees

Member Function Documentation

◆ moveBackward()

void CSCI441::MD5Camera::moveBackward ( GLfloat  movementFactor)
inlinefinalvirtual

steps backward along the camera's view

Parameters
movementFactorscaling factor for distance to move

Implements CSCI441::Camera.

◆ moveForward()

void CSCI441::MD5Camera::moveForward ( GLfloat  movementFactor)
inlinefinalvirtual

steps forward along the camera's view

Parameters
movementFactorscaling factor for distance to move

Implements CSCI441::Camera.

◆ operator=()

CSCI441::MD5Camera & CSCI441::MD5Camera::operator= ( const MD5Camera OTHER)
inline

deep copy another MD5Camera

Returns

◆ recomputeOrientation()

void CSCI441::MD5Camera::recomputeOrientation ( )
inlinefinalvirtual

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.

Implements CSCI441::Camera.


The documentation for this class was generated from the following file: