This basically implements Peter's original alternative of having spheres
always support animation, with static spheres as a special case. In this
case, using a ray to represent the sphere center allows for pretty
trivial selection of the center position at a given time, and simplifies
the code.
The old method had a floating-point weakness in which all three vector
components, when small enough, can yield a vector length that underflows
to zero, leading to a bogus [+/- infinity, +/- infinity, +/- infinity]
result.
This change also eliminates the `random_in_unit_sphere()` function, and
does everything inside the `random_unit_vector()` function, which allows
us to compute the vector length only once and then re-use it for
normalization.
Resolves#1606
The prior version used a forward declaration of `hit_record`, which was
insufficient since hittable.h lines referenced members of `hit_record`,
and was unnecessary because hittable.h was included before material.h in
practice.
For this specific code, the inclusion is unnecessary, but is proper
form.
Resolves#1608
The prior version had caption blocks wrapped to maintain the
100-character width source. However, Markdeep suffered a regression at
v1.16 (current version v1.17 at this commit) where everything past the
first linefeed in the caption block is ignored. To work around this bug,
this change converts all caption lines to a single block. Note that
figures/images still have an optional linefeed before the closing square
bracket and the parenthesized target.
Resolves#1583
- Inspired by https://github.com/RayTracing/gpu-tracing/pull/9, I'm
adopting the CSS code style of having one selector per line with
trailing commas for definitions that apply to multiple selectors.
- Corrected "Hilight.js" to "Highlight.js". There _is_ a hilight.js, but
it looks like the syntax highlighting package used by Markdeep is
highlight.js (https://highlightjs.org/).
- Fixed background-color syntax bug.