1use crate::bounding_volume::{HasBoundingVolume, AABB};
2use crate::math::{Isometry, Point, Vector};
3use crate::shape::Plane;
4use na::{self, RealField};
56impl<N: RealField + Copy> HasBoundingVolume<N, AABB<N>> for Plane<N> {
7#[inline]
8fn bounding_volume(&self, _: &Isometry<N>) -> AABB<N> {
9self.local_bounding_volume()
10 }
1112#[inline]
13fn local_bounding_volume(&self) -> AABB<N> {
14// We divide by 2.0 so that we can still make some operations with it (like loosening)
15 // without breaking the box.
16let max = Point::from(Vector::repeat(
17 N::max_value().unwrap() * na::convert(0.5f64),
18 ));
1920 AABB::new(-max, max)
21 }
22}