Update material.{cc,hh}

This commit is contained in:
Eryn Wells 2014-08-09 20:31:18 -07:00
parent 42bef33775
commit 48e35dfc81
2 changed files with 22 additions and 21 deletions

View file

@ -1,11 +1,12 @@
/* material.h
*
* Materials are applied to shapes and determine color, texture mapping, shading, etc.
*
/* material.cc
* vim: set tw=80:
* Eryn Wells <eryn@erynwells.me>
*/
#include "material.h"
#include "material.hh"
using charles::basics::Color;
namespace charles {
@ -36,9 +37,8 @@ Material::SetDiffuseIntensity(const Double& kd)
}
const Color&
Color&
Material::GetDiffuseColor()
const
{
return mDiffuseColor;
}
@ -67,9 +67,8 @@ Material::SetSpecularIntensity(const Double& ks)
}
const Color&
Color&
Material::GetSpecularColor()
const
{
return mSpecularColor;
}

View file

@ -1,18 +1,20 @@
/* material.h
*
* Materials are applied to shapes and determine color, texture mapping, shading, etc.
*
/* material.hh
* vim: set tw=80:
* Eryn Wells <eryn@erynwells.me>
*/
#ifndef __MATERIAL_H__
#define __MATERIAL_H__
#ifndef __MATERIAL_HH__
#define __MATERIAL_HH__
#include "basics/basics.hh"
#include "basics.h"
#include "types.hh"
namespace charles {
/**
* Materials are applied to shapes and determine color, texture mapping,
* shading, etc.
*/
struct Material
{
enum class DiffuseShaderModel {
@ -29,14 +31,14 @@ struct Material
Double GetDiffuseIntensity() const;
void SetDiffuseIntensity(const Double& kd);
const Color& GetDiffuseColor() const;
void SetDiffuseColor(const Color& c);
basics::Color& GetDiffuseColor();
void SetDiffuseColor(const basics::Color& c);
Double GetSpecularIntensity() const;
void SetSpecularIntensity(const Double& kd);
const Color &GetSpecularColor() const;
void SetSpecularColor(const Color& c);
basics::Color& GetSpecularColor();
void SetSpecularColor(const basics::Color& c);
private:
void ClampParameter(Double& param);