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

View file

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