added metals and dielectrics

This commit is contained in:
2023-02-02 09:41:11 +01:00
parent 72fb4ce3fd
commit 32cb8b4554
7 changed files with 145 additions and 42 deletions

View File

@@ -12,7 +12,7 @@ pub struct HitRecord<'a> {
}
impl HitRecord<'_> {
pub fn new_empty<T: Material>(material: &T) -> Self {
pub fn new_empty<T: Material>(material: &'static T) -> Self {
HitRecord { p: Point3::new(0.0, 0.0, 0.0), normal: Vec3::new(0.0, 0.0, 0.0), t: 0.0, front_face: false, mat_ptr: material }
}