pub struct Rect3<T>(pub Vector3<T>, pub Vector3<T>);Expand description
3-dimensional, axis-aligned rectangular prism structure defined as two opposite points.
Tuple Fields§
§0: Vector3<T>§1: Vector3<T>Implementations§
Source§impl<T> Rect3<T>
impl<T> Rect3<T>
Sourcepub fn convert<U>(self) -> Rect3<U>where
T: Into<U>,
pub fn convert<U>(self) -> Rect3<U>where
T: Into<U>,
Converts the rectangle’s scalar components to another type.
Sourcepub fn expand(self, rhs: Rect3<T>) -> Rect3<T>where
T: PartialOrd,
pub fn expand(self, rhs: Rect3<T>) -> Rect3<T>where
T: PartialOrd,
Returns the smallest possible rectangle that includes self and rhs, assuming
that both rectangles are positive. Simply returns self if either rectangle is not
positive.
Sourcepub fn intersect(self, rhs: Rect3<T>) -> Option<Rect3<T>>where
T: PartialOrd,
pub fn intersect(self, rhs: Rect3<T>) -> Option<Rect3<T>>where
T: PartialOrd,
Returns the intersection of two positive rectangles. Returns None if either
rectangle’s points are not ordered or if the rectangles do not intersect.
Sourcepub fn is_ordered(&self) -> boolwhere
T: Ord,
pub fn is_ordered(&self) -> boolwhere
T: Ord,
Returns true if each field in self.1 is greater than or equal to the corresponding
field in self.0.
Sourcepub fn is_partially_ordered(&self) -> boolwhere
T: PartialOrd,
pub fn is_partially_ordered(&self) -> boolwhere
T: PartialOrd,
Returns true if each field in self.1 is greater than or equal to the corresponding
field in self.0.
Sourcepub fn is_partially_positive(&self) -> boolwhere
T: PartialOrd,
pub fn is_partially_positive(&self) -> boolwhere
T: PartialOrd,
Returns true if each field in self.1 is greater than the corresponding field in
self.0.
Sourcepub fn is_positive(&self) -> boolwhere
T: Ord,
pub fn is_positive(&self) -> boolwhere
T: Ord,
Returns true if each field in self.1 is greater than the corresponding field in
self.0.
Sourcepub const fn new(x0: T, y0: T, z0: T, x1: T, y1: T, z1: T) -> Rect3<T>
pub const fn new(x0: T, y0: T, z0: T, x1: T, y1: T, z1: T) -> Rect3<T>
Constructs a rectangle from decomposed vectors.
Sourcepub fn ordered(self) -> Rect3<T>where
T: Ord,
pub fn ordered(self) -> Rect3<T>where
T: Ord,
Sorts the corresponding fields of self.0 and self.1 in ascending order.
Sourcepub fn partially_ordered(self) -> Rect3<T>where
T: PartialOrd,
pub fn partially_ordered(self) -> Rect3<T>where
T: PartialOrd,
Sorts the corresponding fields of self.0 and self.1 in ascending order.
Sourcepub fn ref_convert<'a, U>(&'a self) -> Rect3<U>
pub fn ref_convert<'a, U>(&'a self) -> Rect3<U>
Converts the rectangle’s scalar components to another type.
Sourcepub fn try_convert<U>(self) -> Result<Rect3<U>, <T as TryInto<U>>::Error>where
T: TryInto<U>,
pub fn try_convert<U>(self) -> Result<Rect3<U>, <T as TryInto<U>>::Error>where
T: TryInto<U>,
Attempts to convert the rectangle’s scalar components to another type.
Trait Implementations§
Source§impl<'r, T> AddAssign<&'r Vector3<T>> for Rect3<T>
impl<'r, T> AddAssign<&'r Vector3<T>> for Rect3<T>
Source§fn add_assign(&mut self, rhs: &'r Vector3<T>)
fn add_assign(&mut self, rhs: &'r Vector3<T>)
+= operation. Read moreSource§impl<T> AddAssign<Vector3<T>> for Rect3<T>
impl<T> AddAssign<Vector3<T>> for Rect3<T>
Source§fn add_assign(&mut self, rhs: Vector3<T>)
fn add_assign(&mut self, rhs: Vector3<T>)
+= operation. Read moreSource§impl<'r, T> DivAssign<&'r T> for Rect3<T>
impl<'r, T> DivAssign<&'r T> for Rect3<T>
Source§fn div_assign(&mut self, rhs: &'r T)
fn div_assign(&mut self, rhs: &'r T)
/= operation. Read moreSource§impl<'r, T> DivAssign<&'r Vector3<T>> for Rect3<T>
impl<'r, T> DivAssign<&'r Vector3<T>> for Rect3<T>
Source§fn div_assign(&mut self, rhs: &'r Vector3<T>)
fn div_assign(&mut self, rhs: &'r Vector3<T>)
/= operation. Read moreSource§impl<T> DivAssign<T> for Rect3<T>
impl<T> DivAssign<T> for Rect3<T>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
/= operation. Read moreSource§impl<T> DivAssign<Vector3<T>> for Rect3<T>
impl<T> DivAssign<Vector3<T>> for Rect3<T>
Source§fn div_assign(&mut self, rhs: Vector3<T>)
fn div_assign(&mut self, rhs: Vector3<T>)
/= operation. Read moreSource§impl<T> From<(T, T, T, T, T, T)> for Rect3<T>
impl<T> From<(T, T, T, T, T, T)> for Rect3<T>
Source§fn from(t: (T, T, T, T, T, T)) -> Rect3<T>
fn from(t: (T, T, T, T, T, T)) -> Rect3<T>
Source§impl<'r, T> MulAssign<&'r T> for Rect3<T>
impl<'r, T> MulAssign<&'r T> for Rect3<T>
Source§fn mul_assign(&mut self, rhs: &'r T)
fn mul_assign(&mut self, rhs: &'r T)
*= operation. Read moreSource§impl<'r, T> MulAssign<&'r Vector3<T>> for Rect3<T>
impl<'r, T> MulAssign<&'r Vector3<T>> for Rect3<T>
Source§fn mul_assign(&mut self, rhs: &'r Vector3<T>)
fn mul_assign(&mut self, rhs: &'r Vector3<T>)
*= operation. Read moreSource§impl<T> MulAssign<T> for Rect3<T>
impl<T> MulAssign<T> for Rect3<T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
*= operation. Read moreSource§impl<T> MulAssign<Vector3<T>> for Rect3<T>
impl<T> MulAssign<Vector3<T>> for Rect3<T>
Source§fn mul_assign(&mut self, rhs: Vector3<T>)
fn mul_assign(&mut self, rhs: Vector3<T>)
*= operation. Read moreSource§impl<'r, T> SubAssign<&'r Vector3<T>> for Rect3<T>
impl<'r, T> SubAssign<&'r Vector3<T>> for Rect3<T>
Source§fn sub_assign(&mut self, rhs: &'r Vector3<T>)
fn sub_assign(&mut self, rhs: &'r Vector3<T>)
-= operation. Read moreSource§impl<T> SubAssign<Vector3<T>> for Rect3<T>
impl<T> SubAssign<Vector3<T>> for Rect3<T>
Source§fn sub_assign(&mut self, rhs: Vector3<T>)
fn sub_assign(&mut self, rhs: Vector3<T>)
-= operation. Read more