[−][src]Struct fart_aabb::Aabb
An axis-aligned bounding box.
T
is the numeric type.i32
orf64
etc.U
is the unit.ScreenSpace
orWorldSpace
etc.
Methods
impl<T, U> Aabb<T, U> where
T: Copy + Num + PartialOrd,
[src]
T: Copy + Num + PartialOrd,
pub fn new(min: TypedPoint2D<T, U>, max: TypedPoint2D<T, U>) -> Aabb<T, U>
[src]
Construct a new axis-aligned bounding box.
min
's x
and y
components must be less than or equal to max
's.
pub fn for_vertices<I>(vertices: I) -> Aabb<T, U> where
I: IntoIterator<Item = TypedPoint2D<T, U>>,
[src]
I: IntoIterator<Item = TypedPoint2D<T, U>>,
Construct a new axis-aligned bounding box that contains the given set of vertices.
Panics
Panics if vertices
is empty.
pub fn min(&self) -> TypedPoint2D<T, U>
[src]
Get this AABB's min.
pub fn max(&self) -> TypedPoint2D<T, U>
[src]
Get this AABB's max.
pub fn width(&self) -> T
[src]
Get the width of this AABB.
pub fn height(&self) -> T
[src]
Get the height of this AABB.
pub fn area(&self) -> T
[src]
Get this AABB's area.
pub fn join(&self, other: &Aabb<T, U>) -> Aabb<T, U>
[src]
Return the least upper bound of self
and other
.
pub fn contains(&self, other: &Aabb<T, U>) -> bool
[src]
Does self
contain other
?
pub fn intersects(&self, other: &Aabb<T, U>) -> bool
[src]
Does self
intersect with other
?
Trait Implementations
impl<T: PartialEq, U: PartialEq> PartialEq<Aabb<T, U>> for Aabb<T, U>
[src]
impl<T: Clone, U: Clone> Clone for Aabb<T, U>
[src]
fn clone(&self) -> Aabb<T, U>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T, U> Debug for Aabb<T, U> where
T: Debug,
[src]
T: Debug,
Auto Trait Implementations
impl<T, U> Send for Aabb<T, U> where
T: Send,
U: Send,
T: Send,
U: Send,
impl<T, U> Sync for Aabb<T, U> where
T: Sync,
U: Sync,
T: Sync,
U: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,