bevy_trackball::prelude

Trait RelativeEq

Source
pub trait RelativeEq<Rhs = Self>: AbsDiffEq<Rhs>
where Rhs: ?Sized,
{ // Required methods fn default_max_relative() -> Self::Epsilon; fn relative_eq( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool; // Provided method fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool { ... } }
Expand description

Equality comparisons between two numbers using both the absolute difference and relative based comparisons.

Required Methods§

Source

fn default_max_relative() -> Self::Epsilon

The default relative tolerance for testing values that are far-apart.

This is used when no max_relative value is supplied to the [relative_eq] macro.

Source

fn relative_eq( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

A test for equality that uses a relative comparison if the values are far apart.

Provided Methods§

Source

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of RelativeEq::relative_eq.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl RelativeEq for f32

Source§

fn default_max_relative() -> f32

Source§

fn relative_eq(&self, other: &f32, epsilon: f32, max_relative: f32) -> bool

Source§

impl RelativeEq for f64

Source§

fn default_max_relative() -> f64

Source§

fn relative_eq(&self, other: &f64, epsilon: f64, max_relative: f64) -> bool

Source§

impl<'a, T> RelativeEq for &'a T
where T: RelativeEq + ?Sized,

Source§

fn default_max_relative() -> <T as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &&'a T, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<'a, T> RelativeEq for &'a mut T
where T: RelativeEq + ?Sized,

Source§

fn default_max_relative() -> <T as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &&'a mut T, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<A, B> RelativeEq<[B]> for [A]
where A: RelativeEq<B>, <A as AbsDiffEq<B>>::Epsilon: Clone,

Source§

fn default_max_relative() -> <A as AbsDiffEq<B>>::Epsilon

Source§

fn relative_eq( &self, other: &[B], epsilon: <A as AbsDiffEq<B>>::Epsilon, max_relative: <A as AbsDiffEq<B>>::Epsilon, ) -> bool

Source§

impl<T> RelativeEq for DualQuaternion<T>
where T: RealField<Epsilon = T> + RelativeEq,

Source§

impl<T> RelativeEq for Quaternion<T>
where T: RealField<Epsilon = T> + RelativeEq,

Source§

fn default_max_relative() -> <Quaternion<T> as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &Quaternion<T>, epsilon: <Quaternion<T> as AbsDiffEq>::Epsilon, max_relative: <Quaternion<T> as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T> RelativeEq for Cell<T>
where T: RelativeEq + Copy,

Source§

fn default_max_relative() -> <T as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &Cell<T>, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T> RelativeEq for RefCell<T>
where T: RelativeEq + ?Sized,

Source§

fn default_max_relative() -> <T as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &RefCell<T>, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T, C, const D: usize> RelativeEq for Transform<T, C, D>

Source§

fn default_max_relative() -> <Transform<T, C, D> as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &Transform<T, C, D>, epsilon: <Transform<T, C, D> as AbsDiffEq>::Epsilon, max_relative: <Transform<T, C, D> as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T, D> RelativeEq for OPoint<T, D>

Source§

fn default_max_relative() -> <OPoint<T, D> as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &OPoint<T, D>, epsilon: <OPoint<T, D> as AbsDiffEq>::Epsilon, max_relative: <OPoint<T, D> as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T, R, C, S> RelativeEq for Matrix<T, R, C, S>
where R: Dim, C: Dim, T: Scalar + RelativeEq, S: Storage<T, R, C>, <T as AbsDiffEq>::Epsilon: Clone,

Source§

fn default_max_relative() -> <Matrix<T, R, C, S> as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &Matrix<T, R, C, S>, epsilon: <Matrix<T, R, C, S> as AbsDiffEq>::Epsilon, max_relative: <Matrix<T, R, C, S> as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T, R, const D: usize> RelativeEq for Isometry<T, R, D>
where T: RealField, R: AbstractRotation<T, D> + RelativeEq<Epsilon = <T as AbsDiffEq>::Epsilon>, <T as AbsDiffEq>::Epsilon: Clone,

Source§

fn default_max_relative() -> <Isometry<T, R, D> as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &Isometry<T, R, D>, epsilon: <Isometry<T, R, D> as AbsDiffEq>::Epsilon, max_relative: <Isometry<T, R, D> as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T, R, const D: usize> RelativeEq for Similarity<T, R, D>
where T: RealField, R: AbstractRotation<T, D> + RelativeEq<Epsilon = <T as AbsDiffEq>::Epsilon>, <T as AbsDiffEq>::Epsilon: Clone,

Source§

fn default_max_relative() -> <Similarity<T, R, D> as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &Similarity<T, R, D>, epsilon: <Similarity<T, R, D> as AbsDiffEq>::Epsilon, max_relative: <Similarity<T, R, D> as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T, const D: usize> RelativeEq for Rotation<T, D>
where T: Scalar + RelativeEq, <T as AbsDiffEq>::Epsilon: Clone,

Source§

fn default_max_relative() -> <Rotation<T, D> as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &Rotation<T, D>, epsilon: <Rotation<T, D> as AbsDiffEq>::Epsilon, max_relative: <Rotation<T, D> as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T, const D: usize> RelativeEq for Scale<T, D>
where T: Scalar + RelativeEq, <T as AbsDiffEq>::Epsilon: Clone,

Source§

fn default_max_relative() -> <Scale<T, D> as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &Scale<T, D>, epsilon: <Scale<T, D> as AbsDiffEq>::Epsilon, max_relative: <Scale<T, D> as AbsDiffEq>::Epsilon, ) -> bool

Source§

impl<T, const D: usize> RelativeEq for Translation<T, D>
where T: Scalar + RelativeEq, <T as AbsDiffEq>::Epsilon: Clone,

Source§

fn default_max_relative() -> <Translation<T, D> as AbsDiffEq>::Epsilon

Source§

fn relative_eq( &self, other: &Translation<T, D>, epsilon: <Translation<T, D> as AbsDiffEq>::Epsilon, max_relative: <Translation<T, D> as AbsDiffEq>::Epsilon, ) -> bool

Implementors§

Source§

impl<N> RelativeEq for Frame<N>
where N: Copy + RealField + RelativeEq, <N as AbsDiffEq>::Epsilon: Copy,

Source§

impl<N> RelativeEq for Plane<N>
where N: Copy + RealField + RelativeEq, <N as AbsDiffEq>::Epsilon: Copy,

Source§

impl<T> RelativeEq for Unit<DualQuaternion<T>>
where T: RealField<Epsilon = T> + RelativeEq,

Source§

impl<T> RelativeEq for Unit<Quaternion<T>>
where T: RealField<Epsilon = T> + RelativeEq,

Source§

impl<T> RelativeEq for Unit<Complex<T>>
where T: RealField,

Source§

impl<T, R, C, S> RelativeEq for Unit<Matrix<T, R, C, S>>
where R: Dim, C: Dim, T: Scalar + RelativeEq, S: Storage<T, R, C>, <T as AbsDiffEq>::Epsilon: Clone,