pub struct WorldBounds {
pub min: Point2,
pub max: Point2,
}Expand description
Axis-aligned rectangular world extent that bounds a PolygonScene.
Free space is the closed rectangle minus obstacle interiors. Constructors
do not enforce min < max; call WorldBounds::validate before search
setup.
Fields§
§min: Point2Inclusive lower-left corner of the axis-aligned world rectangle.
max: Point2Inclusive upper-right corner of the axis-aligned world rectangle.
Implementations§
Source§impl WorldBounds
impl WorldBounds
Sourcepub const fn new(min: Point2, max: Point2) -> Self
pub const fn new(min: Point2, max: Point2) -> Self
Constructs bounds without validating area. Prefer WorldBounds::validate.
Sourcepub fn contains(self, point: Point2) -> bool
pub fn contains(self, point: Point2) -> bool
Inclusive containment with geometry epsilon (points on the rectangle edge count as inside).
Sourcepub fn validate(self) -> Result<(), PolygonValidationError>
pub fn validate(self) -> Result<(), PolygonValidationError>
Ensures the rectangle has strictly positive width and height.
§Errors
Returns PolygonValidationError::InvalidWorldBounds when the bounds do
not have positive area.
Trait Implementations§
Source§impl Clone for WorldBounds
impl Clone for WorldBounds
Source§fn clone(&self) -> WorldBounds
fn clone(&self) -> WorldBounds
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for WorldBounds
Source§impl Debug for WorldBounds
impl Debug for WorldBounds
Source§impl PartialEq for WorldBounds
impl PartialEq for WorldBounds
impl StructuralPartialEq for WorldBounds
Auto Trait Implementations§
impl Freeze for WorldBounds
impl RefUnwindSafe for WorldBounds
impl Send for WorldBounds
impl Sync for WorldBounds
impl Unpin for WorldBounds
impl UnsafeUnpin for WorldBounds
impl UnwindSafe for WorldBounds
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