use na::{Translation, AbsoluteRotate, Transform, Translate}; use na; use bounding_volume::{AABB, HasBoundingVolume}; use shape::Compound; use math::{Point, Vector}; impl HasBoundingVolume> for Compound where P: Point, P::Vect: Translate

, M2: Transform

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

{ let bv = self.bvt().root_bounding_volume().unwrap(); let ls_center = na::origin::

() + bv.translation(); let center = m.transform(&ls_center); let half_extents = (*bv.maxs() - *bv.mins()) / na::cast::::Scalar>(2.0); let ws_half_extents = m.absolute_rotate(&half_extents); AABB::new(center + (-ws_half_extents), center + ws_half_extents) } }