use na::Translate; use na; use bounding_volume::{HasBoundingVolume, AABB}; use shape::Ball; use math::{Point, Vector}; /// Computes the Axis-Aligned Bounding Box of a ball. #[inline] pub fn ball_aabb
(center: &P, radius:
where P: Point {
AABB::new(*center + na::repeat(-radius), *center + na::repeat(radius))
}
impl HasBoundingVolume {
#[inline]
fn bounding_volume(&self, m: &M) -> AABB {
ball_aabb(&m.translate(&na::origin()), self.radius())
}
}