diff --git a/main/BMP.h b/main/BMP.h index 4bf9fa4..4926de4 100644 --- a/main/BMP.h +++ b/main/BMP.h @@ -42,7 +42,7 @@ public: int getWidth() { return m_info.width; } int getHeight() { return m_info.height; } -private: +protected: FILE * m_fp; header_t m_header; info_t m_info; diff --git a/main/Material.cc b/main/Material.cc index c78bd78..68f90bc 100644 --- a/main/Material.cc +++ b/main/Material.cc @@ -1,9 +1,10 @@ #include "Material.h" -const Material Material::white(Color::white); +const Material Material::white; -Material::Material(const Color & rgb) +Material::Material() { - m_rgb = rgb; + m_diffuse_color = Color::white; + m_specular_color = Color::white; } diff --git a/main/Material.h b/main/Material.h index 9a97c33..845148f 100644 --- a/main/Material.h +++ b/main/Material.h @@ -7,11 +7,14 @@ class Material { public: - Material(const Color & rgb = Color::white); + /* static members */ static const Material white; + Material(); + protected: - Color m_rgb; + Color m_diffuse_color; + Color m_specular_color; }; #endif diff --git a/main/Scene.h b/main/Scene.h index 228d7f9..a85fd95 100644 --- a/main/Scene.h +++ b/main/Scene.h @@ -32,7 +32,7 @@ class Scene ~Scene(); void render(); - private: + protected: /* private methods */ void load(const char * filename); void renderPixel(int x, int y, unsigned char * pixel); diff --git a/shapes/Plane.h b/shapes/Plane.h index eccff60..dcf799c 100644 --- a/shapes/Plane.h +++ b/shapes/Plane.h @@ -11,7 +11,7 @@ class Plane : public Shape IntersectList intersect(const Ray & ray); Vector getNormalAt(const Vector & pt); - private: + protected: double m_a, m_b, m_c, m_d; }; diff --git a/shapes/Sphere.h b/shapes/Sphere.h index 02f7111..cbdb132 100644 --- a/shapes/Sphere.h +++ b/shapes/Sphere.h @@ -11,7 +11,7 @@ class Sphere : public Shape IntersectList intersect(const Ray & ray); Vector getNormalAt(const Vector & pt); - private: + protected: double m_radius; double m_radius2; }; diff --git a/util/Ray.h b/util/Ray.h index 5700090..d251bfe 100644 --- a/util/Ray.h +++ b/util/Ray.h @@ -15,7 +15,7 @@ class Ray Vector getPositionAt(double dist) const; Vector operator[](double dist) const { return getPositionAt(dist); } - private: + protected: Vector m_origin; Vector m_direction; }; diff --git a/util/Vector.h b/util/Vector.h index d290f35..6078ef1 100644 --- a/util/Vector.h +++ b/util/Vector.h @@ -17,7 +17,7 @@ class Vector Vector proj(const Vector & target) const; Vector reflect(const Vector & target) const; - private: + protected: double m_array[3]; };