Struct bevy_math::primitives::Capsule2d
source · pub struct Capsule2d {
pub radius: f32,
pub half_length: f32,
}
Expand description
A 2D capsule primitive, also known as a stadium or pill shape.
A two-dimensional capsule is defined as a neighborhood of points at a distance (radius) from a line
Fields§
§radius: f32
The radius of the capsule
half_length: f32
Half the height of the capsule, excluding the hemicircles
Implementations§
Trait Implementations§
source§impl Bounded2d for Capsule2d
impl Bounded2d for Capsule2d
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> Deserialize<'de> for Capsule2d
impl<'de> Deserialize<'de> for Capsule2d
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 PartialEq for Capsule2d
impl PartialEq for Capsule2d
impl Copy for Capsule2d
impl Primitive2d for Capsule2d
impl StructuralPartialEq for Capsule2d
Auto Trait Implementations§
impl RefUnwindSafe for Capsule2d
impl Send for Capsule2d
impl Sync for Capsule2d
impl Unpin for Capsule2d
impl UnwindSafe for Capsule2d
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