ft: 6.5: hitlist

This commit is contained in:
djaidjai committed 2026-04-15 13:57:43 +02:00
1 parent 3a660f900a
commit 583b67f4f4
5 files changed
+23 -26

No files matched your search

+1 -3
View File
@@ -1,7 +1,7 @@
use core::f32::math::sqrt;
use crate::objects::hit::Hit;
use crate::objects::traits::{Hittable, Normal};
use crate::objects::traits::Hittable;
use crate::Vec3;
pub struct Sphere {
@@ -34,9 +34,7 @@ impl Hittable for Sphere {
Some(Hit::new(t, p, self.normal_at(&p)))
}
}
}
impl Normal for Sphere {
fn normal_at(&self, p: &Vec3) -> Vec3 {
(*p - self.center).get_unit()
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.