graphics_shapes/intersection/
mod.rs

1pub mod circle;
2pub mod ellipse;
3pub mod line;
4pub mod polygon;
5pub mod rect;
6mod shared;
7pub mod triangle;
8
9use crate::prelude::*;
10
11pub trait IntersectsShape {
12    /// Returns true if `rect` intersects `self`
13    #[must_use]
14    fn intersects_rect(&self, rect: &Rect) -> bool;
15
16    /// Returns true if `circle` intersects `self`
17    #[must_use]
18    fn intersects_circle(&self, circle: &Circle) -> bool;
19
20    /// Returns true if `line` intersects `self`
21    #[must_use]
22    fn intersects_line(&self, line: &Line) -> bool;
23
24    /// Returns true if `triangle` intersects `self`
25    #[must_use]
26    fn intersects_triangle(&self, triangle: &Triangle) -> bool;
27
28    /// Returns true if `ellipse` intersects `self`
29    #[must_use]
30    fn intersects_ellipse(&self, ellipse: &Ellipse) -> bool;
31
32    /// Returns true if `polygon` intersects `self`
33    #[must_use]
34    fn intersects_polygon(&self, polygon: &Polygon) -> bool;
35}