use alga::linear::Translation; use utils; use bounding_volume::{HasBoundingVolume, AABB}; use shape::Ball; use math::{Isometry, Point}; /// Computes the Axis-Aligned Bounding Box of a ball. #[inline] pub fn ball_aabb(center: &P, radius: P::Real) -> AABB

{ AABB::new( *center + utils::repeat(-radius), *center + utils::repeat(radius), ) } impl> HasBoundingVolume> for Ball { #[inline] fn bounding_volume(&self, m: &M) -> AABB

{ ball_aabb( &P::from_coordinates(m.translation().to_vector()), self.radius(), ) } }