diff options
author | lamp | 2024-01-21 17:03:07 +0000 |
---|---|---|
committer | lamp | 2024-01-21 17:03:07 +0000 |
commit | 45fafbcd4b41a5388ece377c4e051b5846407288 (patch) | |
tree | 2192c471ca3b47671f0906e27f6f6088f40b3d8a /src/hittable/triangle.rs | |
parent | 89a5c9a8a0cdf627cda0e31da454f83ca21315ce (diff) |
fmt and tidy
Diffstat (limited to 'src/hittable/triangle.rs')
-rw-r--r-- | src/hittable/triangle.rs | 15 |
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, }, - }) + }), } } } |