aboutsummaryrefslogtreecommitdiff
path: root/src/hittable/triangle.rs
diff options
context:
space:
mode:
authorlamp2024-01-21 17:03:07 +0000
committerlamp2024-01-21 17:03:07 +0000
commit45fafbcd4b41a5388ece377c4e051b5846407288 (patch)
tree2192c471ca3b47671f0906e27f6f6088f40b3d8a /src/hittable/triangle.rs
parent89a5c9a8a0cdf627cda0e31da454f83ca21315ce (diff)
fmt and tidy
Diffstat (limited to 'src/hittable/triangle.rs')
-rw-r--r--src/hittable/triangle.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/hittable/triangle.rs b/src/hittable/triangle.rs
index 0fe5fc4..82b9e18 100644
--- a/src/hittable/triangle.rs
+++ b/src/hittable/triangle.rs
@@ -1,6 +1,11 @@
use std::sync::Arc;
-use crate::{hittable::{HitRecord, Hittable, AABB}, material::Material, ray::Ray, vec3::{Point3, Vec3}};
+use crate::{
+ hittable::{HitRecord, Hittable, AABB},
+ material::Material,
+ ray::Ray,
+ vec3::{Point3, Vec3},
+};
pub struct Triangle {
pub v0: Point3,
@@ -12,7 +17,9 @@ pub struct Triangle {
impl Triangle {
fn has_vertex_at_infinity(&self) -> bool {
- self.v0.has_infinite_member() || self.v1.has_infinite_member() || self.v2.has_infinite_member()
+ self.v0.has_infinite_member()
+ || self.v1.has_infinite_member()
+ || self.v2.has_infinite_member()
}
}
@@ -71,9 +78,9 @@ impl Hittable for Triangle {
maximum: Point3 {
x: self.v0.x.max(self.v1.x).max(self.v2.x) + 0.0001,
y: self.v0.y.max(self.v1.y).max(self.v2.y) + 0.0001,
- z: self.v0.z.max(self.v1.z).max(self.v2.z) + 0.0001,
+ z: self.v0.z.max(self.v1.z).max(self.v2.z) + 0.0001,
},
- })
+ }),
}
}
}