#include <WoodMaterial.h>
Public Member Functions | |
WoodMaterial (const Point3D &org, const Vec3D &dir, const RGBColor &light, const RGBColor &light) | |
virtual | ~WoodMaterial () |
virtual RGBColor | sample (const Vec3D &wOut, const Vec3D &wInc, Intersection &is) |
virtual RGBColor | sampleDiffuse (const Vec3D &wOut, const Vec3D &wInc, Intersection &is) |
virtual RGBColor | sampleSpecular (const Vec3D &wOut, const Vec3D &wInc, Intersection &is) |
virtual RGBColor | getEmitted (const Vec3D &wOut, Intersection &is) |
virtual ScatterEvent | scatterPhoton (Intersection &is, Photon *photon) |
virtual bool | hasDiffuse () const |
virtual bool | hasSpecular () const |
virtual bool | hasTransmissive () const |
virtual bool | refracts () const |
Vec3D | getShadingNormal (Intersection &is) const |
Private Attributes | |
WoodTexture | wood |
Definition at line 10 of file WoodMaterial.h.
rcrt::WoodMaterial::WoodMaterial | ( | const Point3D & | org, | |
const Vec3D & | dir, | |||
const RGBColor & | light, | |||
const RGBColor & | light | |||
) |
Definition at line 6 of file WoodMaterial.cpp.
rcrt::WoodMaterial::~WoodMaterial | ( | ) | [virtual] |
Definition at line 11 of file WoodMaterial.cpp.
RGBColor rcrt::WoodMaterial::sample | ( | const Vec3D & | wOut, | |
const Vec3D & | wInc, | |||
Intersection & | is | |||
) | [virtual] |
wOut | The outgoing direction. | |
wInc | The incoming direction. | |
is | The Intersection data. |
Implements rcrt::Material.
Definition at line 16 of file WoodMaterial.cpp.
References rcrt::WoodTexture::getColor(), rcrt::Intersection::getPosition(), rcrt::RGBAColor::getRGB(), and wood.
Referenced by sampleDiffuse().
RGBColor rcrt::WoodMaterial::sampleDiffuse | ( | const Vec3D & | wOut, | |
const Vec3D & | wInc, | |||
Intersection & | is | |||
) | [virtual] |
wOut | The outgoing direction. | |
wInc | The incoming direction. | |
is | The Intersection data. |
Implements rcrt::Material.
Definition at line 26 of file WoodMaterial.cpp.
References sample().
RGBColor rcrt::WoodMaterial::sampleSpecular | ( | const Vec3D & | wOut, | |
const Vec3D & | wInc, | |||
Intersection & | is | |||
) | [virtual] |
wOut | The outgoing direction. Should be the reflected direction of wInc (and vice versa) | |
wInc | The incoming direction. | |
is | The Intersection data. |
Implements rcrt::Material.
Definition at line 31 of file WoodMaterial.cpp.
RGBColor rcrt::WoodMaterial::getEmitted | ( | const Vec3D & | wOut, | |
Intersection & | is | |||
) | [virtual] |
wOut | the outgoing direction. | |
is | The Intersection data. |
Implements rcrt::Material.
Definition at line 36 of file WoodMaterial.cpp.
ScatterEvent rcrt::WoodMaterial::scatterPhoton | ( | Intersection & | is, | |
Photon * | photon | |||
) | [virtual] |
Scatters a Photon.
is | The Intersection data. Currently this also includes a previous IOR. //TODO refactor the ior stuff | |
photon | A photon, this should be set to the intersection point, a new outgoing direction and should be scaled in power according to the sampling process. |
Implements rcrt::Material.
Definition at line 61 of file WoodMaterial.cpp.
References rcrt::DIFFUSE, rcrt::WoodTexture::getColor(), rcrt::Vec3D::getCS(), rcrt::Intersection::getPosition(), getShadingNormal(), rcrt::Vec3D::normalize(), rcrt::Photon::scalePower(), rcrt::Photon::setDir(), rcrt::Photon::setPos(), rcrt::STORE, and wood.
bool rcrt::WoodMaterial::hasDiffuse | ( | ) | const [virtual] |
bool rcrt::WoodMaterial::hasSpecular | ( | ) | const [virtual] |
bool rcrt::WoodMaterial::hasTransmissive | ( | ) | const [virtual] |
bool rcrt::WoodMaterial::refracts | ( | ) | const [virtual] |
Vec3D rcrt::WoodMaterial::getShadingNormal | ( | Intersection & | is | ) | const [virtual] |
Reimplemented from rcrt::Material.
Definition at line 88 of file WoodMaterial.cpp.
References rcrt::Intersection::backSide(), rcrt::WoodTexture::getBump(), rcrt::Intersection::getPosition(), rcrt::Intersection::getSNormalW(), and wood.
Referenced by scatterPhoton().
WoodTexture rcrt::WoodMaterial::wood [private] |
Definition at line 13 of file WoodMaterial.h.
Referenced by getShadingNormal(), sample(), and scatterPhoton().