Struct crystal_ball::math::Bounds3
source · pub struct Bounds3 {
pub min: Point3,
pub max: Point3,
}
Expand description
A 3-dimensional bounding box represented by its minimum and maximum corner.
Defaults to f64::INFINITY
for min
and f64::NEG_INFINITY
for max
.
This way, including any point will result in the correct bounding volume.
Fields§
§min: Point3
§max: Point3
Implementations§
source§impl Bounds3
impl Bounds3
sourcepub fn new(point_a: Point3, point_b: Point3) -> Self
pub fn new(point_a: Point3, point_b: Point3) -> Self
Create a new Bounds3
using the minimum and maximum point coordinate values, respectively.
sourcepub fn include_point(self, point: Point3) -> Self
pub fn include_point(self, point: Point3) -> Self
Expand self
to include the given Point3
.
sourcepub fn include_bounds(self, bounds: Bounds3) -> Self
pub fn include_bounds(self, bounds: Bounds3) -> Self
Expand self
to include the given Bounds3
.
sourcepub fn intersection(bounds_a: Bounds3, bounds_b: Bounds3) -> Self
pub fn intersection(bounds_a: Bounds3, bounds_b: Bounds3) -> Self
Calculates the intersection of two Bounds3
.
sourcepub fn overlaps(&self, bounds: Bounds3) -> bool
pub fn overlaps(&self, bounds: Bounds3) -> bool
Checks whether self
intersects the given Bounds3
.
sourcepub fn includes_point(&self, point: Point3) -> bool
pub fn includes_point(&self, point: Point3) -> bool
Checks whether self
includes the given Point3
.
sourcepub fn surface_area(&self) -> f64
pub fn surface_area(&self) -> f64
Calculate the Bounds3
’s surface area.
sourcepub fn maximum_extent(&self) -> XYZEnum
pub fn maximum_extent(&self) -> XYZEnum
Returns the direction of the longest edge.
Trait Implementations§
source§impl PartialEq for Bounds3
impl PartialEq for Bounds3
impl Copy for Bounds3
impl StructuralPartialEq for Bounds3
Auto Trait Implementations§
impl RefUnwindSafe for Bounds3
impl Send for Bounds3
impl Sync for Bounds3
impl Unpin for Bounds3
impl UnwindSafe for Bounds3
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
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.