Skip to content

Commit 1ad5668

Browse files
committed
Merge branch 'dev-patch' into dev-minor
2 parents 0d0ddff + 4696c5e commit 1ad5668

File tree

6 files changed

+27
-11
lines changed

6 files changed

+27
-11
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,23 @@ Change Log -- Ray Tracing in One Weekend
4646

4747

4848
----------------------------------------------------------------------------------------------------
49-
# v3.1.2 (in progress)
49+
# v3.1.3 (in progress)
50+
51+
52+
----------------------------------------------------------------------------------------------------
53+
# v3.1.2 (2020-06-03)
54+
55+
### _In One Weekend_
56+
- Fix: Correct typo: "Intance Translation" -> "Instance Translation"
57+
- Fix: Corrected geometry type when computing distance between two points, final scene (#609)
5058

5159
### _The Rest of Your Life_
5260
- Fix: Missing closing parenthesis in listing 10 (#603)
5361
- Fix: Tiny improvements to the lambertian::scatter() development (#604)
5462
- Fix: Correct geometry type and unit vector method in `ray_color()`, listing 20 (#606)
63+
- Fix: Listing 26: alternate `random_double()` switched `distribution`, `generator` (#621)
64+
- Fix: Listing 28, 30: `light_shape` should have default material, not `0` (#607)
65+
- Fix: Listing 30: `mixture_pdf` needs `shared_ptr` arguments (#608)
5566

5667

5768
----------------------------------------------------------------------------------------------------

books/RayTracingInOneWeekend.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@
13631363
inline double random_double() {
13641364
static std::uniform_real_distribution<double> distribution(0.0, 1.0);
13651365
static std::mt19937 generator;
1366-
return generator(distribution);
1366+
return distribution(generator);
13671367
}
13681368
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13691369
[Listing [random-double-alt]: <kbd>[rtweekend.h]</kbd> random_double(), alternate implemenation]
@@ -3047,7 +3047,7 @@
30473047
auto choose_mat = random_double();
30483048
point3 center(a + 0.9*random_double(), 0.2, b + 0.9*random_double());
30493049

3050-
if ((center - vec3(4, 0.2, 0)).length() > 0.9) {
3050+
if ((center - point3(4, 0.2, 0)).length() > 0.9) {
30513051
shared_ptr<material> sphere_material;
30523052

30533053
if (choose_mat < 0.8) {

books/RayTracingTheNextWeek.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,7 +2296,11 @@
22962296

22972297

22982298
Instance Translation
2299+
<<<<<<< HEAD
22992300
--------------------
2301+
=======
2302+
---------------------
2303+
>>>>>>> dev-patch
23002304
<div class='together'>
23012305
Whether you think of this as a move or a change of coordinates is up to you. The code for this, to
23022306
move any underlying hittable is a _translate_ instance.

books/RayTracingTheRestOfYourLife.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,8 @@
17191719

17201720

17211721
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
1722-
shared_ptr<hittable> light_shape = make_shared<xz_rect>(213, 343, 227, 332, 554, 0);
1722+
shared_ptr<hittable> light_shape =
1723+
make_shared<xz_rect>(213, 343, 227, 332, 554, shared_ptr<material>());
17231724
hittable_pdf p(light_shape, rec.p);
17241725
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
17251726

@@ -1806,13 +1807,12 @@
18061807
if (!rec.mat_ptr->scatter(r, rec, albedo, scattered, pdf_val))
18071808
return emitted;
18081809

1809-
1810+
shared_ptr<hittable> light_shape =
1811+
make_shared<xz_rect>(213, 343, 227, 332, 554, make_shared<material>());
18101812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
1811-
shared_ptr<hittable> light_ptr = make_shared<xz_rect>(213, 343, 227, 332, 554, 0);
1812-
hittable_pdf p0(light_ptr, rec.p);
1813-
1814-
cosine_pdf p1(rec.normal);
1815-
mixture_pdf p(&p0, &p1);
1813+
auto p0 = make_shared<hittable_pdf>(light_shape, rec.p);
1814+
auto p1 = make_shared<cosine_pdf>(rec.normal);
1815+
mixture_pdf p(p0, p1);
18161816
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
18171817

18181818
scattered = ray(rec.p, p.generate(), r.time());

books/acknowledgments.md.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
- Joey Cho
4444
- Kaan Eraslan
4545
- Lorenzo Mancini
46+
- Manas Kale
4647
- Marcus Ottosson
4748
- Matthew Heimlich
4849
- Nakata Daisuke

src/InOneWeekend/main.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ hittable_list random_scene() {
5252
auto choose_mat = random_double();
5353
point3 center(a + 0.9*random_double(), 0.2, b + 0.9*random_double());
5454

55-
if ((center - vec3(4, 0.2, 0)).length() > 0.9) {
55+
if ((center - point3(4, 0.2, 0)).length() > 0.9) {
5656
shared_ptr<material> sphere_material;
5757

5858
if (choose_mat < 0.8) {

0 commit comments

Comments
 (0)