Struct bevy_math::primitives::Polygon
source · pub struct Polygon<const N: usize> {
pub vertices: [Vec2; N],
}
Expand description
A polygon with N vertices.
For a version without generics: BoxedPolygon
Fields§
§vertices: [Vec2; N]
The vertices of the Polygon
Implementations§
Trait Implementations§
source§impl<const N: usize> Bounded2d for Polygon<N>
impl<const N: usize> Bounded2d for Polygon<N>
source§fn aabb_2d(&self, translation: Vec2, rotation: f32) -> Aabb2d
fn aabb_2d(&self, translation: Vec2, rotation: f32) -> Aabb2d
Get an axis-aligned bounding box for the shape with the given translation and rotation.
The rotation is in radians, counterclockwise, with 0 meaning no rotation.
source§fn bounding_circle(&self, translation: Vec2, rotation: f32) -> BoundingCircle
fn bounding_circle(&self, translation: Vec2, rotation: f32) -> BoundingCircle
Get a bounding circle for the shape
The rotation is in radians, counterclockwise, with 0 meaning no rotation.
source§impl<'de, const N: usize> Deserialize<'de> for Polygon<N>
impl<'de, const N: usize> Deserialize<'de> for Polygon<N>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<const N: usize> PartialEq for Polygon<N>
impl<const N: usize> PartialEq for Polygon<N>
impl<const N: usize> Primitive2d for Polygon<N>
impl<const N: usize> StructuralPartialEq for Polygon<N>
Auto Trait Implementations§
impl<const N: usize> RefUnwindSafe for Polygon<N>
impl<const N: usize> Send for Polygon<N>
impl<const N: usize> Sync for Polygon<N>
impl<const N: usize> Unpin for Polygon<N>
impl<const N: usize> UnwindSafe for Polygon<N>
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