Skip to content

Commit 6381478

Browse files
committed
Synchronize hittable.h
1 parent 1602c7c commit 6381478

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Change Log -- Ray Tracing in One Weekend
77
- Fix: Added `fmin` to book text for `cos_theta` of `refract` (#732)
88
- Fix: Standardized naming for ray-t and time parameters (#746)
99
- Fix: `random_unit_vector()` was incorrect (#697)
10+
- Fix: Synchronize text and copies of `hittable.h`
1011

1112
### In One Weekend
1213

books/RayTracingInOneWeekend.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,6 @@
19581958

19591959
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
19601960
#include "rtweekend.h"
1961-
#include "ray.h"
19621961

19631962
class material;
19641963
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++

src/InOneWeekend/hittable.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
//==============================================================================================
1313

1414
#include "rtweekend.h"
15-
#include "ray.h"
16-
1715

1816
class material;
1917

src/TheNextWeek/hittable.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
class material;
2020

21+
2122
struct hit_record {
2223
point3 p;
2324
vec3 normal;
@@ -135,8 +136,8 @@ rotate_y::rotate_y(shared_ptr<hittable> p, double angle) : ptr(p) {
135136

136137

137138
bool rotate_y::hit(const ray& r, double t_min, double t_max, hit_record& rec) const {
138-
point3 origin = r.origin();
139-
vec3 direction = r.direction();
139+
auto origin = r.origin();
140+
auto direction = r.direction();
140141

141142
origin[0] = cos_theta*r.origin()[0] - sin_theta*r.origin()[2];
142143
origin[2] = sin_theta*r.origin()[0] + cos_theta*r.origin()[2];
@@ -149,8 +150,8 @@ bool rotate_y::hit(const ray& r, double t_min, double t_max, hit_record& rec) co
149150
if (!ptr->hit(rotated_r, t_min, t_max, rec))
150151
return false;
151152

152-
point3 p = rec.p;
153-
vec3 normal = rec.normal;
153+
auto p = rec.p;
154+
auto normal = rec.normal;
154155

155156
p[0] = cos_theta*rec.p[0] + sin_theta*rec.p[2];
156157
p[2] = -sin_theta*rec.p[0] + cos_theta*rec.p[2];

0 commit comments

Comments
 (0)