Skip to content

Commit 278b2c0

Browse files
authored
Merge pull request #403 from RayTracing/fix-391
InOneWeekend: repair hit tolerance from fix 391
2 parents 4455593 + 580eee7 commit 278b2c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@
10861086
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
10871087
vec3 ray_color(const ray& r, const hittable& world) {
10881088
hit_record rec;
1089-
if (world.hit(r, 0.001, infinity, rec)) {
1089+
if (world.hit(r, 0, infinity, rec)) {
10901090
return 0.5 * (rec.normal + vec3(1,1,1));
10911091
}
10921092

@@ -1409,7 +1409,7 @@
14091409
vec3 ray_color(const ray& r, const hittable& world) {
14101410
hit_record rec;
14111411

1412-
if (world.hit(r, 0.0, infinity, rec)) {
1412+
if (world.hit(r, 0, infinity, rec)) {
14131413
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
14141414
vec3 target = rec.p + rec.normal + random_in_unit_sphere();
14151415
return 0.5 * ray_color(ray(rec.p, target - rec.p), world);
@@ -1438,7 +1438,7 @@
14381438
if (depth <= 0)
14391439
return vec3(0,0,0);
14401440

1441-
if (world.hit(r, 0.001, infinity, rec)) {
1441+
if (world.hit(r, 0, infinity, rec)) {
14421442
vec3 target = rec.p + rec.normal + random_in_unit_sphere();
14431443
return 0.5 * ray_color(ray(rec.p, target - rec.p), world, depth-1);
14441444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++

0 commit comments

Comments
 (0)