style: unify naming conventions across the project

This commit is contained in:
2026-03-07 09:51:51 +08:00
parent b372d92858
commit fc7f3e75b1
10 changed files with 216 additions and 198 deletions

View File

@@ -12,23 +12,23 @@ class Player;
class Camera {
private:
bool m_firseMouse = true;
bool m_firse_mouse = true;
Player* m_player;
float m_lastMouseX, m_lastMouseY;
glm::vec3 m_cameraPos;
float m_last_mouse_x, m_last_mouse_y;
glm::vec3 m_camera_pos;
public:
Camera();
void updateMoveCamera();
void update_move_camera();
void cameraInit(Player* player);
void camera_init(Player* player);
void updateCursorPositionCamera(double xpos, double ypos);
void update_cursor_position_camera(double xpos, double ypos);
const glm::mat4 getCameraLookAt() const;
const glm::mat4 get_camera_lookat() const;
};

View File

@@ -15,7 +15,7 @@ struct MoveState {
class Player {
private:
bool** m_blockPresent;
bool** m_block_present;
float m_yaw;
float m_pitch;
@@ -24,23 +24,23 @@ private:
float m_speed = 0.1f;
// player is tow block tall, the pos is the lower pos
glm::vec3 m_playerPos = glm::vec3(0.0f, 5.0f, 0.0f);
glm::vec3 m_player_pos = glm::vec3(0.0f, 5.0f, 0.0f);
glm::vec3 m_front = glm::vec3(0, 0, -1);
glm::vec3 m_right;
MoveState m_moveState;
MoveState m_move_state;
public:
Player();
const glm::vec3& getFront() const;
const glm::vec3& getPlayerPos() const;
const MoveState& getMoveState() const;
const glm::vec3& get_front() const;
const glm::vec3& get_player_pos() const;
const MoveState& get_move_state() const;
void init(bool** blockPresent);
void setPlayerPos(const glm::vec3& pos);
void update(float deltaTime);
void updateFrontVec(float offsetX, float offsetY);
void updatePlayerMoveState(int key, int action);
void init(bool** block_present);
void set_player_pos(const glm::vec3& pos);
void update(float delta_time);
void update_front_vec(float offset_x, float offset_y);
void update_player_move_state(int key, int action);
};

View File

@@ -1,14 +1,12 @@
#pragma once
#include <glad/glad.h>
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
#include <SOIL2.h>
#include <string>
void printShaderLog(GLuint shader);
void printProgramInfo(int prog);
bool checkOpenGLError();
std::string readShaderSource(const char* filePath);
GLuint loadTexture(const char* texImagePath);
void print_shader_log(GLuint shader);
void print_program_info(int prog);
bool check_opengl_error();
std::string read_shader_source(const char* file_path);
GLuint load_texture(const char* tex_image_path);