@@ -4,8 +4,9 @@ use crate::{
4
4
bounding:: BoundingVolume ,
5
5
ops,
6
6
primitives:: {
7
- Annulus , Arc2d , Capsule2d , Circle , CircularSector , CircularSegment , Ellipse , Line2d ,
8
- Plane2d , Polygon , Polyline2d , Rectangle , RegularPolygon , Rhombus , Segment2d , Triangle2d ,
7
+ Annulus , Arc2d , Capsule2d , Circle , CircularSector , CircularSegment , ConvexPolygon , Ellipse ,
8
+ Line2d , Plane2d , Polygon , Polyline2d , Rectangle , RegularPolygon , Rhombus , Segment2d ,
9
+ Triangle2d ,
9
10
} ,
10
11
Dir2 , Isometry2d , Mat2 , Rot2 , Vec2 ,
11
12
} ;
@@ -375,6 +376,16 @@ impl<const N: usize> Bounded2d for Polygon<N> {
375
376
}
376
377
}
377
378
379
+ impl < const N : usize > Bounded2d for ConvexPolygon < N > {
380
+ fn aabb_2d ( & self , isometry : impl Into < Isometry2d > ) -> Aabb2d {
381
+ Aabb2d :: from_point_cloud ( isometry, self . vertices ( ) . as_slice ( ) )
382
+ }
383
+
384
+ fn bounding_circle ( & self , isometry : impl Into < Isometry2d > ) -> BoundingCircle {
385
+ BoundingCircle :: from_point_cloud ( isometry, self . vertices ( ) . as_slice ( ) )
386
+ }
387
+ }
388
+
378
389
#[ cfg( feature = "alloc" ) ]
379
390
impl Bounded2d for BoxedPolygon {
380
391
fn aabb_2d ( & self , isometry : impl Into < Isometry2d > ) -> Aabb2d {
0 commit comments