pub trait AlmostCollidesWith<T> {
// Required method
fn almost_collides_with(&self, other: &T) -> bool;
}
Expand description
Trait for types that can detect ‘almost-collisions’ between self
and other
of type T
.
Due to floating point arithmetic precision, two objects that are very close to each other may have unexpected behavior with the CollidesWith trait. This trait errors on the side of false positives, so that if two objects are very close to each other, they will be considered as colliding.