pub struct AxisAlignedBoundingBox {
pub min: Vector3<f32>,
pub max: Vector3<f32>,
}Fields§
§min: Vector3<f32>§max: Vector3<f32>Implementations§
Source§impl AxisAlignedBoundingBox
impl AxisAlignedBoundingBox
pub const fn unit() -> Self
pub const fn collapsed() -> Self
pub fn from_radius(radius: f32) -> Self
pub const fn from_min_max(min: Vector3<f32>, max: Vector3<f32>) -> Self
pub fn from_point(point: Vector3<f32>) -> Self
pub fn from_points(points: &[Vector3<f32>]) -> Self
pub fn add_point(&mut self, a: Vector3<f32>)
pub fn inflate(&mut self, delta: Vector3<f32>)
pub fn add_box(&mut self, other: Self)
pub fn corners(&self) -> [Vector3<f32>; 8]
pub fn volume(&self) -> f32
pub fn offset(&mut self, v: Vector3<f32>)
pub fn center(&self) -> Vector3<f32>
pub fn half_extents(&self) -> Vector3<f32>
pub fn invalidate(&mut self)
pub fn is_valid(&self) -> bool
pub fn is_degenerate(&self) -> bool
pub fn is_invalid_or_degenerate(&self) -> bool
pub fn is_contains_point(&self, point: Vector3<f32>) -> bool
pub fn is_intersects_sphere(&self, position: Vector3<f32>, radius: f32) -> bool
pub fn is_intersects_aabb(&self, other: &Self) -> bool
Sourcepub fn transform(&self, m: &Matrix4<f32>) -> AxisAlignedBoundingBox
pub fn transform(&self, m: &Matrix4<f32>) -> AxisAlignedBoundingBox
Transforms axis-aligned bounding box using given affine transformation matrix.
§References
Transforming Axis-Aligned Bounding Boxes by Jim Arvo, “Graphics Gems”, Academic Press, 1990
pub fn split(&self) -> [AxisAlignedBoundingBox; 8]
pub fn project( &self, view_projection: &Matrix4<f32>, viewport: &Rect<i32>, ) -> Rect<f32>
Trait Implementations§
Source§impl Clone for AxisAlignedBoundingBox
impl Clone for AxisAlignedBoundingBox
Source§fn clone(&self) -> AxisAlignedBoundingBox
fn clone(&self) -> AxisAlignedBoundingBox
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AxisAlignedBoundingBox
impl Debug for AxisAlignedBoundingBox
Source§impl Default for AxisAlignedBoundingBox
impl Default for AxisAlignedBoundingBox
impl Copy for AxisAlignedBoundingBox
Auto Trait Implementations§
impl Freeze for AxisAlignedBoundingBox
impl RefUnwindSafe for AxisAlignedBoundingBox
impl Send for AxisAlignedBoundingBox
impl Sync for AxisAlignedBoundingBox
impl Unpin for AxisAlignedBoundingBox
impl UnwindSafe for AxisAlignedBoundingBox
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.