Skip to content

Commit 8b4f5ac

Browse files
authored
Merge pull request #758 from RayTracing/aarect-override
Aarect override
2 parents 0b4004e + 4acda7e commit 8b4f5ac

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Change Log -- Ray Tracing in One Weekend
1212
### The Next Week
1313

1414
### The Rest of Your Life
15+
- Fix: Missing `override` keyword for `xz_rect::pdf_value()` and `xz_rect::random()` methods
16+
(#748)
1517
- Fix: Synchronize book and source for `cornell_box()` function.
1618
- Fix: Introduction of light code was introduced out of sequence (#738, #740)
1719

src/TheRestOfYourLife/aarect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class xz_rect : public hittable {
5555
return true;
5656
}
5757

58-
virtual double pdf_value(const point3& origin, const vec3& v) const {
58+
virtual double pdf_value(const point3& origin, const vec3& v) const override {
5959
hit_record rec;
6060
if (!this->hit(ray(origin, v), 0.001, infinity, rec))
6161
return 0;
@@ -67,7 +67,7 @@ class xz_rect : public hittable {
6767
return distance_squared / (cosine * area);
6868
}
6969

70-
virtual vec3 random(const point3& origin) const {
70+
virtual vec3 random(const point3& origin) const override {
7171
auto random_point = point3(random_double(x0,x1), k, random_double(z0,z1));
7272
return random_point - origin;
7373
}

0 commit comments

Comments
 (0)