Skip to content

Commit 28dadc4

Browse files
authored
Merge pull request #380 from RayTracing/fix-356
class sphere constructor tweaks
2 parents 6020add + 9424734 commit 28dadc4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,10 @@
747747
public:
748748
sphere() {}
749749
sphere(vec3 cen, double r) : center(cen), radius(r) {};
750-
virtual bool hit(
751-
const ray& r, double tmin, double tmax, hit_record& rec) const;
750+
751+
virtual bool hit(const ray& r, double tmin, double tmax, hit_record& rec) const;
752+
753+
public:
752754
vec3 center;
753755
double radius;
754756
};
@@ -1658,7 +1660,8 @@
16581660

16591661
Gives us the following image:
16601662

1661-
![Rendering of diffuse spheres with hemispherical scattering](../images/fig.rand-hemispherical.png)
1663+
![Rendering of diffuse spheres with hemispherical scattering](../images/img.rand-hemispherical.png)
1664+
16621665
</div>
16631666

16641667
<div class='together'>
@@ -1752,9 +1755,10 @@
17521755
class sphere: public hittable {
17531756
public:
17541757
sphere() {}
1755-
1758+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
17561759
sphere(vec3 cen, double r, shared_ptr<material> m)
17571760
: center(cen), radius(r), mat_ptr(m) {};
1761+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
17581762

17591763
virtual bool hit(const ray& r, double tmin, double tmax, hit_record& rec) const;
17601764

0 commit comments

Comments
 (0)