parry3d_f64/bounding_volume/bounding_sphere_halfspace.rs
1use crate::bounding_volume::BoundingSphere;
2use crate::math::{Isometry, Point, Real};
3use crate::shape::HalfSpace;
4
5use num::Bounded;
6
7impl HalfSpace {
8 /// Computes the world-space bounding sphere of this half-space, transformed by `pos`.
9 #[inline]
10 pub fn bounding_sphere(&self, pos: &Isometry<Real>) -> BoundingSphere {
11 let bv: BoundingSphere = self.local_bounding_sphere();
12 bv.transform_by(pos)
13 }
14
15 /// Computes the local-space bounding sphere of this half-space.
16 #[inline]
17 pub fn local_bounding_sphere(&self) -> BoundingSphere {
18 let radius = Real::max_value();
19
20 BoundingSphere::new(Point::origin(), radius)
21 }
22}