pub struct Rect {
pub min: Vec2,
pub max: Vec2,
}Fields§
§min: Vec2§max: Vec2Implementations§
Source§impl Rect
impl Rect
pub fn new() -> Self
pub fn from_points(a: Vec2, b: Vec2) -> Self
pub fn size(&self) -> Vec2
pub fn area(&self) -> f64
pub fn scale(&self) -> f64
pub fn center(&self) -> Vec2
pub fn contains_point(&self, p: Vec2) -> bool
pub fn contains_rect(&self, other: &Rect) -> bool
pub fn does_overlap(&self, other: &Rect) -> bool
pub fn is_empty(&self) -> bool
pub fn is_finite(&self) -> bool
pub fn union_point(&mut self, p: Vec2)
pub fn union_rect(&self, other: &Rect) -> Rect
Trait Implementations§
Source§impl AddAssign<Vec2> for Rect
impl AddAssign<Vec2> for Rect
Source§fn add_assign(&mut self, shift: Vec2)
fn add_assign(&mut self, shift: Vec2)
Performs the
+= operation. Read moreimpl Copy for Rect
Source§impl MulAssign<Vec2> for Rect
impl MulAssign<Vec2> for Rect
Source§fn mul_assign(&mut self, scale: Vec2)
fn mul_assign(&mut self, scale: Vec2)
Performs the
*= operation. Read moreimpl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnsafeUnpin for Rect
impl UnwindSafe for Rect
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