parry3d/bounding_volume/
aabb_voxels.rs1use crate::bounding_volume::Aabb;
2use crate::math::{Isometry, Real, Translation};
3use crate::shape::{Cuboid, Voxels};
4
5impl Voxels {
6 #[inline]
8 pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
9 let shift = Translation::from(self.domain_center());
10 Cuboid::new(self.extents() / 2.0).aabb(&(pos * shift))
11 }
12
13 #[inline]
15 pub fn local_aabb(&self) -> Aabb {
16 Cuboid::new(self.extents() / 2.0)
17 .local_aabb()
18 .translated(&self.domain_center().coords)
19 }
20}