Struct bbox::BoundingBox [−][src]
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 + Real> BoundingBox<S>
[src]
impl<S: Float + Real> BoundingBox<S>
pub fn infinity() -> BoundingBox<S>
[src]
pub fn infinity() -> BoundingBox<S>
Returns an infinte sized box.
pub fn neg_infinity() -> BoundingBox<S>
[src]
pub fn neg_infinity() -> BoundingBox<S>
Returns a negatively infinte sized box.
pub fn new(a: &Point3<S>, b: &Point3<S>) -> BoundingBox<S>
[src]
pub fn new(a: &Point3<S>, b: &Point3<S>) -> BoundingBox<S>
Create a new Bounding Box by supplying two points.
pub fn union(&self, other: &BoundingBox<S>) -> BoundingBox<S>
[src]
pub fn union(&self, other: &BoundingBox<S>) -> BoundingBox<S>
Create a CSG Union of two Bounding Boxes.
pub fn intersection(&self, other: &BoundingBox<S>) -> BoundingBox<S>
[src]
pub fn intersection(&self, other: &BoundingBox<S>) -> BoundingBox<S>
Create a CSG Intersection of two Bounding Boxes.
pub fn transform<M>(&self, mat: &M) -> BoundingBox<S> where
M: Transformation<Point3<S>>,
[src]
pub fn transform<M>(&self, mat: &M) -> BoundingBox<S> where
M: Transformation<Point3<S>>,
Transform a Bounding Box - resulting in a enclosing axis aligned Bounding Box.
pub fn dilate(&mut self, d: S) -> &mut Self
[src]
pub fn dilate(&mut self, d: S) -> &mut Self
Dilate a Bounding Box by some amount in all directions.
pub fn insert(&mut self, o: &Point3<S>) -> &mut Self
[src]
pub fn insert(&mut self, o: &Point3<S>) -> &mut Self
Add a Point to a Bounding Box, e.g. expand the Bounding Box to contain that point.
pub fn dim(&self) -> Vector3<S>
[src]
pub fn dim(&self) -> Vector3<S>
Return the size of the Box.
pub fn distance(&self, p: &Point3<S>) -> S
[src]
pub fn distance(&self, p: &Point3<S>) -> S
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]
pub fn contains(&self, p: &Point3<S>) -> bool
Return true if the Bounding Box contains p.
Trait Implementations
impl<S: Clone + Real + Debug> Clone for BoundingBox<S>
[src]
impl<S: Clone + Real + Debug> Clone for BoundingBox<S>
fn clone(&self) -> BoundingBox<S>
[src]
fn clone(&self) -> BoundingBox<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S: Debug + Real + Debug> Debug for BoundingBox<S>
[src]
impl<S: Debug + Real + Debug> Debug for BoundingBox<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: PartialEq + Real + Debug> PartialEq for BoundingBox<S>
[src]
impl<S: PartialEq + Real + Debug> PartialEq for BoundingBox<S>
fn eq(&self, other: &BoundingBox<S>) -> bool
[src]
fn eq(&self, other: &BoundingBox<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &BoundingBox<S>) -> bool
[src]
fn ne(&self, other: &BoundingBox<S>) -> bool
This method tests for !=
.
impl<T: Float + Real> AbsDiffEq for BoundingBox<T> where
<T as AbsDiffEq>::Epsilon: Copy,
T: AbsDiffEq,
[src]
impl<T: Float + Real> AbsDiffEq for BoundingBox<T> where
<T as AbsDiffEq>::Epsilon: Copy,
T: AbsDiffEq,
type Epsilon = <T as AbsDiffEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
fn abs_diff_ne(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_ne(&self, other: &Self, epsilon: Self::Epsilon) -> bool
The inverse of ApproxEq::abs_diff_eq
.
impl<T: Float + Real> RelativeEq for BoundingBox<T> where
<T as AbsDiffEq>::Epsilon: Copy,
T: RelativeEq,
[src]
impl<T: Float + Real> RelativeEq for BoundingBox<T> where
<T as AbsDiffEq>::Epsilon: Copy,
T: RelativeEq,
fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
[src]
fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Self,
epsilon: <T as AbsDiffEq>::Epsilon,
max_relative: <T as AbsDiffEq>::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: <T as AbsDiffEq>::Epsilon,
max_relative: <T as AbsDiffEq>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
Auto Trait Implementations
impl<S> Send for BoundingBox<S>
impl<S> Send for BoundingBox<S>
impl<S> Sync for BoundingBox<S>
impl<S> Sync for BoundingBox<S>