Skip to content

Commit 9424734

Browse files
committed
class sphere constructor tweaks
- Trued up code formatting for the two listings on `class sphere` - Highlighted change in parameterized sphere constructor Issue #356
1 parent a91ef50 commit 9424734

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
@@ -744,8 +744,10 @@
744744
public:
745745
sphere() {}
746746
sphere(vec3 cen, double r) : center(cen), radius(r) {};
747-
virtual bool hit(
748-
const ray& r, double tmin, double tmax, hit_record& rec) const;
747+
748+
virtual bool hit(const ray& r, double tmin, double tmax, hit_record& rec) const;
749+
750+
public:
749751
vec3 center;
750752
double radius;
751753
};
@@ -1655,7 +1657,8 @@
16551657

16561658
Gives us the following image:
16571659

1658-
![Rendering of diffuse spheres with hemispherical scattering](../images/fig.rand-hemispherical.png)
1660+
![Rendering of diffuse spheres with hemispherical scattering](../images/img.rand-hemispherical.png)
1661+
16591662
</div>
16601663

16611664
<div class='together'>
@@ -1749,9 +1752,10 @@
17491752
class sphere: public hittable {
17501753
public:
17511754
sphere() {}
1752-
1755+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
17531756
sphere(vec3 cen, double r, shared_ptr<material> m)
17541757
: center(cen), radius(r), mat_ptr(m) {};
1758+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
17551759

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

0 commit comments

Comments
 (0)