[][src]Struct pbrt::core::geometry::Bounds3

pub struct Bounds3<T> {
    pub p_min: Point3<T>,
    pub p_max: Point3<T>,
}

Generic type for 3D bounding boxes.

Fields

p_min: Point3<T>

point representing the minimum x,y,z value of the bounds.

p_max: Point3<T>

point representing the maximum x,y,z value of the bounds.

Methods

impl<T> Bounds3<T> where
    T: Number
[src]

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

Determine if p inside self excluding upper-bounds.

Examples

use pbrt::core::geometry::Bounds3i;
use pbrt::core::geometry::Point3i;

let b = Bounds3i::from([[2, 2, 2], [4, 4, 4]]);
assert!(b.inside_exclusive(Point3i::from([2, 2, 2])));
assert!(!b.inside_exclusive(Point3i::from([4, 4, 4])));

Trait Implementations

impl<T: Clone> Clone for Bounds3<T>[src]

impl<T: Copy> Copy for Bounds3<T>[src]

impl<T: Debug> Debug for Bounds3<T>[src]

impl<T: Default> Default for Bounds3<T>[src]

impl<T> From<[[T; 3]; 2]> for Bounds3<T> where
    T: Number
[src]

fn from(ps: [[T; 3]; 2]) -> Self[src]

Create Bounds3<T> from tuple of slices. It also ensures min/max are correct, regardless of how they're arranged in the incoming slices.

Examples

use pbrt::core::geometry::Bounds3f;
use pbrt::core::geometry::Point3f;

let b = Bounds3f::from([[2., 3., 4.], [4., 5.,6.]]);
assert_eq!(
    b,
    Bounds3f {
        p_min: Point3f { x: 2., y: 3.,z:4. },
        p_max: Point3f { x: 4., y: 5.,z:6. }
    }
);

let b = Bounds3f::from([[5., 4., 1.], [3., 2.,3.]]);
assert_eq!(b, Bounds3f::from([[3., 2.,1.], [5., 4.,3.]]));

impl<T> From<[Point3<T>; 2]> for Bounds3<T> where
    T: Number
[src]

fn from(ps: [Point3<T>; 2]) -> Self[src]

Create Bounds3<T> from slice of Point3<t>. It also ensures min/max are correct, regardless of how they're arranged in the incoming Point3<t>.

Examples

use pbrt::core::geometry::Bounds3f;
use pbrt::core::geometry::Point3f;

let b = Bounds3f::from([Point3f::from([2., 3.,4.]), Point3f::from([4., 5.,6.])]);
assert_eq!(
    b,
    Bounds3f {
        p_min: Point3f { x: 2., y: 3. ,z:4.},
        p_max: Point3f { x: 4., y: 5.,z:6. }
    }
);

let b = Bounds3f::from([Point3f::from([5., 4.,1.]), Point3f::from([3., 2.,3.])]);
assert_eq!(b, Bounds3f::from([[3., 2.,1.], [5., 4.,3.]]));

impl<T: PartialEq> PartialEq<Bounds3<T>> for Bounds3<T>[src]

impl<T> StructuralPartialEq for Bounds3<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Bounds3<T> where
    T: RefUnwindSafe

impl<T> Send for Bounds3<T> where
    T: Send

impl<T> Sync for Bounds3<T> where
    T: Sync

impl<T> Unpin for Bounds3<T> where
    T: Unpin

impl<T> UnwindSafe for Bounds3<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

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

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

impl<T> SetParameter for T

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

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.