diff options
| author | Sakarias Johansson <sakarias.johansson@goodbyekansas.com> | 2023-01-12 22:07:57 +0100 |
|---|---|---|
| committer | Sakarias Johansson <sakarias.johansson@goodbyekansas.com> | 2023-01-12 22:07:57 +0100 |
| commit | 9d44f7ab04e6f6979e0eebc24f8fb439a23a3865 (patch) | |
| tree | 5194f6bd792c8ccf7a164582a1ebb5dc51e3a98c /racer-tracer/src/geometry.rs | |
| parent | a6302805d19273c95278c8d792ffbd9b2633fe20 (diff) | |
| download | racer-tracer-9d44f7ab04e6f6979e0eebc24f8fb439a23a3865.tar.gz racer-tracer-9d44f7ab04e6f6979e0eebc24f8fb439a23a3865.tar.xz racer-tracer-9d44f7ab04e6f6979e0eebc24f8fb439a23a3865.zip | |
🧹 Minor cleanup
- Made the traits into supertraits so we don't have to mention Send and
Sync everywhere.
- Add methods for Vec3 that modifies the existing Vector. Can be used
to make less copies.
Diffstat (limited to 'racer-tracer/src/geometry.rs')
| -rw-r--r-- | racer-tracer/src/geometry.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/racer-tracer/src/geometry.rs b/racer-tracer/src/geometry.rs index 1cc7e28..78e0259 100644 --- a/racer-tracer/src/geometry.rs +++ b/racer-tracer/src/geometry.rs @@ -11,11 +11,11 @@ pub struct HitRecord { pub normal: Vec3, pub t: f64, pub front_face: bool, - pub material: Arc<Box<dyn Material + Send + Sync>>, + pub material: Arc<Box<dyn Material>>, } impl HitRecord { - fn new(point: Vec3, t: f64, material: Arc<Box<dyn Material + Send + Sync>>) -> Self { + fn new(point: Vec3, t: f64, material: Arc<Box<dyn Material>>) -> Self { Self { point, normal: Vec3::default(), @@ -35,7 +35,7 @@ impl HitRecord { } } -pub trait Hittable { +pub trait Hittable: Send + Sync { //pub trait Hittable { fn hit(&self, ray: &Ray, t_min: f64, t_max: f64) -> Option<HitRecord>; } |
