use crate::geometry::Transformation;
use crate::geometry::geo_enums::GeoPosition;
pub trait CollidesWith<T> {
fn collides_with(&self, other: &T) -> bool;
}
pub trait AlmostCollidesWith<T> {
fn almost_collides_with(&self, other: &T) -> bool;
}
pub trait DistanceTo<T> {
fn distance_to(&self, other: &T) -> f32;
fn sq_distance_to(&self, other: &T) -> f32;
}
pub trait SeparationDistance<T>: DistanceTo<T> {
fn separation_distance(&self, other: &T) -> (GeoPosition, f32);
fn sq_separation_distance(&self, other: &T) -> (GeoPosition, f32);
}
pub trait Transformable: Clone {
fn transform(&mut self, t: &Transformation) -> &mut Self;
fn transform_clone(&self, t: &Transformation) -> Self {
let mut clone = self.clone();
clone.transform(t);
clone
}
}
pub trait TransformableFrom: Transformable {
fn transform_from(&mut self, reference: &Self, t: &Transformation) -> &mut Self;
}