#pragma once
#ifndef CAMERA_H
#define CAMERA_H

#include <vector>
#include <sstream>

#include <glad/glad.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <GLFW/glfw3.h>

#include <GameObject.h>
#include <MeshRenderer.h>
#include <LevelMap.h>
#include <PointLight.h>

const float YAW = -90.0f;
const float PITCH = 0.0f;
const float SPEED = 5.0f;
const float MOUSE_SENSITIVITY = 0.1f;
const float ZOOM = 45.0f;

class Camera : public GameObject
{
	glm::vec3 Offset;

	float Yaw;
	float Pitch;

	float MovementSpeed;
	float MouseSensitivity;
	float Zoom;

	GLFWwindow* Window;

public:
	Camera(GLFWwindow* Window);
	~Camera() = default;

	glm::mat4 GetViewMatrix();
	void SetOffset(glm::vec3 Offset);
	void MoveCamera(glm::vec3 Position);
	void RotateCamera(float Yaw, float Pitch, GLboolean bConstrainPitch = true);
	void ZoomCamera(float ZoomAmount);
	void RenderScene(
		LevelMap& LevelMap,
		const std::vector<PointLight>& Lights,
		int ScreenWidth,
		int ScreenHeight
	);
	glm::mat4 GetProjectionMatrix(int ScreenWidth, int ScreenHeight);
};

#endif