#pragma once
#include <glm/glm.hpp>
#include "../shaders/Shader.h"

namespace Nebulix
{

struct PointLight
{
public:
	PointLight(glm::vec3 &position, glm::vec3 &ambient, glm::vec3 &diffuse, glm::vec3 specular, float linear = 0.09f, float quadratic = 0.032f, float constant = 1.0f)
		: position{position}, ambient{ambient}, diffuse{diffuse}, specular{specular}, linear{linear}, quadratic{quadratic}, constant{constant}
	{
	}

	/**
	Sets the values of a spot light in the shader
	name: The name of the variable in the shader. Needs to be a struct with the same components as this struct
	shader: The shader to set the values of
	*/
	void SetLight(std::string name, Shader &shader)
	{
		shader.SetFloat(name + ".position", position);

		shader.SetFloat(name + ".constant", constant);
		shader.SetFloat(name + ".linear", linear);
		shader.SetFloat(name + ".quadratic", quadratic);

		shader.SetFloat(name + ".ambient", ambient);
		shader.SetFloat(name + ".diffuse", diffuse);
		shader.SetFloat(name + ".specular", specular);
	}

	glm::vec3 position;

	float constant;
	float linear;
	float quadratic;

	glm::vec3 ambient;
	glm::vec3 diffuse;
	glm::vec3 specular;
};

}
