aboutsummaryrefslogtreecommitdiff
path: root/src/material/mod.rs
diff options
context:
space:
mode:
authorlamp2024-01-21 17:03:07 +0000
committerlamp2024-01-21 17:03:07 +0000
commit45fafbcd4b41a5388ece377c4e051b5846407288 (patch)
tree2192c471ca3b47671f0906e27f6f6088f40b3d8a /src/material/mod.rs
parent89a5c9a8a0cdf627cda0e31da454f83ca21315ce (diff)
fmt and tidy
Diffstat (limited to 'src/material/mod.rs')
-rw-r--r--src/material/mod.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/material/mod.rs b/src/material/mod.rs
index c292ea1..cded09b 100644
--- a/src/material/mod.rs
+++ b/src/material/mod.rs
@@ -10,13 +10,23 @@ pub use diffuse_light::DiffuseLight;
mod isotropic;
pub use isotropic::Isotropic;
-use crate::{hittable::HitRecord, vec3::Point3};
-use crate::vec3::Color;
use crate::ray::Ray;
+use crate::vec3::Color;
+use crate::{hittable::HitRecord, vec3::Point3};
pub trait Material: Send + Sync {
fn emitted(&self, _: f64, _: f64, _: &Point3) -> Color {
- Color { x: 0.0, y: 0.0, z: 0.0 }
+ Color {
+ x: 0.0,
+ y: 0.0,
+ z: 0.0,
+ }
}
- fn scatter(&self, ray_in: &Ray, hit_record: &HitRecord, attenuation: &mut Color, scattered: &mut Ray) -> bool;
+ fn scatter(
+ &self,
+ ray_in: &Ray,
+ hit_record: &HitRecord,
+ attenuation: &mut Color,
+ scattered: &mut Ray,
+ ) -> bool;
}