[−][src]Struct gut::bbox::BBox
General purpose bounding box structure.
Methods
impl<T: Float> BBox<T>
[src]
pub fn new(minb: [T; 3], maxb: [T; 3]) -> Self
[src]
Construct a bounding box containing points minb
and maxb
.
Examples
let min_p = [0.0; 3]; let max_p = [1.5, 0.5, 1.0]; let sample_box = BBox::<f32>::new(min_p, max_p); assert_eq!(sample_box.min_corner(), min_p); assert_eq!(sample_box.max_corner(), max_p);
pub fn unit() -> BBox<T>
[src]
Construct a unit bounding box from zero to one in each dimension.
Examples
let unit_box = BBox::<f32>::new( [0.0; 3], [1.0; 3]); assert_eq!(BBox::<f32>::unit(), unit_box);
pub fn size(&self) -> [T; 3]
[src]
Get the size of the box in each dimension.
Examples
let unit_box = BBox::<f32>::unit(); assert_eq!(unit_box.size(), [1.0, 1.0, 1.0]);
pub fn max_axis(&self) -> (u8, T)
[src]
Determine the axis of the maximum side length of the box and return both: the axis index (x => 0, y => 1, z => 2) and the length.
Examples
let min_p = [0.0; 3]; let max_p = [1.5, 0.5, 1.0]; let sample_box = BBox::<f32>::new(min_p, max_p); assert_eq!(sample_box.max_axis(), (0, 1.5));
pub fn min_corner(&self) -> [T; 3]
[src]
pub fn max_corner(&self) -> [T; 3]
[src]
pub fn diameter(&self) -> T where
T: BaseFloat,
[src]
T: BaseFloat,
Diameter of the bounding box is the distance between the min and max corners.
pub fn corner<C: Copy + Into<Corner>>(&self, which: C) -> [T; 3]
[src]
Trait Implementations
impl<T: Float> Empty for BBox<T>
[src]
impl<T: PartialOrd + Copy> Contains<[T; 3]> for BBox<T>
[src]
impl<'a, T: Float, P> Absorb<P> for &'a mut BBox<T> where
P: Into<[T; 3]>,
[src]
P: Into<[T; 3]>,
impl<'a, T: Float> Absorb<BBox<T>> for &'a mut BBox<T>
[src]
impl<T: Float> Intersect<BBox<T>> for BBox<T>
[src]
type Output = Self
fn intersect(self, other: Self) -> Self
[src]
fn intersects(self, other: Self) -> bool
[src]
impl<'a, T: Float> Centroid<Option<[T; 3]>> for &'a BBox<T>
[src]
impl<T: Clone> Clone for BBox<T>
[src]
impl<T: Copy> Copy for BBox<T>
[src]
impl<T: PartialEq> PartialEq<BBox<T>> for BBox<T>
[src]
impl<T: Debug> Debug for BBox<T>
[src]
impl<T> StructuralPartialEq for BBox<T>
[src]
Auto Trait Implementations
impl<T> Send for BBox<T> where
T: Send,
T: Send,
impl<T> Sync for BBox<T> where
T: Sync,
T: Sync,
impl<T> Unpin for BBox<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for BBox<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for BBox<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Bytes for T
[src]
impl<T> Pod for T where
T: 'static + Copy + Send + Sync + Any,
[src]
T: 'static + Copy + Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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 = !
The type returned in the event of a conversion error.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,