pub struct Circle {
pub center: Vec2,
pub radius: f32,
}Expand description
World-space circle for standalone overlap queries.
Fields§
§center: Vec2Center in world units.
radius: f32Positive radius.
Implementations§
Source§impl Circle
impl Circle
Sourcepub fn new(center: Vec2, radius: f32) -> Self
pub fn new(center: Vec2, radius: f32) -> Self
Creates a circle. Panics for a nonfinite center or invalid radius.
Sourcepub fn overlap(&self, other: &Self) -> Option<Penetration2D>
pub fn overlap(&self, other: &Self) -> Option<Penetration2D>
Positive overlap; normal moves this circle away from the other.
Sourcepub fn overlap_box(&self, other: &Aabb2) -> Option<Penetration2D>
pub fn overlap_box(&self, other: &Aabb2) -> Option<Penetration2D>
Positive overlap against a box, including a center inside the box. Empty or flat boxes have no positive overlap.
Trait Implementations§
impl Copy for Circle
impl StructuralPartialEq for Circle
Auto Trait Implementations§
impl Freeze for Circle
impl RefUnwindSafe for Circle
impl Send for Circle
impl Sync for Circle
impl Unpin for Circle
impl UnsafeUnpin for Circle
impl UnwindSafe for Circle
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