pub struct BoundingBox2D {
pub min: Vector2,
pub max: Vector2,
}Expand description
2D bounding box
Fields§
§min: Vector2Minimum point (lower-left corner)
max: Vector2Maximum point (upper-right corner)
Implementations§
Source§impl BoundingBox2D
impl BoundingBox2D
Sourcepub fn new(min: Vector2, max: Vector2) -> Self
pub fn new(min: Vector2, max: Vector2) -> Self
Create a new bounding box from min and max points
Sourcepub fn from_point(point: Vector2) -> Self
pub fn from_point(point: Vector2) -> Self
Create a bounding box from a single point
Sourcepub fn from_points(points: &[Vector2]) -> Option<Self>
pub fn from_points(points: &[Vector2]) -> Option<Self>
Create a bounding box that contains all given points
Sourcepub fn expand_to_include(&mut self, point: Vector2)
pub fn expand_to_include(&mut self, point: Vector2)
Expand the bounding box to include another point
Sourcepub fn merge(&self, other: &BoundingBox2D) -> BoundingBox2D
pub fn merge(&self, other: &BoundingBox2D) -> BoundingBox2D
Merge with another bounding box
Trait Implementations§
Source§impl Clone for BoundingBox2D
impl Clone for BoundingBox2D
Source§fn clone(&self) -> BoundingBox2D
fn clone(&self) -> BoundingBox2D
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BoundingBox2D
impl Debug for BoundingBox2D
Source§impl Display for BoundingBox2D
impl Display for BoundingBox2D
Source§impl PartialEq for BoundingBox2D
impl PartialEq for BoundingBox2D
impl Copy for BoundingBox2D
impl StructuralPartialEq for BoundingBox2D
Auto Trait Implementations§
impl Freeze for BoundingBox2D
impl RefUnwindSafe for BoundingBox2D
impl Send for BoundingBox2D
impl Sync for BoundingBox2D
impl Unpin for BoundingBox2D
impl UnsafeUnpin for BoundingBox2D
impl UnwindSafe for BoundingBox2D
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