pub struct Aabb2<V = Vec2> {
pub min: V,
pub max: V,
}Fields§
§min: V§max: VImplementations§
Source§impl<V: Copy + Into<[f32; 2]> + From<[f32; 2]>> Aabb2<V>
impl<V: Copy + Into<[f32; 2]> + From<[f32; 2]>> Aabb2<V>
pub fn from_min_size(min: V, size: V) -> Self
Sourcepub fn overlaps(self, other: Self) -> bool
pub fn overlaps(self, other: Self) -> bool
Positive-area overlap: touching edges alone do not count as penetration. This distinction matters when a character rests on a platform.
Sourcepub fn cast_segment(self, start: V, end: V) -> Option<f32>
pub fn cast_segment(self, start: V, end: V) -> Option<f32>
First hit along a finite segment, as a fraction in [0, 1]. Starts inside/on the boundary return zero; touching boundaries count as hits.
Trait Implementations§
impl<V: Copy> Copy for Aabb2<V>
impl<V> StructuralPartialEq for Aabb2<V>
Auto Trait Implementations§
impl<V> Freeze for Aabb2<V>where
V: Freeze,
impl<V> RefUnwindSafe for Aabb2<V>where
V: RefUnwindSafe,
impl<V> Send for Aabb2<V>where
V: Send,
impl<V> Sync for Aabb2<V>where
V: Sync,
impl<V> Unpin for Aabb2<V>where
V: Unpin,
impl<V> UnwindSafe for Aabb2<V>where
V: 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