pub trait SeparationDistance<T>: DistanceTo<T> {
// Required methods
fn separation_distance(&self, other: &T) -> (GeoPosition, f32);
fn sq_separation_distance(&self, other: &T) -> (GeoPosition, f32);
}
Expand description
Trait for types that can compute the minimum distance to separate self
from other
of type T
.
Required Methods§
Sourcefn separation_distance(&self, other: &T) -> (GeoPosition, f32)
fn separation_distance(&self, other: &T) -> (GeoPosition, f32)
In case of a collision between self
and other
, returns GeoPosition::Interior and the minimum distance to separate the two primitives.
Otherwise, returns GeoPosition::Exterior and the minimum distance between the two primitives. (similar to DistanceTo::distance_to)
Sourcefn sq_separation_distance(&self, other: &T) -> (GeoPosition, f32)
fn sq_separation_distance(&self, other: &T) -> (GeoPosition, f32)
Squared version of SeparationDistance::separation_distance