pub trait CollisionStrategy {
// Required methods
fn collides(&self, pos: Vector, r: &Rectangle) -> bool;
fn add(&mut self, pos: Vector, r: Rectangle);
}Expand description
Struct implementing this trait can detect rectangles collisions.
pub trait CollisionStrategy {
// Required methods
fn collides(&self, pos: Vector, r: &Rectangle) -> bool;
fn add(&mut self, pos: Vector, r: Rectangle);
}Struct implementing this trait can detect rectangles collisions.