pub struct Bounds<T> {
pub min: T,
pub max: T,
}Expand description
Bounds.
Fields§
§min: TMinimum corner.
max: TMaximum corner.
Implementations§
Source§impl Bounds<Vector2<f64>>
impl Bounds<Vector2<f64>>
Sourcepub fn max_extent(&self) -> Scalar
pub fn max_extent(&self) -> Scalar
Maximum of width and height.
Sourcepub fn enlarge(&self, factor: Scalar) -> Self
pub fn enlarge(&self, factor: Scalar) -> Self
Enlarge bounds by a factor and return new bounds.
Sourcepub fn extend_by_point(&mut self, p: Vec2)
pub fn extend_by_point(&mut self, p: Vec2)
Extend these bounds by point.
Sourcepub fn distance_center_to_boundary(&self, dir: Vec2) -> Length
pub fn distance_center_to_boundary(&self, dir: Vec2) -> Length
Distance to boundary from the bounds’ center.
Source§impl Bounds<Vector3<f64>>
impl Bounds<Vector3<f64>>
Sourcepub fn extend_by_point(&mut self, p: Vec3)
pub fn extend_by_point(&mut self, p: Vec3)
Extend these bounds by point.
Sourcepub fn corners(&self) -> Bounds3DCorners ⓘ
pub fn corners(&self) -> Bounds3DCorners ⓘ
Corner iterator.
Sourcepub fn map_vec3(&self, v: Vec3) -> Vec3
pub fn map_vec3(&self, v: Vec3) -> Vec3
Maps a vec3 to bounds.
The resulting Vec3 is normalized between (0,0,0) = min and (1,1,1) = max.
Sourcepub fn distance_center_to_boundary(&self, dir: Vec3) -> Length
pub fn distance_center_to_boundary(&self, dir: Vec3) -> Length
Distance to boundary from the bounds’ center.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Bounds<T>where
T: Freeze,
impl<T> RefUnwindSafe for Bounds<T>where
T: RefUnwindSafe,
impl<T> Send for Bounds<T>where
T: Send,
impl<T> Sync for Bounds<T>where
T: Sync,
impl<T> Unpin for Bounds<T>where
T: Unpin,
impl<T> UnwindSafe for Bounds<T>where
T: UnwindSafe,
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more