General refactor

This commit is contained in:
MihailRis
2023-11-30 04:30:40 +03:00
parent de134dc2e5
commit 1d5037893c
27 changed files with 558 additions and 419 deletions
+4
View File
@@ -3,6 +3,10 @@
#include <glm/ext.hpp>
using glm::vec3;
using glm::vec4;
using glm::mat4;
Camera::Camera(vec3 position, float fov) : position(position), fov(fov), zoom(1.0f), rotation(1.0f) {
updateVectors();
}
+10 -11
View File
@@ -2,30 +2,29 @@
#define WINDOW_CAMERA_H_
#include <glm/glm.hpp>
using namespace glm;
class Camera {
void updateVectors();
public:
vec3 front;
vec3 up;
vec3 right;
vec3 dir;
glm::vec3 front;
glm::vec3 up;
glm::vec3 right;
glm::vec3 dir;
vec3 position;
glm::vec3 position;
float fov;
float zoom;
mat4 rotation;
glm::mat4 rotation;
bool perspective = true;
bool flipped = false;
float aspect = 0.0f;
Camera(vec3 position, float fov);
Camera(glm::vec3 position, float fov);
void rotate(float x, float y, float z);
mat4 getProjection();
mat4 getView(bool position=true);
mat4 getProjView();
glm::mat4 getProjection();
glm::mat4 getView(bool position=true);
glm::mat4 getProjView();
};
#endif /* WINDOW_CAMERA_H_ */