pub struct AABB {
pub min: Vec2,
pub max: Vec2,
}Fields§
§min: Vec2§max: Vec2Implementations§
Source§impl AABB
impl AABB
pub fn new(min: Vec2, max: Vec2) -> Self
pub fn from_two_points(a: Vec2, b: Vec2) -> Self
pub fn from_top_left(top_left: Vec2, size: Vec2) -> Self
pub fn from_center_size(center: Vec2, size: Vec2) -> Self
pub fn center(&self) -> Vec2
pub fn size(&self) -> Vec2
pub fn contains(&self, point: Vec2) -> bool
pub fn intersects(&self, other: &AABB) -> bool
pub fn expand_to_include_point(&mut self, point: Vec2)
pub fn expand_to_include_aabb(&mut self, other: &AABB)
pub fn top_left(&self) -> Vec2
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AABB
impl RefUnwindSafe for AABB
impl Send for AABB
impl Sync for AABB
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more