@@ -61,7 +61,7 @@ class lambertian : public material {
6161
6262 virtual bool scatter (
6363 const ray& r_in, const hit_record& rec, scatter_record& srec
64- ) const {
64+ ) const override {
6565 srec.is_specular = false ;
6666 srec.attenuation = albedo->value (rec.u , rec.v , rec.p );
6767 srec.pdf_ptr = make_shared<cosine_pdf>(rec.normal );
@@ -70,7 +70,7 @@ class lambertian : public material {
7070
7171 double scattering_pdf (
7272 const ray& r_in, const hit_record& rec, const ray& scattered
73- ) const {
73+ ) const override {
7474 auto cosine = dot (rec.normal , unit_vector (scattered.direction ()));
7575 return cosine < 0 ? 0 : cosine/pi;
7676 }
@@ -86,7 +86,7 @@ class metal : public material {
8686
8787 virtual bool scatter (
8888 const ray& r_in, const hit_record& rec, scatter_record& srec
89- ) const {
89+ ) const override {
9090 vec3 reflected = reflect (unit_vector (r_in.direction ()), rec.normal );
9191 srec.specular_ray =
9292 ray (rec.p , reflected + fuzz*random_in_unit_sphere (), r_in.time ());
@@ -108,7 +108,7 @@ class dielectric : public material {
108108
109109 virtual bool scatter (
110110 const ray& r_in, const hit_record& rec, scatter_record& srec
111- ) const {
111+ ) const override {
112112 srec.is_specular = true ;
113113 srec.pdf_ptr = nullptr ;
114114 srec.attenuation = color (1.0 , 1.0 , 1.0 );
@@ -143,7 +143,7 @@ class diffuse_light : public material {
143143
144144 virtual color emitted (
145145 const ray& r_in, const hit_record& rec, double u, double v, const point3& p
146- ) const {
146+ ) const override {
147147 if (!rec.front_face )
148148 return color (0 ,0 ,0 );
149149 return emit->value (u, v, p);
@@ -159,13 +159,19 @@ class isotropic : public material {
159159 isotropic (color c) : albedo(make_shared<solid_color>(c)) {}
160160 isotropic (shared_ptr<texture> a) : albedo(a) {}
161161
162+ #if 0
163+ // Issue #669
164+ // This method doesn't match the signature in the base `material` class, so this one's
165+ // never actually called. Disabling this definition until we sort this out.
166+
162167 virtual bool scatter(
163168 const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered
164- ) const {
169+ ) const override {
165170 scattered = ray(rec.p, random_in_unit_sphere(), r_in.time());
166171 attenuation = albedo->value(rec.u, rec.v, rec.p);
167172 return true;
168173 }
174+ #endif
169175
170176 public:
171177 shared_ptr<texture> albedo;
0 commit comments