Struct BoundingBox

Source
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: f64

Minimum x value.

§max_x: f64

Maximum x value.

§min_y: f64

Minimum y value.

§max_y: f64

Maximum y value.

§min_z: f64

Minimum z value.

§max_z: f64

Maximum z value.

Implementations§

Source§

impl BoundingBox

Source

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

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.