ncollide3d/bounding_volume/
bounding_sphere_plane.rs

1use crate::bounding_volume::{BoundingSphere, HasBoundingVolume};
2use crate::math::{Isometry, Point};
3use crate::shape::Plane;
4use na::RealField;
5
6impl<N: RealField + Copy> HasBoundingVolume<N, BoundingSphere<N>> for Plane<N> {
7    #[inline]
8    fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N> {
9        let bv: BoundingSphere<N> = self.local_bounding_volume();
10        bv.transform_by(m)
11    }
12
13    #[inline]
14    fn local_bounding_volume(&self) -> BoundingSphere<N> {
15        let radius = N::max_value().unwrap();
16
17        BoundingSphere::new(Point::origin(), radius)
18    }
19}