Hierarchical Edge Bundle 1.0
|
00001 #pragma once 00002 #include "glm/glm.hpp" 00003 00004 using glm::vec3; 00005 using glm::mat4; 00006 00007 class Camera 00008 { 00009 public: 00011 Camera(float zNear, float zFar, float fovyAngle, float aspect); 00013 Camera(float left, float right, float bottom, float top, float near, float far); 00015 ~Camera(); 00016 00018 mat4 getViewingMatrix() const; 00020 void setViewingMatrix(mat4 matrix); 00022 mat4 getProjectionMatrix(); 00024 const vec3 getPosition() const; 00025 00027 void lookAt(vec3 position, vec3 upVector, vec3 lookAtVector); 00029 void perspective(float zNear, float zFar, float fovy, float aspect); 00031 void orthogonal(float left, float right, float bottom, float top, float near, float far); 00032 00037 void setScreenWidth(float width); 00038 00043 float getScreenWidth(); 00044 00049 void setScreenHeight(float height); 00050 00055 float getScreenHeight(); 00056 00061 void setNearplane(float near); 00062 00067 void setFarplane(float far); 00068 00073 void updateOrthogonalView(); 00074 00079 void updatePerspectiveView(); 00080 00085 void setZoomFactor(float zoom); 00086 00088 float getZoomFactor(); 00089 00091 void zoomIn(); 00092 00094 void zoomOut(); 00095 00096 private: 00098 float screenWidth; 00100 float screenHeight; 00102 float nearplane; 00104 float farplane; 00106 float fovy; 00108 float zoomFactor; 00109 00111 mat4 viewingMatrix; 00113 mat4 projectionMatrix; 00114 00115 };