pub struct Aabb {
pub min: [f32; 3],
pub max: [f32; 3],
}Expand description
An axis-aligned box from min to max, both corners included.
Fields§
§min: [f32; 3]§max: [f32; 3]Implementations§
Source§impl Aabb
impl Aabb
pub const fn new(min: [f32; 3], max: [f32; 3]) -> Self
Sourcepub fn around(points: impl IntoIterator<Item = [f32; 3]>) -> Option<Self>
pub fn around(points: impl IntoIterator<Item = [f32; 3]>) -> Option<Self>
The box around points; None when there are none.
Sourcepub fn corners(&self) -> [[f32; 3]; 8]
pub fn corners(&self) -> [[f32; 3]; 8]
The eight corners, corner i taking max along axis k where
bit k of i is set.
Sourcepub fn moved(&self, f: impl Fn([f32; 3]) -> [f32; 3]) -> Self
pub fn moved(&self, f: impl Fn([f32; 3]) -> [f32; 3]) -> Self
The box around the corners once each is moved by f, which for a
rigid motion or any affine map holds everything the box held.
Sourcepub fn transformed(&self, m: &[[f32; 4]; 4]) -> Self
pub fn transformed(&self, m: &[[f32; 4]; 4]) -> Self
The box moved by the affine column-major matrix m (m[3] the
translation; its last row is not read).
Trait Implementations§
impl Copy for Aabb
impl StructuralPartialEq for Aabb
Auto Trait Implementations§
impl Forget for Aabb
impl Freeze for Aabb
impl Move 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