[][src]Struct bbox::BoundingBox

pub struct BoundingBox<S: RealField + Debug> {
    pub min: Point3<S>,
    pub max: Point3<S>,
}

3D Bounding Box - defined by two diagonally opposing points.

Fields

min: Point3<S>

X-Y-Z-Minimum corner of the box.

max: Point3<S>

X-Y-Z-Maximum corner of the box.

Methods

impl<S: Float + RealField> BoundingBox<S>[src]

pub fn infinity() -> BoundingBox<S>[src]

Returns an infinte sized box.

pub fn neg_infinity() -> BoundingBox<S>[src]

Returns a negatively infinte sized box.

pub fn new(a: &Point3<S>, b: &Point3<S>) -> BoundingBox<S>[src]

Create a new Bounding Box by supplying two points.

pub fn union(&self, other: &BoundingBox<S>) -> BoundingBox<S>[src]

Create a CSG Union of two Bounding Boxes.

pub fn intersection(&self, other: &BoundingBox<S>) -> BoundingBox<S>[src]

Create a CSG Intersection of two Bounding Boxes.

pub fn transform<M>(&self, mat: &M) -> BoundingBox<S> where
    M: Transformation<Point3<S>>, 
[src]

Transform a Bounding Box - resulting in a enclosing axis aligned Bounding Box.

pub fn dilate(&mut self, d: S) -> &mut Self[src]

Dilate a Bounding Box by some amount in all directions.

pub fn insert(&mut self, o: &Point3<S>) -> &mut Self[src]

Add a Point to a Bounding Box, e.g. expand the Bounding Box to contain that point.

pub fn dim(&self) -> Vector3<S>[src]

Return the size of the Box.

pub fn distance(&self, p: &Point3<S>) -> S[src]

Returns the approximate distance of p to the box. The result is guarateed to be not less than the euclidean distance of p to the box.

pub fn contains(&self, p: &Point3<S>) -> bool[src]

Return true if the Bounding Box contains p.

Trait Implementations

impl<S: Clone + RealField + Debug> Clone for BoundingBox<S>[src]

impl<S: PartialEq + RealField + Debug> PartialEq<BoundingBox<S>> for BoundingBox<S>[src]

impl<S: Debug + RealField> Debug for BoundingBox<S>[src]

impl<S: RealField + Debug> StructuralPartialEq for BoundingBox<S>[src]

impl<T: Float + RealField> RelativeEq<BoundingBox<T>> for BoundingBox<T> where
    <T as AbsDiffEq>::Epsilon: Copy,
    T: RelativeEq
[src]

impl<T: Float + RealField> AbsDiffEq<BoundingBox<T>> for BoundingBox<T> where
    <T as AbsDiffEq>::Epsilon: Copy,
    T: AbsDiffEq
[src]

type Epsilon = <T as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.

Auto Trait Implementations

impl<S> Send for BoundingBox<S> where
    S: Scalar

impl<S> Sync for BoundingBox<S> where
    S: Scalar

impl<S> Unpin for BoundingBox<S> where
    S: Scalar + Unpin

impl<S> UnwindSafe for BoundingBox<S> where
    S: Scalar + UnwindSafe

impl<S> RefUnwindSafe for BoundingBox<S> where
    S: RefUnwindSafe + Scalar

Blanket Implementations

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

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

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 = !

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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