pub struct Aabb3D { /* private fields */ }Expand description
Axis-aligned 3D bounding box used for frustum culling, chunk streaming, and BVH acceleration.
Implementations§
Source§impl Aabb3D
Bounding-box union, centroid, surface area, and ray-slab intersection for Aabb3D.
impl Aabb3D
Bounding-box union, centroid, surface area, and ray-slab intersection for Aabb3D.
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
Creates an inverted empty AABB ready to accumulate points via expand_point.
§Returns
Self- Empty AABB.
Sourcepub fn expand_point(&mut self, point: Vec3)
pub fn expand_point(&mut self, point: Vec3)
Expands this bounding box to include point.
§Arguments
&Self- Mutable AABB.Vec3- Point to enclose.
Sourcepub fn expand_box(&mut self, other: Self)
pub fn expand_box(&mut self, other: Self)
Expands this bounding box to include other.
§Arguments
&Self- Mutable AABB.Self- Other bounding box.
Sourcepub fn surface_area(&self) -> f32
pub fn surface_area(&self) -> f32
Sourcepub fn intersect_ray_near(
&self,
origin: Vec3,
inv_dir: Vec3,
t_min: f32,
t_max: f32,
) -> f32
pub fn intersect_ray_near( &self, origin: Vec3, inv_dir: Vec3, t_min: f32, t_max: f32, ) -> f32
Branchless slab Ray-AABB intersection returning entry distance tmin or f32::INFINITY on miss.
§Arguments
&Self- AABB reference.Vec3- Ray origin.Vec3- Precomputed safe reciprocal ray direction.f32- Minimum valid distance.f32- Maximum valid distance.
§Returns
f32- Near intersection distance if hit, orf32::INFINITYif missed.
Trait Implementations§
impl Copy for Aabb3D
impl StructuralPartialEq for Aabb3D
Auto Trait Implementations§
impl Forget for Aabb3D
impl Freeze for Aabb3D
impl Move for Aabb3D
impl RefUnwindSafe for Aabb3D
impl Send for Aabb3D
impl Sync for Aabb3D
impl Unpin for Aabb3D
impl UnsafeUnpin for Aabb3D
impl UnwindSafe for Aabb3D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more