#include "light_spot.h"

namespace CBK
{
	namespace Lights
	{
		Spot::Spot(IDirect3DDevice9* device) : Light(device)
		{
			setType(D3DLIGHT_SPOT);
		}

		Spot::~Spot(void)
		{
		}

		Spot& Spot::setCones(const float& theta, const float& phi, const float& falloff)
		{
			light.Theta = theta;
			light.Phi = phi;
			light.Falloff = falloff;

			return *this;
		}


		Spot& Spot::setAttenuation(const float& constant, const float& linear, const float& quadratic)
		{
			light.Attenuation0 = constant;
			light.Attenuation1 = linear;
			light.Attenuation2 = quadratic;

			return *this;
		}

		Spot& Spot::setFalloff(const float& falloff)
		{
			light.Falloff = falloff;

			return *this;
		}

		Spot& Spot::setPosition(const D3DVECTOR& position)
		{
			light.Position = position;

			return *this;
		}

		Spot& Spot::setDirection(const D3DVECTOR& direction)
		{
			light.Direction = direction;

			return *this;
		}
	}
}