[−][src]Struct batbox::AABB
Axis aligned bounding box.
Fields
x_min: Tx_max: Ty_min: Ty_max: TImplementations
impl<T: UNum> AABB<T>[src]
pub fn bottom_left(&self) -> Vec2<T>[src]
pub fn bottom_right(&self) -> Vec2<T>[src]
pub fn top_left(&self) -> Vec2<T>[src]
pub fn top_right(&self) -> Vec2<T>[src]
pub fn center(&self) -> Vec2<T>[src]
pub fn from_corners(p1: Vec2<T>, p2: Vec2<T>) -> Self[src]
pub fn pos_size(pos: Vec2<T>, size: Vec2<T>) -> Self[src]
pub fn map<U: UNum, F: Fn(T) -> U>(self, f: F) -> AABB<U>[src]
pub fn width(&self) -> T[src]
pub fn height(&self) -> T[src]
Get rect's height.
pub fn size(&self) -> Vec2<T>[src]
Get rect's size.
pub fn contains(&self, point: Vec2<T>) -> bool[src]
Check if a point is inside the rect.
Examples
use batbox::*; let rect = AABB::from_corners(vec2(1, 2), vec2(3, 4)); assert!(rect.contains(vec2(2, 3))); assert!(!rect.contains(vec2(5, 5)));
pub fn intersects(&self, other: &Self) -> bool[src]
pub fn translate(self, v: Vec2<T>) -> Self[src]
pub fn add_padding(self, padding: T) -> Self[src]
pub fn points(&self) -> impl Iterator<Item = Vec2<T>> + '_ where
Range<T>: Iterator<Item = T>, [src]
Range<T>: Iterator<Item = T>,
impl<T: Float> AABB<T>[src]
pub fn distance_to(&self, other: &Self) -> T[src]
Trait Implementations
impl<T: Clone> Clone for AABB<T>[src]
impl<T: Copy> Copy for AABB<T>[src]
impl<T: Debug> Debug for AABB<T>[src]
impl<'de, T> Deserialize<'de> for AABB<T> where
T: Deserialize<'de>, [src]
T: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl<T: Eq> Eq for AABB<T>[src]
impl<T: PartialEq> PartialEq<AABB<T>> for AABB<T>[src]
impl<T> Serialize for AABB<T> where
T: Serialize, [src]
T: Serialize,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl<T> StructuralEq for AABB<T>[src]
impl<T> StructuralPartialEq for AABB<T>[src]
impl<T> Trans for AABB<T> where
T: Trans,
T: Trans,
T: Trans,
T: Trans,
T: Trans, [src]
T: Trans,
T: Trans,
T: Trans,
T: Trans,
T: Trans,
Auto Trait Implementations
impl<T> RefUnwindSafe for AABB<T> where
T: RefUnwindSafe, [src]
T: RefUnwindSafe,
impl<T> Send for AABB<T> where
T: Send, [src]
T: Send,
impl<T> Sync for AABB<T> where
T: Sync, [src]
T: Sync,
impl<T> Unpin for AABB<T> where
T: Unpin, [src]
T: Unpin,
impl<T> UnwindSafe for AABB<T> where
T: UnwindSafe, [src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> DynClone for T where
T: Clone, [src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,