pub struct SmartCollisionResolver { /* private fields */ }Expand description
Smart collision system with priority-based resolution
Implementations§
Source§impl SmartCollisionResolver
impl SmartCollisionResolver
Sourcepub fn new(screen_width: f32, screen_height: f32) -> Self
pub fn new(screen_width: f32, screen_height: f32) -> Self
Create a new smart collision resolver
Sourcepub fn process_events(&mut self, events: &mut [PositionedEvent])
pub fn process_events(&mut self, events: &mut [PositionedEvent])
Process events with smart collision resolution
Sourcepub fn set_priority_threshold(&mut self, threshold: i32)
pub fn set_priority_threshold(&mut self, threshold: i32)
Set the priority threshold
Trait Implementations§
Source§impl CollisionDetector for SmartCollisionResolver
impl CollisionDetector for SmartCollisionResolver
Source§fn check_collision(&self, bbox: &BoundingBox, existing: &[BoundingBox]) -> bool
fn check_collision(&self, bbox: &BoundingBox, existing: &[BoundingBox]) -> bool
Check if a bounding box collides with existing elements
Source§fn find_free_position(
&self,
bbox: &BoundingBox,
existing: &[BoundingBox],
bounds: &BoundingBox,
) -> Option<(f32, f32)>
fn find_free_position( &self, bbox: &BoundingBox, existing: &[BoundingBox], bounds: &BoundingBox, ) -> Option<(f32, f32)>
Find a non-colliding position for a bounding box
Auto Trait Implementations§
impl Freeze for SmartCollisionResolver
impl RefUnwindSafe for SmartCollisionResolver
impl Send for SmartCollisionResolver
impl Sync for SmartCollisionResolver
impl Unpin for SmartCollisionResolver
impl UnsafeUnpin for SmartCollisionResolver
impl UnwindSafe for SmartCollisionResolver
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> 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