[][src]Struct tray_rust::geometry::bbox::BBox

pub struct BBox {
    pub min: Point,
    pub max: Point,
}

A box between the min and max points

Fields

min: Pointmax: Point

Methods

impl BBox[src]

pub fn new() -> BBox[src]

Create a new degenerate box

pub fn singular(p: Point) -> BBox[src]

Create a new box containing only the point passed

pub fn span(min: Point, max: Point) -> BBox[src]

Create a new box spanning [min, max]

pub fn box_union(&self, b: &BBox) -> BBox[src]

Get a box representing the union of this box with the one passed

pub fn point_union(&self, p: &Point) -> BBox[src]

Get a box that contains the passed point, by expanding this box to reach the point

pub fn max_extent(&self) -> Axis[src]

Compute the axis along which the box is longest

pub fn lerp(&self, tx: f32, ty: f32, tz: f32) -> Point[src]

Compute the point in the box at some t value along each axis

pub fn offset(&self, p: &Point) -> Vector[src]

Find the position of the point relative to the box, with min being the origin

pub fn surface_area(&self) -> f32[src]

Compute the surface area of the box

pub fn fast_intersect(
    &self,
    r: &Ray,
    inv_dir: &Vector,
    neg_dir: &[usize; 3]
) -> bool
[src]

Optimized ray-box intersection test, for use in the BVH traversal where we have pre-computed the ray's inverse direction and which directions are negative, indicated by a 1 for negative and 0 for non-negative Returns true if the box was hit

Trait Implementations

impl Clone for BBox[src]

impl Copy for BBox[src]

impl Debug for BBox[src]

impl Mul<BBox> for Transform[src]

type Output = BBox

The resulting type after applying the * operator.

fn mul(self, b: BBox) -> BBox[src]

Apply the transformation to the AABB. This is an implementation of Arvo (1990) AABB transformation

impl Index<usize> for BBox[src]

type Output = Point

The returned type after indexing.

fn index(&self, i: usize) -> &Point[src]

Access the BBox's min/max points by index

  • 0 = min
  • 1 = max

impl IndexMut<usize> for BBox[src]

fn index_mut(&mut self, i: usize) -> &mut Point[src]

Access the BBox's min/max points by index

  • 0 = min
  • 1 = max

Auto Trait Implementations

impl Send for BBox

impl Sync for BBox

impl Unpin for BBox

impl UnwindSafe for BBox

impl RefUnwindSafe for BBox

Blanket Implementations

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

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

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.

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

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

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

impl<T> SetParameter for T[src]