aboutsummaryrefslogtreecommitdiff
path: root/src/hittable/constant_medium.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/hittable/constant_medium.rs')
-rw-r--r--src/hittable/constant_medium.rs20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/hittable/constant_medium.rs b/src/hittable/constant_medium.rs
index 36ac2ff..50bddc6 100644
--- a/src/hittable/constant_medium.rs
+++ b/src/hittable/constant_medium.rs
@@ -1,6 +1,12 @@
use std::sync::Arc;
-use crate::{hittable::{HitRecord, Hittable, AABB}, material::{Isotropic, Material}, ray::Ray, texture::Texture, vec3::{Vec3, Point3}};
+use crate::{
+ hittable::{HitRecord, Hittable, AABB},
+ material::{Isotropic, Material},
+ ray::Ray,
+ texture::Texture,
+ vec3::Vec3,
+};
pub struct ConstantMedium {
boundary: Arc<dyn Hittable>,
@@ -13,7 +19,7 @@ impl ConstantMedium {
Self {
boundary,
phase_function: Arc::new(Isotropic::from_texture(texture)),
- neg_inv_density: -1.0/density,
+ neg_inv_density: -1.0 / density,
}
}
}
@@ -52,10 +58,14 @@ impl Hittable for ConstantMedium {
p: ray.at(t),
t,
material: Some(self.phase_function.clone()),
- normal: Vec3 { x: 1.0, y: 0.0, z: 0.0 }, // arbitrary
+ normal: Vec3 {
+ x: 1.0,
+ y: 0.0,
+ z: 0.0,
+ }, // arbitrary
front_face: true, // arbitrary
- u: 0.0, // arbitrary
- v: 0.0, // arbitrary
+ u: 0.0, // arbitrary
+ v: 0.0, // arbitrary
})
}