#include <Material.hh>

Class holds information about material. Including: diffuse, specular, refract, reflect textures and reflective, refractive, absorptive (doubles) properties. Provides means of getting material color at given point.
Definition at line 32 of file Material.hh.
Public Types | |
| enum | Filter { DIFFUSE, SPECULAR, REFRACT, REFLECT } |
| enum | Property { REFLECTIVE, REFRACTIVE, ABSORPTIVE, SHININESS, INDEX } |
Public Member Functions | |
| Material (const Texture &Diffuse=TexLib::Red(), const Texture &Specular=TexLib::White(), const Texture &Refract=TexLib::Black(), const Texture &Reflect=TexLib::Black(), Double Reflective=0.0, Double Refractive=0.0, Double Absorptive=0.9, Double Shininess=12.0, Double Index=1.0) | |
| const Texture & | GetTexture (Filter f) const |
| Double | GetProperty (Property p) const |
| Color | GetColor (Filter f, const Math::Point &UV) const |
Private Attributes | |
| const Texture & | Diffuse |
| const Texture & | Specular |
| const Texture & | Refract |
| const Texture & | Reflect |
| Double | Reflective |
| Double | Refractive |
| Double | Absorptive |
| Double | Shininess |
| Double | Index |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Material &M) |
Filter selection
Definition at line 68 of file Material.hh.
Material property selection
Definition at line 70 of file Material.hh.
| World::Material::Material | ( | const Texture & | Diffuse = TexLib::Red(), |
|
| const Texture & | Specular = TexLib::White(), |
|||
| const Texture & | Refract = TexLib::Black(), |
|||
| const Texture & | Reflect = TexLib::Black(), |
|||
| Double | Reflective = 0.0, |
|||
| Double | Refractive = 0.0, |
|||
| Double | Absorptive = 0.9, |
|||
| Double | Shininess = 12.0, |
|||
| Double | Index = 1.0 | |||
| ) | [inline] |
Creates material using default values
Definition at line 50 of file Material.hh.
Get one of material textures
Definition at line 73 of file Material.hh.
References Diffuse, Reflect, Refract, and Specular.
Referenced by GetColor().

| Double World::Material::GetProperty | ( | Property | p | ) | const [inline] |
Get material property
Definition at line 86 of file Material.hh.
References Absorptive, Index, Reflective, Refractive, and Shininess.
Referenced by World::Object::GetProperty().

| Color World::Material::GetColor | ( | Filter | f, | |
| const Math::Point & | UV | |||
| ) | const [inline] |
Get color of one material at given point
Definition at line 101 of file Material.hh.
References World::Texture::Get(), and GetTexture().
Referenced by World::Object::ColorAt().


| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Material & | M | |||
| ) | [friend] |
Pretty-printer
Definition at line 24 of file Material.cc.
const Texture& World::Material::Diffuse [private] |
Material diffuse color
Definition at line 35 of file Material.hh.
Referenced by GetTexture(), and World::operator<<().
const Texture& World::Material::Specular [private] |
Specular color
Definition at line 36 of file Material.hh.
Referenced by GetTexture(), and World::operator<<().
const Texture& World::Material::Refract [private] |
Applied to refracting rays
Definition at line 37 of file Material.hh.
Referenced by GetTexture(), and World::operator<<().
const Texture& World::Material::Reflect [private] |
Applied to reflected rays
Definition at line 38 of file Material.hh.
Referenced by GetTexture(), and World::operator<<().
Double World::Material::Reflective [private] |
How many photons are reflected
Definition at line 42 of file Material.hh.
Referenced by GetProperty().
Double World::Material::Refractive [private] |
How many photons are refracted
Definition at line 43 of file Material.hh.
Referenced by GetProperty().
Double World::Material::Absorptive [private] |
How many photons are absorbed
Definition at line 44 of file Material.hh.
Referenced by GetProperty().
Double World::Material::Shininess [private] |
Used for specular calculations in raytracer
Definition at line 45 of file Material.hh.
Referenced by GetProperty(), and World::operator<<().
Double World::Material::Index [private] |
Refractive index of material
Definition at line 46 of file Material.hh.
Referenced by GetProperty(), and World::operator<<().
1.5.5