use na::Translate; use na; use bounding_volume::{HasBoundingVolume, BoundingSphere}; use shape::Cuboid; use math::Point; impl HasBoundingVolume> for Cuboid where P: Point, M: Translate

{ #[inline] fn bounding_volume(&self, m: &M) -> BoundingSphere

{ let center = m.translate(&na::origin::

()); let radius = na::norm(self.half_extents()); BoundingSphere::new(center, radius) } }