pub struct AABB {
pub min: Vec3,
pub max: Vec3,
}Expand description
Axis-aligned bounding box.
Fields§
§min: Vec3Lower corner (componentwise minimum).
max: Vec3Upper corner (componentwise maximum).
Implementations§
Source§impl AABB
impl AABB
Sourcepub fn expanded(&self, pad: f64) -> Self
pub fn expanded(&self, pad: f64) -> Self
Grow the box by pad in every direction.
A broad phase that culls on the un-padded boxes decides which pairs the
narrow phase is even allowed to see, so a margin applied only in the
narrow phase is silently capped by it: an AABB gap never exceeds the
true surface gap, so any pair inside the margin has AABBs at most
margin apart, and padding each by half of that is exactly enough to
keep them. Without it the margin band is unreachable for most pairs.
Sourcepub fn from_geometry(geom: &Geometry, pos: &Vec3, rot: &Mat3) -> Self
pub fn from_geometry(geom: &Geometry, pos: &Vec3, rot: &Mat3) -> Self
Compute AABB for a geometry at given position and rotation.
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 UnsafeUnpin 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