ft: 10: metals

This commit is contained in:
2026-04-16 14:04:55 +02:00
parent e8f84b590b
commit b756cc394a
12 changed files with 199 additions and 41 deletions

View File

@@ -6,17 +6,17 @@ pub struct Ray {
}
impl Ray {
pub fn at(&self, t: f32) -> Vec3 {
self.origin + t * self.dir
}
pub fn new(origin: Vec3, dir: Vec3) -> Ray {
Ray {
pub fn new(origin: Vec3, dir: Vec3) -> Self {
Self {
origin: origin,
dir: dir,
}
}
pub fn at(&self, t: f32) -> Vec3 {
self.origin + t * self.dir
}
pub fn origin(&self) -> &Vec3 {
&self.origin
}