I don't need functions to create new vectors, I just want a constant
that I can clone. The compiler probably does the same thing in both
cases, but this is more semantically accurate to that goal.
Rand v0.9 made the `Uniform::new()` function fallible, but I'm going to
keep assuming these always work and just `.unwrap()` the Result.
It also renamed the distribution module, for some reason.
I've rewritten the renderer to see if I can make a better model the
second time around. I was having a rough time untangling parts and
refactoring it piece-by-piece.
Next is to hook up the new rendering parts into a single-threaded
build. Once the parts work again, I can look into thread pooling
machinery.
The scene is more than just a list of hittables. It's any and all
hittables (so the list, yeah), and also the camera(s!) in the world.
This doens't compile, however. More work will need to be done to
untangle the other things that could previously see these scattered
components.
Because of the mutable record being used in the loop, the previous
version had a somewhat obscured way to track the nearest collision.
Switching to an optional (so I can have a non-optional Material in it)
means I'm not interrogating that value.... So it gets to be explicit
again.
I'll refactor the entire for-loop into an iterator with the min()
adapter at some point. For now: Material lifetimes!
It looks like I messed up the preference for the HitRecords. The
geometry bounces correctly, but the record that sticks is not
necessarily the one closest to the camera.
After nearly a month of not touching the project, I've finally finished
collecting the scene parts. :l
With that, the rearrange is complete. On to the next thing!