Struct Aabb3D
#[repr(C)]pub struct Aabb3D {
pub min: [f32; 3],
pub max: [f32; 3],
}Expand description
3D Axis-Aligned Bounding Box ([min_x, min_y, min_z] .. [max_x, max_y, max_z]).
Fields§
§min: [f32; 3]§max: [f32; 3]Implementations§
§impl Aabb3D
impl Aabb3D
pub const fn to_spatial_aabb(&self) -> Aabb
pub const fn to_spatial_aabb(&self) -> Aabb
Converts this Aabb3D into an etalon_render::spatial_math::physics::Aabb.
pub const fn from_spatial_aabb(a: Aabb) -> Aabb3D
pub const fn from_spatial_aabb(a: Aabb) -> Aabb3D
Creates an Aabb3D from an etalon_render::spatial_math::physics::Aabb.
pub fn from_center_half_extents(center: [f32; 3], half: [f32; 3]) -> Aabb3D
pub fn from_center_half_extents(center: [f32; 3], half: [f32; 3]) -> Aabb3D
Creates an Aabb3D from a center point and half-extents.
pub fn fatten(&self, margin: f32) -> Aabb3D
pub fn fatten(&self, margin: f32) -> Aabb3D
Returns a fattened AABB expanded uniformly by margin on all 6 faces.
pub fn contains_aabb(&self, inner: &Aabb3D) -> bool
pub fn contains_aabb(&self, inner: &Aabb3D) -> bool
Returns true if self completely contains inner.
pub fn intersects(&self, other: &Aabb3D) -> bool
pub fn intersects(&self, other: &Aabb3D) -> bool
Returns true if self and other overlap on all 3 axes.
pub fn half_extents(&self) -> [f32; 3]
pub fn half_extents(&self) -> [f32; 3]
Half-extents of the AABB.
pub fn surface_area(&self) -> f32
pub fn surface_area(&self) -> f32
Surface area of the AABB (used by the Surface Area Heuristic during BVH insertion).
Trait Implementations§
impl Copy for Aabb3D
impl StructuralPartialEq for Aabb3D
Auto Trait Implementations§
impl Freeze 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§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.