+ | Basic camera but glitched for now

This commit is contained in:
TheRedShip
2024-12-21 21:17:35 +01:00
parent d92b2ca913
commit df44327436
10 changed files with 93 additions and 25 deletions

View File

@ -23,10 +23,13 @@ class Camera
~Camera(void);
void update_camera_vectors();
glm::mat4 get_view_matrix();
glm::vec3 get_position();
void process_movement(float xoffset, float yoffset, bool constrainPitch);
void process_mouse(float xoffset, float yoffset, bool constrainPitch);
void process_keyboard(bool forward, bool backward, bool left, bool right, bool up, bool down);
private:
glm::vec3 _position;

View File

@ -18,6 +18,8 @@
# include "glm/glm.hpp"
# include "glm/gtc/matrix_transform.hpp"
# include "glm/gtc/type_ptr.hpp"
# include "glad/gl.h"
# include "GLFW/glfw3.h"

View File

@ -34,10 +34,10 @@ class Shader
// void setBool(const std::string &name, bool value) const;
// void setInt(const std::string &name, int value) const;
// void setFloat(const std::string &name, float value) const;
void setVec2f(const std::string &name, const glm::vec2 &value) const;
// void setVec3(const std::string &name, const RT::Vec3f &value) const;
void set_vec2(const std::string &name, const glm::vec2 &value) const;
void set_vec3(const std::string &name, const glm::vec3 &value) const;
// void setVec4(const std::string &name, const RT::Vec4f &value) const;
// void setMat4(const std::string &name, const RT::Mat4f &value) const;
void set_mat4(const std::string &name, const glm::mat4 &value) const;
GLuint getProgram(void) const;

View File

@ -24,6 +24,7 @@ class Window
~Window(void);
GLFWwindow *getWindow(void) const;
Camera *get_camera(void) const;
float getFps(void) const;
void display();
@ -36,7 +37,7 @@ class Window
private:
GLFWwindow *_window;
Camera *camera;
Camera *_camera;
float _fps;