use math::{Isometry, Point}; use shape::Shape; use query::{Ray, RayCast, RayIntersection}; impl> RayCast for Shape { #[inline] fn toi_with_ray(&self, m: &M, ray: &Ray

, solid: bool) -> Option { self.as_ray_cast() .expect("No RayCast implementation for the underlying shape.") .toi_with_ray(m, ray, solid) } #[inline] fn toi_and_normal_with_ray( &self, m: &M, ray: &Ray

, solid: bool, ) -> Option> { self.as_ray_cast() .expect("No RayCast implementation for the underlying shape.") .toi_and_normal_with_ray(m, ray, solid) } #[inline] fn toi_and_normal_and_uv_with_ray( &self, m: &M, ray: &Ray

, solid: bool, ) -> Option> { self.as_ray_cast() .expect("No RayCast implementation for the underlying shape.") .toi_and_normal_and_uv_with_ray(m, ray, solid) } #[inline] fn intersects_ray(&self, m: &M, ray: &Ray

) -> bool { self.as_ray_cast() .expect("No RayCast implementation for the underlying shape.") .intersects_ray(m, ray) } }