Skip to main content

DistanceTo

Trait DistanceTo 

Source
pub trait DistanceTo<T> {
    // Required methods
    fn distance_to(&self, other: &T) -> f32;
    fn sq_distance_to(&self, other: &T) -> f32;
}
Expand description

Trait for types that can compute the minimum distance between self and other of type T.

Required Methods§

Source

fn distance_to(&self, other: &T) -> f32

Minimum distance between two primitives. Will be 0 in case of a collision.

Source

fn sq_distance_to(&self, other: &T) -> f32

Squared version of DistanceTo::distance_to

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§