CSCI441 OpenGL Library 5.17.0
CS@Mines CSCI441 Computer Graphics Course Library
Loading...
Searching...
No Matches
OrthographicCamera.hpp
Go to the documentation of this file.
1
12#ifndef CSCI441_ORTHOGRAPHIC_CAMERA_HPP
13#define CSCI441_ORTHOGRAPHIC_CAMERA_HPP
14
15#include "Camera.hpp"
16
17namespace CSCI441 {
18
23 public:
33 explicit OrthographicCamera(GLfloat minX = -1.0f, GLfloat maxX = 1.0f, GLfloat minY = -1.0f, GLfloat maxY = 1.0f, GLfloat minZ = -1.0f, GLfloat maxZ = 1.0f);
34
35 protected:
45
55
59 ~OrthographicCamera() override = default;
60
61 private:
62 void _updateProjectionMatrix();
63
64 GLfloat _minX;
65 GLfloat _maxX;
66 GLfloat _minY;
67 GLfloat _maxY;
68 GLfloat _minZ;
69 GLfloat _maxZ;
70 };
71
72}
73
75 const GLfloat minX,
76 const GLfloat maxX,
77 const GLfloat minY,
78 const GLfloat maxY,
79 const GLfloat minZ,
80 const GLfloat maxZ
81) : _minX(minX), _maxX(maxX), _minY(minY), _maxY(maxY), _minZ(minZ), _maxZ(maxZ) {
82 _updateProjectionMatrix();
83}
84
85inline void CSCI441::OrthographicCamera::_updateProjectionMatrix() {
86 mProjectionMatrix = glm::ortho( _minX, _maxX, _minY, _maxY, _minZ, _maxZ );
87}
88
89#endif//CSCI441_ORTHOGRAPHIC_CAMERA_HPP
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:39
Abstract Class to represent an orthographic camera. Stores box clip planes.
Definition: OrthographicCamera.hpp:22
OrthographicCamera(OrthographicCamera &&)=default
construct a camera by moving ane existing camera object
OrthographicCamera & operator=(OrthographicCamera &&)=default
reassign an existing camera to ourselves
OrthographicCamera(const OrthographicCamera &)=default
construct a copy an existing camera
OrthographicCamera(GLfloat minX=-1.0f, GLfloat maxX=1.0f, GLfloat minY=-1.0f, GLfloat maxY=1.0f, GLfloat minZ=-1.0f, GLfloat maxZ=1.0f)
initializes the OrthographicCamera
Definition: OrthographicCamera.hpp:74
OrthographicCamera & operator=(const OrthographicCamera &)=default
assign a copy of an existing camera
~OrthographicCamera() override=default
properly destroy concrete children
CSCI441 Helper Functions for OpenGL.
Definition: ArcballCam.hpp:17