use na::{Transform, Translate}; use bounding_volume::{self, BoundingVolume, BoundingSphere, HasBoundingVolume}; use shape::Compound; use math::{Point, Isometry}; impl HasBoundingVolume> for Compound where P: Point, P::Vect: Translate

, M: Isometry, M2: Transform

+ Translate

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

{ let shapes = self.shapes(); let mut res = bounding_volume::bounding_sphere(shapes[0].1.as_ref(), &shapes[0].0); for &(ref t, ref s) in shapes[1 ..].iter() { res.merge(&bounding_volume::bounding_sphere(s.as_ref(), t)); } BoundingSphere::new(m.transform(res.center()), res.radius()) } }