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: ::Scalar) -> AABB

where P: Point { AABB::new(*center + na::repeat(-radius), *center + na::repeat(radius)) } impl HasBoundingVolume> for Ball<::Scalar> where P: Point, M: Translate

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

{ ball_aabb(&m.translate(&na::origin()), self.radius()) } }