Struct bbox::BoundingBox
[−]
[src]
pub struct BoundingBox<S: 'static + Real + Debug> { pub min: Point3<S>, pub max: Point3<S>, }
3D Bounding Box - defined by two diagonally opposing points.
Fields
min: Point3<S>
max: Point3<S>
Methods
impl<S: 'static + Float + Real + Debug> 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]
M: Transformation<Point3<S>>,
Transform a Bounding Box - resulting in a enclosing axis aligned Bounding Box.
pub fn dilate(&self, d: S) -> BoundingBox<S>[src]
Dilate a Bounding Box by some amount in all directions.
pub fn insert(&self, o: Point3<S>) -> BoundingBox<S>[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 + 'static + Real + Debug> Clone for BoundingBox<S>[src]
fn clone(&self) -> BoundingBox<S>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<S: Debug + 'static + Real + Debug> Debug for BoundingBox<S>[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<S: PartialEq + 'static + Real + Debug> PartialEq for BoundingBox<S>[src]
fn eq(&self, __arg_0: &BoundingBox<S>) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &BoundingBox<S>) -> bool[src]
This method tests for !=.