aboutsummaryrefslogtreecommitdiff
path: root/src/world/shapes
diff options
context:
space:
mode:
Diffstat (limited to 'src/world/shapes')
-rw-r--r--src/world/shapes/sphere.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/world/shapes/sphere.rs b/src/world/shapes/sphere.rs
index 1df9c35..fc2cfe2 100644
--- a/src/world/shapes/sphere.rs
+++ b/src/world/shapes/sphere.rs
@@ -3,7 +3,7 @@
//! Spheres are relatively easy to calculate intersections between
use crate::{Float, NEAR_ZERO};
use crate::core::{Ray, Vector3f, Bound3f};
-use crate::world::{Hittable, Intersection};
+use crate::world::{Hittable, DynHittable, Intersection};
pub struct Sphere {
radius: Float,
@@ -79,6 +79,12 @@ impl Hittable for Sphere {
}
}
+impl Into<DynHittable> for Sphere {
+ fn into(self) -> DynHittable {
+ DynHittable::new(Box::new(self))
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;