#pragma once

#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>

namespace Cubed {

class ClientPlayer;

class Camera {
private:
    bool m_firse_mouse = true;
    ClientPlayer* m_player;
    float m_last_mouse_x, m_last_mouse_y;
    glm::vec3 m_camera_pos;
    bool m_under_water = false;

public:
    Camera();

    void update_move_camera();

    void camera_init(ClientPlayer* player);
    void hot_reload();
    void reset_camera();
    void update_cursor_position_camera(double xpos, double ypos);

    const glm::mat4 get_camera_lookat() const;
    const glm::vec3& get_camera_pos() const;

    bool is_under_water() const;
    glm::vec3 get_camera_front() const;
};

} // namespace Cubed
