|
|
@ -49,20 +49,22 @@ namespace Renderer { |
|
|
|
|
|
|
|
|
|
|
|
class Camera : public Object { |
|
|
|
class Camera : public Object { |
|
|
|
public: |
|
|
|
public: |
|
|
|
glm::mat4 projection = glm::mat4(1.0f); |
|
|
|
|
|
|
|
glm::mat4 view = glm::mat4(1.0f); |
|
|
|
glm::mat4 view = glm::mat4(1.0f); |
|
|
|
|
|
|
|
float FOV; |
|
|
|
|
|
|
|
|
|
|
|
Camera(Window* win); |
|
|
|
Camera(Window* win); |
|
|
|
Camera(Window* win, glm::vec3 pos); |
|
|
|
Camera(Window* win, glm::vec3 pos); |
|
|
|
Camera(Window* win, glm::vec3 pos, glm::vec3 angle); |
|
|
|
Camera(Window* win, glm::vec3 pos, glm::vec3 angle); |
|
|
|
|
|
|
|
|
|
|
|
void setFOV(float deg); |
|
|
|
glm::mat4 getProjection(); |
|
|
|
protected: |
|
|
|
protected: |
|
|
|
Window* window; |
|
|
|
Window* window; |
|
|
|
glm::vec3 front = glm::vec3(0.0f, 0.0f, 1.0f); |
|
|
|
glm::vec3 front = glm::vec3(0.0f, 0.0f, 1.0f); |
|
|
|
glm::vec3 up = glm::vec3(0.0f, 1.0f, 0.0f); |
|
|
|
glm::vec3 up = glm::vec3(0.0f, 1.0f, 0.0f); |
|
|
|
|
|
|
|
|
|
|
|
void updateCameraTransforms(); |
|
|
|
void updateCameraTransforms(); |
|
|
|
|
|
|
|
private: |
|
|
|
|
|
|
|
glm::mat4 projection = glm::mat4(1.0f); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -90,7 +92,7 @@ namespace Renderer { |
|
|
|
void setCamera(Camera *cam); |
|
|
|
void setCamera(Camera *cam); |
|
|
|
void spawnObject(RenderObject *ro); |
|
|
|
void spawnObject(RenderObject *ro); |
|
|
|
void render(); |
|
|
|
void render(); |
|
|
|
protected: |
|
|
|
// protected:
|
|
|
|
Camera *camera; |
|
|
|
Camera *camera; |
|
|
|
private: |
|
|
|
private: |
|
|
|
std::vector<RenderObject*> renderObjects = std::vector<RenderObject*>(); |
|
|
|
std::vector<RenderObject*> renderObjects = std::vector<RenderObject*>(); |
|
|
|