parry3d/bounding_volume/
bounding_sphere_voxels.rsuse crate::bounding_volume::BoundingSphere;
use crate::math::{Isometry, Real, Translation};
use crate::shape::{Cuboid, Voxels};
impl Voxels {
#[inline]
pub fn bounding_sphere(&self, pos: &Isometry<Real>) -> BoundingSphere {
let shift = Translation::from(self.domain_center().coords);
Cuboid::new(self.extents() / 2.0).bounding_sphere(&(pos * shift))
}
#[inline]
pub fn local_bounding_sphere(&self) -> BoundingSphere {
Cuboid::new(self.extents() / 2.0)
.local_bounding_sphere()
.translated(&(self.domain_center().coords))
}
}