@@ -4,8 +4,9 @@ use crate::{
44 bounding:: BoundingVolume ,
55 ops,
66 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 ,
910 } ,
1011 Dir2 , Isometry2d , Mat2 , Rot2 , Vec2 ,
1112} ;
@@ -375,6 +376,16 @@ impl<const N: usize> Bounded2d for Polygon<N> {
375376 }
376377}
377378
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+
378389#[ cfg( feature = "alloc" ) ]
379390impl Bounded2d for BoxedPolygon {
380391 fn aabb_2d ( & self , isometry : impl Into < Isometry2d > ) -> Aabb2d {
0 commit comments