ft: 5,6.1: sphere class + normals

This commit is contained in:
djaidjai committed 2026-04-15 13:32:42 +02:00
1 parent 67c1eb861d
commit ebf39d014b
8 files changed
+126 -12

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
use crate::vec3::Vec3;
pub struct Hit {
t: f32,
p: Vec3,
n: Vec3,
}
impl Hit {
pub fn new(t: f32, p: Vec3, n: Vec3) -> Hit {
Hit { t: t, p: p, n: n }
}
pub fn t(&self) -> &f32 {
&self.t
}
pub fn p(&self) -> &Vec3 {
&self.p
}
pub fn n(&self) -> &Vec3 {
&self.n
}
}
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.