pub struct AABB {
pub min: Point2,
pub max: Point2,
}Expand description
2D axis-aligned bounding box.
Fields§
§min: Point2§max: Point2Implementations§
Source§impl AABB
impl AABB
pub fn new(min: Point2, max: Point2) -> Self
pub fn from_points(pts: &[Point2]) -> Option<Self>
pub fn width(self) -> f64
pub fn height(self) -> f64
pub fn center(self) -> Point2
pub fn area(self) -> f64
pub fn contains(self, p: Point2) -> bool
pub fn intersects(self, other: AABB) -> bool
pub fn merge(self, other: AABB) -> AABB
pub fn expand(self, padding: f64) -> AABB
Trait Implementations§
impl Copy for AABB
impl StructuralPartialEq for AABB
Auto Trait Implementations§
impl Freeze for AABB
impl RefUnwindSafe for AABB
impl Send for AABB
impl Sync for AABB
impl Unpin for AABB
impl UnsafeUnpin for AABB
impl UnwindSafe for AABB
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