pub struct Circle {
pub pos: Vector,
pub radius: f32,
}
Expand description
A circle with a center and a radius
Fields§
§pos: Vector
The position of the center of the circle
radius: f32
The radius of the circle
Implementations§
Trait Implementations§
Source§impl Shape for Circle
impl Shape for Circle
Source§fn overlaps_circle(&self, c: &Circle) -> bool
fn overlaps_circle(&self, c: &Circle) -> bool
If any area is bounded by both the shape and the circle
Source§fn overlaps(&self, shape: &impl Shape) -> bool
fn overlaps(&self, shape: &impl Shape) -> bool
👎Deprecated since 0.4.0-alpha0.5: Use another collision library like
vek
instead; please comment on issue #552 for use-cases other libraries don’t solveIf any area is bounded by both either shape
Source§fn bounding_box(&self) -> Rectangle
fn bounding_box(&self) -> Rectangle
A Rectangle that contains the entire shape
Source§fn intersects(&self, line: &Line) -> bool
fn intersects(&self, line: &Line) -> bool
If any area bounded by the shape falls on the line
Source§fn overlaps_rectangle(&self, rectangle: &Rectangle) -> bool
fn overlaps_rectangle(&self, rectangle: &Rectangle) -> bool
If any area is bounded by both the shape and the rectangle
Source§fn transformed_bounding_box(&self, transform: Transform) -> Rectangle
fn transformed_bounding_box(&self, transform: Transform) -> Rectangle
👎Deprecated since 0.4.0-alpha0.5: Use another collision library like
vek
instead; please comment on issue #552 for use-cases other libraries don’t solveApply a transform to a shape then get the bounding box for the transformed shape Read more
Source§fn constrain(&self, outer: &Rectangle) -> Selfwhere
Self: Sized,
fn constrain(&self, outer: &Rectangle) -> Selfwhere
Self: Sized,
Create a copy of the shape that is contained within the bound
Source§fn with_center(&self, center: Vector) -> Selfwhere
Self: Sized,
fn with_center(&self, center: Vector) -> Selfwhere
Self: Sized,
Create a copy of the shape with an offset center
impl Copy for Circle
impl Eq 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 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