ft: moved random scene code to function; cleaned up tri/quad/cube hit logic; made camera attributes private

This commit is contained in:
2026-05-31 13:51:34 +02:00
parent 71985a6c34
commit 64cad7eda6
11 changed files with 259 additions and 221 deletions

View File

@@ -33,7 +33,7 @@ impl Vec3 {
Self {
x: r as f32 / 255.,
y: g as f32 / 255.,
z: b as f32/ 255.,
z: b as f32 / 255.,
}
}
@@ -444,16 +444,20 @@ impl Div<Vec3> for Vec3 {
}
}
}
impl Div<u32> for Vec3 {
type Output = Self;
fn div(self, u: u32) -> Self::Output {
self / u as f32
}
}
impl Div<i32> for Vec3 {
type Output = Self;
fn div(self, i: i32) -> Self::Output {
let f: f32 = i as f32;
Self {
x: self.x / f,
y: self.y / f,
z: self.z / f,
}
self / i as f32
}
}
@@ -500,4 +504,3 @@ impl Display for Vec3 {
write!(f, "({}, {}, {})", self.x, self.y, self.z)
}
}