use num::Float; use na::{Translate}; use na; use bounding_volume::{HasBoundingVolume, BoundingSphere}; use shape::Cone; use math::{Point, Vector}; impl HasBoundingVolume> for Cone<::Scalar> where P: Point, M: Translate

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

{ let center = m.translate(&na::origin()); let radius = (self.radius() * self.radius() + self.half_height() * self.half_height()).sqrt(); BoundingSphere::new(center, radius) } }