mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-22 02:27:01 +08:00
feat: add camera and player class
This commit is contained in:
@@ -6,24 +6,30 @@
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
class Player;
|
||||
|
||||
|
||||
class Camera {
|
||||
private:
|
||||
|
||||
bool m_firseMouse = true;
|
||||
Player* m_player;
|
||||
float m_lastMouseX, m_lastMouseY;
|
||||
glm::vec3 m_cameraPos;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
Camera();
|
||||
|
||||
void updateMoveCamera();
|
||||
|
||||
void cameraInit(Player* player);
|
||||
|
||||
void updateCursorPositionCamera(double xpos, double ypos);
|
||||
|
||||
const glm::mat4 getCameraLookAt() const;
|
||||
|
||||
struct MoveState {
|
||||
bool forward = false;
|
||||
bool back = false;
|
||||
bool left = false;
|
||||
bool right = false;
|
||||
bool down = false;
|
||||
bool up = false;
|
||||
};
|
||||
|
||||
void updateMoveCamera();
|
||||
|
||||
void cameraInit();
|
||||
|
||||
void changeView(float offsetX, float offsetY);
|
||||
|
||||
void updateCursorPositionCamera(double xpos, double ypos);
|
||||
|
||||
glm::mat4 getCameraLookAt();
|
||||
|
||||
void updateCameraKey(int key, int action);
|
||||
|
||||
Reference in New Issue
Block a user