1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
use bounding_volume::{HasBoundingVolume, AABB};
use bounding_volume::aabb_utils;
use shape::ConvexHull;
use math::{Isometry, Point};

impl<P: Point, M: Isometry<P>> HasBoundingVolume<M, AABB<P>> for ConvexHull<P> {
    #[inline]
    fn bounding_volume(&self, m: &M) -> AABB<P> {
        let (min, max) = aabb_utils::point_cloud_aabb(m, self.points());

        AABB::new(min, max)
    }
}