pub struct Aabb {
pub min: Vec3,
pub max: Vec3,
}Expand description
Axis-aligned bounding box.
Fields§
§min: Vec3§max: Vec3Implementations§
Source§impl Aabb
impl Aabb
Sourcepub fn from_points(points: impl IntoIterator<Item = Vec3>) -> Option<Self>
pub fn from_points(points: impl IntoIterator<Item = Vec3>) -> Option<Self>
Compute the AABB enclosing all given points.
Returns None if the iterator is empty.
Sourcepub fn contains_point(self, point: Vec3) -> bool
pub fn contains_point(self, point: Vec3) -> bool
Check if a point is inside the AABB.
Sourcepub fn intersects(self, other: Self) -> bool
pub fn intersects(self, other: Self) -> bool
Check if two AABBs overlap.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Aabb
impl<'de> Deserialize<'de> for Aabb
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Aabb
impl StructuralPartialEq for Aabb
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