Skip to content

Commit e55c56f

Browse files
authored
Merge pull request #429 from RayTracing/tdb/ray_t_inch6
Added parameter t back in to hit_record and removed erroneous time comment
2 parents 3d8d3eb + fec3e62 commit e55c56f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Change Log -- Ray Tracing in One Weekend
1010
- Fix: Update image and size for simple red sphere render
1111
- Fix: Update image and size for sphere with normal-vector coloring
1212
- Fix: Improve image size and aspect ratio calculation to make size changes easier
13+
- Fix: Added `t` parameter back into `hit_record` at correct place
1314

1415

1516
----------------------------------------------------------------------------------------------------

books/RayTracingInOneWeekend.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@
748748
struct hit_record {
749749
vec3 p;
750750
vec3 normal;
751+
double t;
752+
751753
};
752754

753755
class hittable {
@@ -878,8 +880,8 @@
878880
less work and put the determination at geometry time. This is simply a matter of preference and
879881
you'll see both implementations in the literature.
880882

881-
We add the `front_face` bool to the `hit_record` struct. I know that we’ll also want motion blur at
882-
some point, so I’ll also add a time input variable.
883+
We add the `front_face` bool to the `hit_record` struct. We'll also add a function to solve this
884+
calculation for us.
883885

884886
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
885887
#ifndef HITTABLE_H
@@ -891,7 +893,6 @@
891893
vec3 p;
892894
vec3 normal;
893895
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
894-
double t;
895896
bool front_face;
896897

897898
inline void set_face_normal(const ray& r, const vec3& outward_normal) {

0 commit comments

Comments
 (0)