pub struct Polygon {
pub vertices: [Vec2; 8],
pub normals: [Vec2; 8],
pub centroid: Vec2,
pub radius: f32,
pub count: i32,
}Expand description
A solid convex polygon. It is assumed that the interior of the polygon is
to the left of each edge. Polygons have a maximum number of vertices equal
to MAX_POLYGON_VERTICES. In most cases you should not need many
vertices for a convex polygon. (b2Polygon)
@warning DO NOT fill this out manually, instead use a helper function like
make_polygon or make_box.
Fields§
§vertices: [Vec2; 8]The polygon vertices
normals: [Vec2; 8]The outward normal vectors of the polygon sides
centroid: Vec2The centroid of the polygon
radius: f32The external radius for rounded polygons
count: i32The number of polygon vertices
Trait Implementations§
impl Copy for Polygon
impl StructuralPartialEq for Polygon
Auto Trait Implementations§
impl Freeze for Polygon
impl RefUnwindSafe for Polygon
impl Send for Polygon
impl Sync for Polygon
impl Unpin for Polygon
impl UnsafeUnpin for Polygon
impl UnwindSafe for Polygon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more