Add Material class
This commit is contained in:
parent
aed523d457
commit
51c79b9b76
3 changed files with 48 additions and 0 deletions
|
@ -7,6 +7,7 @@ Import('env')
|
||||||
files = Split("""
|
files = Split("""
|
||||||
basics.cc
|
basics.cc
|
||||||
light.cc
|
light.cc
|
||||||
|
material.cc
|
||||||
object.cc
|
object.cc
|
||||||
object_sphere.cc
|
object_sphere.cc
|
||||||
scene.cc
|
scene.cc
|
||||||
|
|
23
src/material.cc
Normal file
23
src/material.cc
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/* material.h
|
||||||
|
*
|
||||||
|
* Materials are applied to shapes and determine color, texture mapping, shading, etc.
|
||||||
|
*
|
||||||
|
* Eryn Wells <eryn@erynwells.me>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "material.h"
|
||||||
|
|
||||||
|
|
||||||
|
Color
|
||||||
|
Material::get_color()
|
||||||
|
const
|
||||||
|
{
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Material::set_color(const Color &c)
|
||||||
|
{
|
||||||
|
color = c;
|
||||||
|
}
|
24
src/material.h
Normal file
24
src/material.h
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/* material.h
|
||||||
|
*
|
||||||
|
* Materials are applied to shapes and determine color, texture mapping, shading, etc.
|
||||||
|
*
|
||||||
|
* Eryn Wells <eryn@erynwells.me>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __MATERIAL_H__
|
||||||
|
#define __MATERIAL_H__
|
||||||
|
|
||||||
|
#include "basics.h"
|
||||||
|
|
||||||
|
|
||||||
|
class Material
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Color get_color();
|
||||||
|
void set_color(const Color &c);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Color color;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue