use na::Translate;
use bounding_volume::{HasBoundingVolume, BoundingSphere};
use math::{Point, Vector, Isometry};
use shape::{Ball, Capsule, Compound, Cone, ConvexHull, Cuboid, Cylinder, TriMesh, Polyline, Plane,
Segment, Triangle};
use inspection::Repr;
impl
HasBoundingVolume> for Repr
where P: Point,
P::Vect: Translate
,
M: Isometry
{
#[inline]
fn bounding_volume(&self, m: &M) -> BoundingSphere
{
let repr = self.repr();
if let Some(b) = repr.downcast_ref::::Scalar>>() {
b.bounding_volume(m)
}
else if let Some(c) = repr.downcast_ref::::Scalar>>() {
c.bounding_volume(m)
}
else if let Some(c) = repr.downcast_ref::>() {
c.bounding_volume(m)
}
else if let Some(c) = repr.downcast_ref::::Scalar>>() {
c.bounding_volume(m)
}
else if let Some(c) = repr.downcast_ref::>() {
c.bounding_volume(m)
}
else if let Some(c) = repr.downcast_ref::>() {
c.bounding_volume(m)
}
else if let Some(c) = repr.downcast_ref::::Scalar>>() {
c.bounding_volume(m)
}
else if let Some(t) = repr.downcast_ref::>() {
t.bounding_volume(m)
}
else if let Some(p) = repr.downcast_ref::>() {
p.bounding_volume(m)
}
else if let Some(p) = repr.downcast_ref::>() {
p.bounding_volume(m)
}
else if let Some(s) = repr.downcast_ref::>() {
s.bounding_volume(m)
}
else if let Some(t) = repr.downcast_ref::>() {
t.bounding_volume(m)
}
else {
/*
* XXX: dispatch by custom type.
*/
unimplemented!()
}
}
}