pub struct BoundingBox {
pub min_x: f64,
pub max_x: f64,
pub min_y: f64,
pub max_y: f64,
pub min_z: f64,
pub max_z: f64,
}Expand description
Represents a three-dimensional bounding box (AABB: axis-aligned bounding box).
§Example
use meshmeshmesh::bounding_box::BoundingBox;
let result = BoundingBox::new(1.5, 1.65, -2.3, 0.7, 3.9, 4.1);
assert_eq!(result.min_x, 1.5);
assert_eq!(result.max_x, 1.65);
assert_eq!(result.min_y, -2.3);
assert_eq!(result.max_y, 0.7);
assert_eq!(result.min_z, 3.9);
assert_eq!(result.max_z, 4.1);Fields§
§min_x: f64Minimum x value.
max_x: f64Maximum x value.
min_y: f64Minimum y value.
max_y: f64Maximum y value.
min_z: f64Minimum z value.
max_z: f64Maximum z value.
Implementations§
Source§impl BoundingBox
impl BoundingBox
Sourcepub fn new(
min_x: f64,
max_x: f64,
min_y: f64,
max_y: f64,
min_z: f64,
max_z: f64,
) -> BoundingBox
pub fn new( min_x: f64, max_x: f64, min_y: f64, max_y: f64, min_z: f64, max_z: f64, ) -> BoundingBox
Creates a new Bounding Box
§Example
use meshmeshmesh::bounding_box::BoundingBox;
let result = BoundingBox::new(1.5, 1.65, -2.3, 0.7, 3.9, 4.1);
assert_eq!(result.min_x, 1.5);
assert_eq!(result.max_x, 1.65);
assert_eq!(result.min_y, -2.3);
assert_eq!(result.max_y, 0.7);
assert_eq!(result.min_z, 3.9);
assert_eq!(result.max_z, 4.1);Trait Implementations§
Source§impl PartialEq for BoundingBox
impl PartialEq for BoundingBox
Auto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnwindSafe for BoundingBox
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