use na::Transform; use na; use support_map::SupportMap; use bounding_volume::AABB; use math::{Point, Vector}; /// Computes the AABB of an support mapped shape. pub fn implicit_shape_aabb
(m: &M, i: &G) -> AABB
where P: Point, G: SupportMap
{ let mut min = na::origin::
(); let mut max = na::origin::
();
let mut basis = na::zero:: (m: &M, pts: &[P]) -> (P, P)
where P: Point,
M: Transform {
let wp0 = na::transform(m, &pts[0]);
let mut min: P = wp0.clone();
let mut max: P = wp0.clone();
for pt in pts[1 ..].iter() {
let wpt = na::transform(m, pt);
min = na::inf(&min, &wpt);
max = na::sup(&max, &wpt);
}
(min, max)
}