use na; use bounding_volume::{self, HasBoundingVolume, AABB}; use shape::{BaseMesh, BaseMeshElement, Polyline, TriMesh}; use math::{Isometry, Point}; impl HasBoundingVolume> for BaseMesh where P: Point, M: Isometry

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

{ let bv = self.bvt().root_bounding_volume().unwrap(); let ls_center = bv.center(); let center = m.transform_point(&ls_center); let half_extents = (*bv.maxs() - *bv.mins()) * na::convert::(0.5); let ws_half_extents = m.absolute_rotate_vector(&half_extents); AABB::new(center + (-ws_half_extents), center + ws_half_extents) } } impl> HasBoundingVolume> for TriMesh

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

{ bounding_volume::aabb(self.base_mesh(), m) } } impl> HasBoundingVolume> for Polyline

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

{ bounding_volume::aabb(self.base_mesh(), m) } }