parry3d/bounding_volume/
aabb_halfspace.rs

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