parry2d/bounding_volume/
aabb_cuboid.rs1use crate::bounding_volume::Aabb;
2use crate::math::Pose;
3use crate::shape::Cuboid;
4use crate::utils::PoseOps;
5
6impl Cuboid {
7 #[inline]
9 pub fn aabb(&self, pos: &Pose) -> Aabb {
10 let center = pos.translation;
11 let ws_half_extents = pos.absolute_transform_vector(self.half_extents);
12
13 Aabb::from_half_extents(center, ws_half_extents)
14 }
15
16 #[inline]
18 pub fn local_aabb(&self) -> Aabb {
19 Aabb::new(-self.half_extents, self.half_extents)
20 }
21}