From 45fafbcd4b41a5388ece377c4e051b5846407288 Mon Sep 17 00:00:00 2001 From: lamp Date: Sun, 21 Jan 2024 17:03:07 +0000 Subject: fmt and tidy --- src/hittable/sphere.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/hittable/sphere.rs') diff --git a/src/hittable/sphere.rs b/src/hittable/sphere.rs index 783b788..f276366 100644 --- a/src/hittable/sphere.rs +++ b/src/hittable/sphere.rs @@ -1,9 +1,13 @@ -use std::sync::Arc; use std::f64::consts; +use std::sync::Arc; -use crate::{hittable::{HitRecord, Hittable, AABB}, material::Material, vec3::Vec3}; use crate::ray::Ray; use crate::vec3::Point3; +use crate::{ + hittable::{HitRecord, Hittable, AABB}, + material::Material, + vec3::Vec3, +}; pub struct Sphere { pub center: Point3, @@ -54,8 +58,18 @@ impl Hittable for Sphere { fn bounding_box(&self, _: f64, _: f64) -> Option { Some(AABB { - minimum: &self.center - Vec3 { x: self.radius, y: self.radius, z: self.radius }, - maximum: &self.center + Vec3 { x: self.radius, y: self.radius, z: self.radius }, + minimum: &self.center + - Vec3 { + x: self.radius, + y: self.radius, + z: self.radius, + }, + maximum: &self.center + + Vec3 { + x: self.radius, + y: self.radius, + z: self.radius, + }, }) } } -- cgit v1.2.3