Struct gut::bbox::BBox [−][src]
General purpose bounding box structure.
Implementations
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<'a, T: Float> Absorb<BBox<T>> for &'a mut 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> Centroid<Option<[T; 3]>> for &'a BBox<T>
[src]
impl<T: Clone> Clone for BBox<T>
[src]
impl<T: PartialOrd + Copy> Contains<[T; 3]> for BBox<T>
[src]
impl<T: Copy> Copy for BBox<T>
[src]
impl<T: Debug> Debug for BBox<T>
[src]
impl<T: Float> Empty for 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<T: PartialEq> PartialEq<BBox<T>> for BBox<T>
[src]
impl<T> StructuralPartialEq for BBox<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for BBox<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for BBox<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for BBox<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for BBox<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for BBox<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsSlice<T> for T
[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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneBytes for T where
T: 'static + Clone,
[src]
T: 'static + Clone,
pub unsafe fn clone_bytes(
src: &[MaybeUninit<u8>]
) -> Box<[MaybeUninit<u8>], Global>
[src]
src: &[MaybeUninit<u8>]
) -> Box<[MaybeUninit<u8>], Global>
pub unsafe fn clone_from_bytes(
dst: &mut [MaybeUninit<u8>],
src: &[MaybeUninit<u8>]
)
[src]
dst: &mut [MaybeUninit<u8>],
src: &[MaybeUninit<u8>]
)
pub unsafe fn clone_into_raw_bytes(
src: &[MaybeUninit<u8>],
dst: &mut [MaybeUninit<u8>]
)
[src]
src: &[MaybeUninit<u8>],
dst: &mut [MaybeUninit<u8>]
)
impl<T> CopyElem for T where
T: Any + Copy,
[src]
T: Any + Copy,
impl<T> DebugBytes for T where
T: 'static + Debug,
[src]
T: 'static + Debug,
pub unsafe fn fmt_bytes(
bytes: &[MaybeUninit<u8>],
f: &mut Formatter<'_>
) -> Result<(), Error>
[src]
bytes: &[MaybeUninit<u8>],
f: &mut Formatter<'_>
) -> Result<(), Error>
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> DropBytes for T where
T: 'static,
[src]
T: 'static,
pub unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>])
[src]
impl<T> Elem for T where
T: Any + DropBytes,
[src]
T: Any + DropBytes,
impl<T> From<T> for T
[src]
impl<'a, S, I> Get<'a, I> for S where
I: GetIndex<'a, S>,
[src]
I: GetIndex<'a, S>,
type Output = <I as GetIndex<'a, S>>::Output
pub fn get(&self, idx: I) -> Option<<I as GetIndex<'a, S>>::Output>
[src]
pub fn at(&self, idx: I) -> Self::Output
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<S, I> Isolate<I> for S where
I: IsolateIndex<S>,
[src]
I: IsolateIndex<S>,
type Output = <I as IsolateIndex<S>>::Output
pub unsafe fn isolate_unchecked(self, idx: I) -> <S as Isolate<I>>::Output
[src]
pub fn try_isolate(self, idx: I) -> Option<<S as Isolate<I>>::Output>
[src]
pub fn isolate(self, idx: I) -> Self::Output
[src]
impl<T> PartialEqBytes for T where
T: 'static + PartialEq<T>,
[src]
T: 'static + PartialEq<T>,
impl<T> Pod for T where
T: 'static + Copy + Send + Sync + Any,
[src]
T: 'static + Copy + Send + Sync + Any,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, N> PushArrayToVec<N> for T where
T: Clone,
N: Array<T>,
[src]
T: Clone,
N: Array<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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 = Infallible
The type returned in the event of a conversion error.
pub 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>,