added Color::operator*=(), added jitter computation to reflectance and transparency recursion, recursing now but there is still a jitter or recursion issue

git-svn-id: svn://anubis/fart/trunk@182 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2009-03-03 04:30:46 +00:00
1 parent 1f00625379
commit e233056880
9 files changed
+71 -22

No files matched your search

+8
View File
@@ -71,6 +71,14 @@ Color & Color::operator-=(const Color & other)
return *this;
}
Color & Color::operator*=(double scale)
{
r *= scale;
g *= scale;
b *= scale;
return *this;
}
Color operator+(const Color & c1, const Color & c2)
{
return Color(c1.r + c2.r, c1.g + c2.g, c1.b + c2.b);
+1
View File
@@ -21,6 +21,7 @@ class Color
Color operator/(double scale) const;
Color & operator+=(const Color & other);
Color & operator-=(const Color & other);
Color & operator*=(double scale);
static const Color black;
static const Color white;
+1
View File
@@ -8,4 +8,5 @@ Material::Material()
m_specular_color = Color::white;
m_shininess = 50.0;
m_reflectance = 0.0;
m_transparency = 0.0;
}
+4
View File
@@ -33,12 +33,16 @@ class Material
void setReflectance(double reflectance) { m_reflectance = reflectance; }
double getReflectance() const { return m_reflectance; }
void setTransparency(double t) { m_transparency = t; }
double getTransparency() const { return m_transparency; }
protected:
Color m_ambient_color;
Color m_diffuse_color;
Color m_specular_color;
double m_shininess;
double m_reflectance;
double m_transparency;
};
#endif