fix: camera cannot pan left or right

This commit is contained in:
2026-03-21 13:07:28 +08:00
parent 772d606bbe
commit e2f0e7ea66
6 changed files with 24 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ public:
static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos);
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
static void mouse_button_callback(GLFWwindow* window, int button, int action, int mods);
static void window_focus_callback(GLFWwindow* window, int focused);
static void window_reshape_callback(GLFWwindow* window, int new_width, int new_height);
static int start_cubed_application(int argc, char** argv);

View File

@@ -25,7 +25,7 @@ public:
void update_move_camera();
void camera_init(Player* player);
void reset_camera();
void update_cursor_position_camera(double xpos, double ypos);
const glm::mat4 get_camera_lookat() const;

View File

@@ -14,8 +14,8 @@ class Player {
private:
constexpr static float ACCELERATION = 30.0f;
constexpr static float DECELERATION = 50.0f;
float m_yaw;
float m_pitch;
float m_yaw = 0.0f;
float m_pitch = 0.0f;
float m_sensitivity = 0.05f;