parry2d/bounding_volume/aabb_convex_polygon.rs
1use crate::bounding_volume::Aabb;
2use crate::math::{Isometry, Real};
3use crate::shape::ConvexPolygon;
4
5impl ConvexPolygon {
6 /// Computes the world-space [`Aabb`] of this convex polygon, transformed by `pos`.
7 #[inline]
8 pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
9 super::details::point_cloud_aabb_ref(pos, self.points())
10 }
11
12 /// Computes the local-space [`Aabb`] of this convex polygon.
13 #[inline]
14 pub fn local_aabb(&self) -> Aabb {
15 super::details::local_point_cloud_aabb_ref(self.points())
16 }
17}