[−][src]Trait quicksilver::geom::Shape
The collision and positional attributes of shapes
Required methods
#[must_use]
fn contains(
&self,
point: impl Into<Vector>
) -> bool
#[must_use]
fn contains(&self,
point: impl Into<Vector>
) -> bool
If the point lies on the shape's boundary or within it
#[must_use]
fn overlaps(
&self,
other: &impl Shape
) -> bool
#[must_use]
fn overlaps(&self,
other: &impl Shape
) -> bool
If any area is bounded by both either shape
#[must_use]
fn center(&self) -> Vector
#[must_use]
fn center(&self) -> VectorThe point all other points are equidistant to in the shape
#[must_use]
fn bounding_box(&self) -> Rectangle
#[must_use]
fn bounding_box(&self) -> RectangleA Rectangle that contains the entire shape
#[must_use]
fn translate(
&self,
amount: impl Into<Vector>
) -> Self where
Self: Sized,
#[must_use]
fn translate(&self,
amount: impl Into<Vector>
) -> Self where
Self: Sized,
Create a copy of the shape with an offset center
Provided methods
#[must_use]
fn intersects(&self, line: &Line) -> bool
#[must_use]
fn intersects(&self, line: &Line) -> boolIf any area bounded by the shape falls on the line
#[must_use]
fn overlaps_circle(&self, circle: &Circle) -> bool
#[must_use]
fn overlaps_circle(&self, circle: &Circle) -> boolIf any area is bounded by both the shape and the circle
#[must_use]
fn overlaps_rectangle(&self, rectangle: &Rectangle) -> bool
#[must_use]
fn overlaps_rectangle(&self, rectangle: &Rectangle) -> boolIf any area is bounded by both the shape and the rectangle
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self where
Self: Sized,
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self whereSelf: Sized,
Create a copy of the shape that is contained within the bound
#[must_use]
fn with_center(
&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
#[must_use]
fn with_center(&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
Create a copy of the shape with an offset center
Implementors
impl Shape for Circle
[src]
fn contains(
&self,
v: impl Into<Vector>
) -> bool
[src]
&self,
v: impl Into<Vector>
) -> bool
fn overlaps_circle(&self, c: &Circle) -> bool
[src]
fn overlaps(
&self,
shape: &impl Shape
) -> bool
[src]
&self,
shape: &impl Shape
) -> bool
fn center(&self) -> Vector
[src]
fn bounding_box(&self) -> Rectangle
[src]
fn translate(
&self,
v: impl Into<Vector>
) -> Self
[src]
&self,
v: impl Into<Vector>
) -> Self
#[must_use]
fn intersects(&self, line: &Line) -> bool
[src]
#[must_use]
fn intersects(&self, line: &Line) -> bool#[must_use]
fn overlaps_rectangle(&self, rectangle: &Rectangle) -> bool
[src]
#[must_use]
fn overlaps_rectangle(&self, rectangle: &Rectangle) -> bool#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self where
Self: Sized,
[src]
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self whereSelf: Sized,
#[must_use]
fn with_center(
&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
[src]
#[must_use]
fn with_center(&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
impl Shape for Line
[src]
fn contains(
&self,
v: impl Into<Vector>
) -> bool
[src]
&self,
v: impl Into<Vector>
) -> bool
fn intersects(&self, l: &Line) -> bool
[src]
fn overlaps_circle(&self, c: &Circle) -> bool
[src]
fn overlaps_rectangle(&self, b: &Rectangle) -> bool
[src]
fn overlaps(
&self,
shape: &impl Shape
) -> bool
[src]
&self,
shape: &impl Shape
) -> bool
fn center(&self) -> Vector
[src]
fn bounding_box(&self) -> Rectangle
[src]
fn translate(
&self,
v: impl Into<Vector>
) -> Self
[src]
&self,
v: impl Into<Vector>
) -> Self
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self where
Self: Sized,
[src]
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self whereSelf: Sized,
#[must_use]
fn with_center(
&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
[src]
#[must_use]
fn with_center(&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
impl Shape for Rectangle
[src]
fn contains(
&self,
point: impl Into<Vector>
) -> bool
[src]
&self,
point: impl Into<Vector>
) -> bool
fn overlaps_circle(&self, c: &Circle) -> bool
[src]
fn overlaps_rectangle(&self, b: &Rectangle) -> bool
[src]
fn intersects(&self, l: &Line) -> bool
[src]
fn overlaps(
&self,
shape: &impl Shape
) -> bool
[src]
&self,
shape: &impl Shape
) -> bool
fn center(&self) -> Vector
[src]
fn bounding_box(&self) -> Rectangle
[src]
fn translate(
&self,
v: impl Into<Vector>
) -> Self
[src]
&self,
v: impl Into<Vector>
) -> Self
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self where
Self: Sized,
[src]
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self whereSelf: Sized,
#[must_use]
fn with_center(
&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
[src]
#[must_use]
fn with_center(&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
impl Shape for Triangle
[src]
fn contains(
&self,
v: impl Into<Vector>
) -> bool
[src]
&self,
v: impl Into<Vector>
) -> bool
fn intersects(&self, line: &Line) -> bool
[src]
fn overlaps_circle(&self, circ: &Circle) -> bool
[src]
fn overlaps_rectangle(&self, rect: &Rectangle) -> bool
[src]
fn overlaps(
&self,
other: &impl Shape
) -> bool
[src]
&self,
other: &impl Shape
) -> bool
fn center(&self) -> Vector
[src]
fn bounding_box(&self) -> Rectangle
[src]
fn translate(
&self,
v: impl Into<Vector>
) -> Self
[src]
&self,
v: impl Into<Vector>
) -> Self
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self where
Self: Sized,
[src]
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self whereSelf: Sized,
#[must_use]
fn with_center(
&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
[src]
#[must_use]
fn with_center(&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
impl Shape for Vector
[src]
fn contains(
&self,
v: impl Into<Vector>
) -> bool
[src]
&self,
v: impl Into<Vector>
) -> bool
fn overlaps(
&self,
shape: &impl Shape
) -> bool
[src]
&self,
shape: &impl Shape
) -> bool
fn center(&self) -> Vector
[src]
fn bounding_box(&self) -> Rectangle
[src]
fn translate(
&self,
v: impl Into<Vector>
) -> Vector
[src]
&self,
v: impl Into<Vector>
) -> Vector
#[must_use]
fn intersects(&self, line: &Line) -> bool
[src]
#[must_use]
fn intersects(&self, line: &Line) -> bool#[must_use]
fn overlaps_circle(&self, circle: &Circle) -> bool
[src]
#[must_use]
fn overlaps_circle(&self, circle: &Circle) -> bool#[must_use]
fn overlaps_rectangle(&self, rectangle: &Rectangle) -> bool
[src]
#[must_use]
fn overlaps_rectangle(&self, rectangle: &Rectangle) -> bool#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self where
Self: Sized,
[src]
#[must_use]
fn constrain(&self, outer: &Rectangle) -> Self whereSelf: Sized,
#[must_use]
fn with_center(
&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,
[src]
#[must_use]
fn with_center(&self,
center: impl Into<Vector>
) -> Self where
Self: Sized,