/* Universidade Federal Fluminense
 * Programa de Pós-Graduação em Computação
 *
 * Tópicos Avançados em Computação Visual e Interfaces II (Técnicas Avançadas de Rendering)
 * Professor: Leandro Augusto Frata Fernandes
 *
 * Version: 2012.05.05-001
 */

#ifndef _LIGHT_HEADER_
#define _LIGHT_HEADER_

// Include some custom definitions.
#include "camera.h"
#include "object.h"

// A simple abstract class for light sources.
class AbstractLight {
protected:

	AbstractLight();
	AbstractLight(const color4f& diffuse, const color4f& specular);

public:

	inline const color4f& getDiffuse() const { return m_diffuse; }
	inline const color4f& getSpecular() const { return m_specular; }

	inline void setDiffuse(const color4f& intensity) { m_diffuse = intensity; }
	inline void setSpecular(const color4f& intensity) { m_specular = intensity; }

private:

	color4f m_diffuse;
	color4f m_specular;
};

// A simple point light source.
class PointLight : public AbstractLight, public Object {
public:

	PointLight();
	PointLight(const color4f& diffuse, const color4f& specular);
	PointLight(const coord3f& location);
	PointLight(const coord3f& location, const color4f& diffuse, const color4f& specular);

public:

	void setPosition(const coord3f& location);
};

// A simple spot light source.
class SpotLight : public AbstractLight, public PinholeCamera {
public:

	SpotLight();
	SpotLight(const color4f& diffuse, const color4f& specular);
	SpotLight(const coord3f& location, const coord3f& forwardDirection, const coord3f& upDirection, const GLfloat& fovYInRadians, const GLfloat& aspectRatio, const GLfloat& zNear, const GLfloat& zFar);
	SpotLight(const coord3f& location, const coord3f& forwardDirection, const coord3f& upDirection, const GLfloat& fovYInRadians, const GLfloat& aspectRatio, const GLfloat& zNear, const GLfloat& zFar, const color4f& diffuse, const color4f& specular);
};

#endif // _LIGHT_HEADER_
