[−][src]Struct tray_rust::geometry::bbox::BBox
A box between the min and max points
Fields
min: Point
max: 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]
&self,
r: &Ray,
inv_dir: &Vector,
neg_dir: &[usize; 3]
) -> bool
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]
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]
U: From<T>,
impl<T> From<T> for T
[src]
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 = Infallible
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,