Struct splashsurf_lib::AxisAlignedBoundingBox [−][src]
Type representing an axis aligned bounding box in arbitrary dimensions
Implementations
impl<R, D> AxisAlignedBoundingBox<R, D> where
R: Real,
D: DimName,
DefaultAllocator: Allocator<R, D>,
VectorN<R, D>: ThreadSafe,
[src]
R: Real,
D: DimName,
DefaultAllocator: Allocator<R, D>,
VectorN<R, D>: ThreadSafe,
pub fn from_points_par(points: &[VectorN<R, D>]) -> Self
[src]
Constructs the smallest AABB fitting around all the given points, parallel version
impl<R, D> AxisAlignedBoundingBox<R, D> where
R: Real,
D: DimName,
DefaultAllocator: Allocator<R, D>,
[src]
R: Real,
D: DimName,
DefaultAllocator: Allocator<R, D>,
pub fn zeros() -> Self
[src]
Constructs a degenerate AABB with min and max set to zero
pub fn new(min: VectorN<R, D>, max: VectorN<R, D>) -> Self
[src]
Constructs an AABB with the given min and max bounding points
pub fn from_point(point: VectorN<R, D>) -> Self
[src]
Constructs a degenerate AABB with zero extents centered at the given point
pub fn from_points(points: &[VectorN<R, D>]) -> Self
[src]
Constructs the smallest AABB fitting around all the given points
pub fn try_convert<T>(&self) -> Option<AxisAlignedBoundingBox<T, D>> where
T: Real,
DefaultAllocator: Allocator<T, D>,
[src]
T: Real,
DefaultAllocator: Allocator<T, D>,
Tries to convert the AABB from one real type to another real type, returns None if conversion fails
pub fn min(&self) -> &VectorN<R, D>
[src]
Returns the min coordinate of the bounding box
pub fn max(&self) -> &VectorN<R, D>
[src]
Returns the max coordinate of the bounding box
pub fn is_consistent(&self) -> bool
[src]
Returns whether the AABB is consistent, i.e. aabb.min()[i] <= aabb.max()[i]
for all i
pub fn is_degenerate(&self) -> bool
[src]
Returns whether the AABB is degenerate in any dimension, i.e. aabb.min()[i] == aabb.max()[i]
for any i
pub fn extents(&self) -> VectorN<R, D>
[src]
Returns the extents of the bounding box (vector connecting min and max point of the box)
pub fn min_extent(&self) -> R
[src]
Returns the smallest scalar extent of the AABB over all of its dimensions
pub fn max_extent(&self) -> R
[src]
Returns the largest scalar extent of the AABB over all of its dimensions
pub fn centroid(&self) -> VectorN<R, D>
[src]
Returns the geometric centroid of the AABB (mean of the corner points)
pub fn contains_point(&self, point: &VectorN<R, D>) -> bool
[src]
Checks if the given point is inside of the AABB, the AABB is considered to be half-open to its max coordinate
pub fn translate(&mut self, vector: &VectorN<R, D>)
[src]
Translates the AABB by the given vector
pub fn center_at_origin(&mut self)
[src]
Translates the AABB to center it at the coordinate origin (moves the centroid to the coordinate origin)
pub fn scale_uniformly(&mut self, scaling: R)
[src]
Multiplies a uniform, local scaling to the AABB (i.e. multiplying its extents as if it was centered at the origin)
pub fn join(&mut self, other: &Self)
[src]
Enlarges this AABB to the smallest AABB enclosing both itself and another AABB
pub fn join_with_point(&mut self, point: &VectorN<R, D>)
[src]
Enlarges this AABB to the smallest AABB enclosing both itself and another point
pub fn grow_uniformly(&mut self, margin: R)
[src]
Grows this AABB uniformly in all directions by the given scalar margin (i.e. adding the margin to min/max extents)
pub fn enclosing_cube(&self) -> Self
[src]
Returns the smallest cubical AABB with the same center that encloses this AABB
Trait Implementations
impl<R: Clone + Real, D: Clone + DimName> Clone for AxisAlignedBoundingBox<R, D> where
DefaultAllocator: Allocator<R, D>,
[src]
DefaultAllocator: Allocator<R, D>,
fn clone(&self) -> AxisAlignedBoundingBox<R, D>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<R, D> Debug for AxisAlignedBoundingBox<R, D> where
R: Real,
D: DimName,
DefaultAllocator: Allocator<R, D>,
[src]
R: Real,
D: DimName,
DefaultAllocator: Allocator<R, D>,
impl<R: Eq + Real, D: Eq + DimName> Eq for AxisAlignedBoundingBox<R, D> where
DefaultAllocator: Allocator<R, D>,
[src]
DefaultAllocator: Allocator<R, D>,
impl<R: PartialEq + Real, D: PartialEq + DimName> PartialEq<AxisAlignedBoundingBox<R, D>> for AxisAlignedBoundingBox<R, D> where
DefaultAllocator: Allocator<R, D>,
[src]
DefaultAllocator: Allocator<R, D>,
fn eq(&self, other: &AxisAlignedBoundingBox<R, D>) -> bool
[src]
fn ne(&self, other: &AxisAlignedBoundingBox<R, D>) -> bool
[src]
impl<R: Real, D: DimName> StructuralEq for AxisAlignedBoundingBox<R, D> where
DefaultAllocator: Allocator<R, D>,
[src]
DefaultAllocator: Allocator<R, D>,
impl<R: Real, D: DimName> StructuralPartialEq for AxisAlignedBoundingBox<R, D> where
DefaultAllocator: Allocator<R, D>,
[src]
DefaultAllocator: Allocator<R, D>,
Auto Trait Implementations
impl<R, D> !RefUnwindSafe for AxisAlignedBoundingBox<R, D>
[src]
impl<R, D> !Send for AxisAlignedBoundingBox<R, D>
[src]
impl<R, D> !Sync for AxisAlignedBoundingBox<R, D>
[src]
impl<R, D> !Unpin for AxisAlignedBoundingBox<R, D>
[src]
impl<R, D> !UnwindSafe for AxisAlignedBoundingBox<R, D>
[src]
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
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>,