multithreading && code cleanup

This commit is contained in:
2026-02-13 05:06:02 +01:00
parent 7ec01f634a
commit e84404a6de
9 changed files with 109 additions and 81 deletions

View File

@@ -15,7 +15,7 @@ impl Sphere<'_> {
}
impl Hittable for Sphere<'_> {
fn hit(&mut self, r: &crate::ray::Ray, t_min: f64, t_max: f64) -> Option<HitRecord> {
fn hit(&self, r: &crate::ray::Ray, t_min: f64, t_max: f64) -> Option<HitRecord<'_>> {
let oc = r.origin() - self.center;
let a = r.direction().length_squared();
let half_b = oc.dot(&r.direction());