pub struct QTHazard {
pub qt_bbox: Rect,
pub entity: HazardEntity,
pub presence: QTHazPresence,
pub active: bool,
}
Fields§
§qt_bbox: Rect
The bounding box of the quadtree node
entity: HazardEntity
Entity inducing the hazard
presence: QTHazPresence
How the hazard is present in the node
active: bool
Whether the hazard is active or not
Implementations§
Source§impl QTHazard
impl QTHazard
Sourcepub fn from_qt_root(qt_root_bbox: Rect, haz: &Hazard) -> Self
pub fn from_qt_root(qt_root_bbox: Rect, haz: &Hazard) -> Self
Sourcepub fn constrict(&self, quadrants: [Rect; 4]) -> [Self; 4]
pub fn constrict(&self, quadrants: [Rect; 4]) -> [Self; 4]
Returns the resulting QTHazards after constricting to the provided quadrants.
The quadrants should be ordered according to the Cartesian system
and should all be inside the bounds from which self
was created.
pub fn n_edges(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QTHazard
impl RefUnwindSafe for QTHazard
impl Send for QTHazard
impl Sync for QTHazard
impl Unpin for QTHazard
impl UnwindSafe for QTHazard
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