#include "Phong.h"




void convertFromMtlToPhongMaterial(const MTLmaterial& mtlMaterial, PhongMaterial& dstPhongMaterial  )
{
	for (int i=0; i<3; ++i)
	{
		dstPhongMaterial.ambient[i]=mtlMaterial.ambient[i];
		dstPhongMaterial.specular[i]=mtlMaterial.specular[i];
		dstPhongMaterial.diffuse[i]=mtlMaterial.diffuse[i];
	}

	dstPhongMaterial.specular_exp=mtlMaterial.specular_exp;
};

PhongMaterial::PhongMaterial(void)
{
	//implicitni nastaveni aby bylo neco videt (tyto hodnoty Ka, Kd, Ks odpovidaji defaultnim hodnotam MTL formatu)
	ambient[0]=ambient[1]=ambient[2]=1.0;
	diffuse[0]=diffuse[1]=diffuse[2]=1.0;
	specular[0]=specular[1]=specular[2]=1.0;
	specular_exp=32;
}

PhongMaterial::~PhongMaterial(void)
{
}

PhongMaterial::PhongMaterial(const PhongMaterial& material)
{
	for (int i=0; i<3; ++i)
	{
		this->ambient[i]=material.ambient[i];
		this->diffuse[i]=material.diffuse[i];
		this->specular[i]=material.specular[i];
	}

	this->specular_exp=material.specular_exp;
}

MaterialType PhongMaterial::getMaterialType(void)
{
	return PHONG;
}