use na::Translate;
use bounding_volume::{self, HasBoundingVolume, AABB};
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) -> AABB
{
let repr = self.repr();
if let Some(b) = repr.downcast_ref::::Scalar>>() {
bounding_volume::aabb(b, m)
}
else if let Some(c) = repr.downcast_ref::::Scalar>>() {
bounding_volume::aabb(c, m)
}
else if let Some(c) = repr.downcast_ref::>() {
bounding_volume::aabb(c, m)
}
else if let Some(c) = repr.downcast_ref::::Scalar>>() {
bounding_volume::aabb(c, m)
}
else if let Some(c) = repr.downcast_ref::>() {
bounding_volume::aabb(c, m)
}
else if let Some(c) = repr.downcast_ref::>() {
bounding_volume::aabb(c, m)
}
else if let Some(c) = repr.downcast_ref::::Scalar>>() {
bounding_volume::aabb(c, m)
}
else if let Some(t) = repr.downcast_ref::>() {
bounding_volume::aabb(t, m)
}
else if let Some(p) = repr.downcast_ref::>() {
bounding_volume::aabb(p, m)
}
else if let Some(p) = repr.downcast_ref::>() {
bounding_volume::aabb(p, m)
}
else if let Some(s) = repr.downcast_ref::>() {
bounding_volume::aabb(s, m)
}
else if let Some(t) = repr.downcast_ref::>() {
bounding_volume::aabb(t, m)
}
else {
/*
* XXX: dispatch by custom type.
*/
unimplemented!()
}
}
}