use na::{Translate, Translation, Transform, AbsoluteRotate}; use na; use bounding_volume::{self, AABB, HasBoundingVolume}; use shape::{BaseMesh, BaseMeshElement, TriMesh, Polyline}; use math::{Point, Vector}; impl
HasBoundingVolume
where P: Point,
P::Vect: Translate ,
M: AbsoluteRotate ,
E: BaseMeshElement {
#[inline]
fn bounding_volume(&self, m: &M) -> AABB {
let bv = self.bvt().root_bounding_volume().unwrap();
let ls_center = na::origin:: () + bv.translation();
let center = m.transform(&ls_center);
let half_extents = (*bv.maxs() - *bv.mins()) * na::cast:: HasBoundingVolume
where P: Point,
P::Vect: Translate ,
M: AbsoluteRotate {
#[inline]
fn bounding_volume(&self, m: &M) -> AABB {
bounding_volume::aabb(self.base_mesh(), m)
}
}
impl HasBoundingVolume
where P: Point,
P::Vect: Translate ,
M: AbsoluteRotate {
#[inline]
fn bounding_volume(&self, m: &M) -> AABB {
bounding_volume::aabb(self.base_mesh(), m)
}
}