parry3d/bounding_volume/
aabb_halfspace.rs

1use crate::bounding_volume::Aabb;
2use crate::math::{Isometry, Point, Real};
3use crate::num::Bounded;
4use crate::shape::HalfSpace;
5use na;
6
7impl HalfSpace {
8    /// Computes the world-space [`Aabb`] of this half-space.
9    #[inline]
10    pub fn aabb(&self, _pos: &Isometry<Real>) -> Aabb {
11        self.local_aabb()
12    }
13
14    /// Computes the local-space [`Aabb`] of this half-space.
15    #[inline]
16    pub fn local_aabb(&self) -> Aabb {
17        // We divide by 2.0  so that we can still make some operations with it (like loosening)
18        // without breaking the box.
19        let max = Point::max_value() * na::convert::<f64, Real>(0.5f64);
20        Aabb::new(-max, max)
21    }
22}