feat: assignment 2
This commit is contained in:
		
							
								
								
									
										46
									
								
								src/camera.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								src/camera.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,46 @@ | ||||
| #ifndef CAMERA_H_ | ||||
| #define CAMERA_H_ | ||||
|  | ||||
| #include "entity.h" | ||||
| #include "../lib/glm/glm.hpp" | ||||
|  | ||||
| class Camera : public Entity { | ||||
| public: | ||||
| 	Camera(); | ||||
|  | ||||
| 	const glm::mat4& getProjection() const | ||||
| 	{ | ||||
| 		return projection_; | ||||
| 	} | ||||
| 	void setProjection(const glm::mat4& proj) | ||||
| 	{ | ||||
| 		projection_ = proj; | ||||
| 	} | ||||
|  | ||||
| 	const glm::ivec4& getViewport() const | ||||
| 	{ | ||||
| 		return viewport_; | ||||
| 	} | ||||
| 	void setViewport(const glm::ivec4& vp) | ||||
| 	{ | ||||
| 		viewport_ = vp; | ||||
| 	} | ||||
|  | ||||
| 	const glm::vec3& getClearColor() const | ||||
| 	{ | ||||
| 		return clearColor_; | ||||
| 	} | ||||
| 	void setClearColor(const glm::vec3& color) | ||||
| 	{ | ||||
| 		clearColor_ = color; | ||||
| 	} | ||||
|  | ||||
| 	void prepare(); | ||||
|  | ||||
| private: | ||||
| 	glm::mat4  projection_; | ||||
| 	glm::ivec4 viewport_; | ||||
| 	glm::vec3  clearColor_; | ||||
| }; | ||||
|  | ||||
| #endif // CAMERA_H_ | ||||
		Reference in New Issue
	
	Block a user