Skip to content

Commit f4ebec4

Browse files
committed
Book 2 Progression Edits Batch 1
1 parent 4ef2557 commit f4ebec4

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

books/RayTracingTheNextWeek.html

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@
7171

7272

7373
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
74-
ray(const point3& origin, const vec3& direction) : orig(origin), dir(direction), tm(0)
75-
{}
76-
7774
ray(const point3& origin, const vec3& direction, double time = 0.0)
7875
: orig(origin), dir(direction), tm(time)
7976
{}
@@ -186,7 +183,9 @@
186183
}
187184
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
188185

189-
...
186+
bool hit(const ray& r, interval ray_t, hit_record& rec) const override {
187+
...
188+
}
190189

191190
private:
192191
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
@@ -198,10 +197,10 @@
198197
bool is_moving;
199198
vec3 center_vec;
200199

201-
point3 center(double time) const {
200+
point3 sphere_center(double time) const {
202201
// Linearly interpolate from center1 to center2 according to time, where t=0 yields
203202
// center1, and t=1 yields center2.
204-
return center0 + time*center_vec;
203+
return center1 + time*center_vec;
205204
}
206205
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
207206
};
@@ -239,23 +238,6 @@
239238

240239
</div>
241240

242-
<div class='together'>
243-
We need to implement the new `interval::contains()` method mentioned above:
244-
245-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
246-
class interval {
247-
public:
248-
...
249-
bool contains(double x) const {
250-
return min <= x && x <= max;
251-
}
252-
...
253-
};
254-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
255-
[Listing [interval-contains]: <kbd>interval.h</kbd> interval::contains() method]
256-
257-
</div>
258-
259241

260242
Tracking the Time of Ray Intersection
261243
--------------------------------------
@@ -4198,7 +4180,7 @@
41984180
(accessed MMM. DD, YYYY)
41994181
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42004182

4201-
### MLA:
4183+
### MLA
42024184
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42034185
Ray Tracing: The Next Week. raytracing.github.io/books/RayTracingTheNextWeek.html
42044186
Accessed DD MMM. YYYY.

0 commit comments

Comments
 (0)