use na::{Transform, Rotate}; use na; use entities::bounding_volume::AABB; use entities::shape::Cuboid; use point::PointQuery; use math::{Point, Vector}; impl PointQuery for Cuboid where P: Point, M: Transform

+ Rotate { #[inline] fn project_point(&self, m: &M, pt: &P, solid: bool) -> P { let dl = na::origin::

() + (-*self.half_extents()); let ur = na::origin::

() + *self.half_extents(); AABB::new(dl, ur).project_point(m, pt, solid) } #[inline] fn distance_to_point(&self, m: &M, pt: &P) -> ::Scalar { let dl = na::origin::

() + (-*self.half_extents()); let ur = na::origin::

() + *self.half_extents(); AABB::new(dl, ur).distance_to_point(m, pt) } #[inline] fn contains_point(&self, m: &M, pt: &P) -> bool { let dl = na::origin::

() + (-*self.half_extents()); let ur = na::origin::

() + *self.half_extents(); AABB::new(dl, ur).contains_point(m, pt) } }