pub struct Rectangle<P>where
P: Point,{ /* private fields */ }
Expand description
Implementations§
Source§impl<P> Rectangle<P>where
P: Point,
impl<P> Rectangle<P>where
P: Point,
Sourcepub fn from_corners(corner_1: P, corner_2: P) -> Self
pub fn from_corners(corner_1: P, corner_2: P) -> Self
Creates a new rectangle defined by two corners.
Sourcepub fn from_aabb(aabb: AABB<P>) -> Self
pub fn from_aabb(aabb: AABB<P>) -> Self
Creates a new rectangle defined by it’s [axis aligned bounding box(AABB).
Trait Implementations§
Source§impl<P> Ord for Rectangle<P>
impl<P> Ord for Rectangle<P>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<P> PartialOrd for Rectangle<P>where
P: Point + PartialOrd,
impl<P> PartialOrd for Rectangle<P>where
P: Point + PartialOrd,
Source§impl<P> PointDistance for Rectangle<P>where
P: Point,
impl<P> PointDistance for Rectangle<P>where
P: Point,
Source§fn distance_2(
&self,
point: &<Self::Envelope as Envelope>::Point,
) -> <<Self::Envelope as Envelope>::Point as Point>::Scalar
fn distance_2( &self, point: &<Self::Envelope as Envelope>::Point, ) -> <<Self::Envelope as Envelope>::Point as Point>::Scalar
Returns the squared distance between an object and a point. Read more
Source§fn contains_point(&self, point: &<Self::Envelope as Envelope>::Point) -> bool
fn contains_point(&self, point: &<Self::Envelope as Envelope>::Point) -> bool
Returns
true
if a point is contained within this object. Read moreSource§fn distance_2_if_less_or_equal(
&self,
point: &<Self::Envelope as Envelope>::Point,
max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar,
) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
fn distance_2_if_less_or_equal( &self, point: &<Self::Envelope as Envelope>::Point, max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar, ) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
Returns the squared distance to this object, or
None
if the distance
is larger than a given maximum value. Read moreSource§impl<P> RTreeObject for Rectangle<P>where
P: Point,
impl<P> RTreeObject for Rectangle<P>where
P: Point,
impl<P> Copy for Rectangle<P>
impl<P> Eq for Rectangle<P>
impl<P> StructuralPartialEq for Rectangle<P>where
P: Point,
Auto Trait Implementations§
impl<P> Freeze for Rectangle<P>where
P: Freeze,
impl<P> RefUnwindSafe for Rectangle<P>where
P: RefUnwindSafe,
impl<P> Send for Rectangle<P>where
P: Send,
impl<P> Sync for Rectangle<P>where
P: Sync,
impl<P> Unpin for Rectangle<P>where
P: Unpin,
impl<P> UnwindSafe for Rectangle<P>where
P: UnwindSafe,
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