[][src]Struct splashsurf_lib::AxisAlignedBoundingBox

pub struct AxisAlignedBoundingBox<R: Real, D: DimName> where
    DefaultAllocator: Allocator<R, D>, 
{ /* fields omitted */ }

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>, 
[src]

pub fn zeros() -> Self[src]

Constructs an 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 an 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]

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 or on the boundary of the AABB

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]

impl<R, D> Debug for AxisAlignedBoundingBox<R, D> where
    R: Real,
    D: DimName,
    DefaultAllocator: Allocator<R, D>, 
[src]

impl<R: PartialEq + Real, D: PartialEq + DimName> PartialEq<AxisAlignedBoundingBox<R, D>> for AxisAlignedBoundingBox<R, D> where
    DefaultAllocator: Allocator<R, D>, 
[src]

impl<R: Real, D: DimName> StructuralPartialEq for AxisAlignedBoundingBox<R, D> where
    DefaultAllocator: Allocator<R, D>, 
[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,