CSCI441 OpenGL Library 5.13.0
CS@Mines CSCI441 Computer Graphics Course Library
Loading...
Searching...
No Matches
OrthographicCamera.hpp
1#ifndef CSCI441_ORTHOGRAPHIC_CAMERA_HPP
2#define CSCI441_ORTHOGRAPHIC_CAMERA_HPP
3
4#include "Camera.hpp"
5
6namespace CSCI441 {
7
12 public:
22 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);
23
24 protected:
34
44
48 ~OrthographicCamera() override = default;
49
50 private:
51 void _updateProjectionMatrix();
52
53 GLfloat _minX;
54 GLfloat _maxX;
55 GLfloat _minY;
56 GLfloat _maxY;
57 GLfloat _minZ;
58 GLfloat _maxZ;
59 };
60
61}
62
64 const GLfloat minX,
65 const GLfloat maxX,
66 const GLfloat minY,
67 const GLfloat maxY,
68 const GLfloat minZ,
69 const GLfloat maxZ
70) : _minX(minX), _maxX(maxX), _minY(minY), _maxY(maxY), _minZ(minZ), _maxZ(maxZ) {
71 _updateProjectionMatrix();
72}
73
74inline void CSCI441::OrthographicCamera::_updateProjectionMatrix() {
75 mProjectionMatrix = glm::ortho( _minX, _maxX, _minY, _maxY, _minZ, _maxZ );
76}
77
78#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:37
Abstract Class to represent an orthographic camera. Stores box clip planes.
Definition: OrthographicCamera.hpp:11
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:63
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