pub trait TOIDispatcher<N>: Send + Syncwhere
    N: RealField + Copy,{
    // Required methods
    fn nonlinear_time_of_impact(
        &self,
        root_dispatcher: &dyn TOIDispatcher<N>,
        motion1: &dyn RigidMotion<N>,
        g1: &(dyn Shape<N> + 'static),
        motion2: &dyn RigidMotion<N>,
        g2: &(dyn Shape<N> + 'static),
        max_toi: N,
        target_distance: N
    ) -> Result<Option<TOI<N>>, Unsupported>;
    fn time_of_impact(
        &self,
        root_dispatcher: &dyn TOIDispatcher<N>,
        m1: &Isometry<N, Unit<Complex<N>>, 2>,
        vel1: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
        g1: &(dyn Shape<N> + 'static),
        m2: &Isometry<N, Unit<Complex<N>>, 2>,
        vel2: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
        g2: &(dyn Shape<N> + 'static),
        max_toi: N,
        target_distance: N
    ) -> Result<Option<TOI<N>>, Unsupported>;

    // Provided method
    fn chain<U>(self, other: U) -> Chain<Self, U>
       where U: TOIDispatcher<N>,
             Self: Sized { ... }
}
Expand description

Dispatcher for time-of-impact queries

Custom implementations allow crates that support an abstract TOIDispatcher to handle custom shapes. Methods take root_dispatcher to allow dispatchers to delegate to eachother. Callers that will not themselves be used to implement a TOIDispatcher should pass self.

Required Methods§

source

fn nonlinear_time_of_impact( &self, root_dispatcher: &dyn TOIDispatcher<N>, motion1: &dyn RigidMotion<N>, g1: &(dyn Shape<N> + 'static), motion2: &dyn RigidMotion<N>, g2: &(dyn Shape<N> + 'static), max_toi: N, target_distance: N ) -> Result<Option<TOI<N>>, Unsupported>

Computes the smallest time of impact of two shapes under translational movement.

source

fn time_of_impact( &self, root_dispatcher: &dyn TOIDispatcher<N>, m1: &Isometry<N, Unit<Complex<N>>, 2>, vel1: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, g1: &(dyn Shape<N> + 'static), m2: &Isometry<N, Unit<Complex<N>>, 2>, vel2: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, g2: &(dyn Shape<N> + 'static), max_toi: N, target_distance: N ) -> Result<Option<TOI<N>>, Unsupported>

Computes the smallest time at with two shapes under translational movement are separated by a distance smaller or equal to distance.

Returns 0.0 if the objects are touching or penetrating.

Provided Methods§

source

fn chain<U>(self, other: U) -> Chain<Self, U>where U: TOIDispatcher<N>, Self: Sized,

Construct a TOIDispatcher that falls back on other for cases not handled by self

Implementors§

source§

impl<N> TOIDispatcher<N> for DefaultTOIDispatcherwhere N: RealField + Copy,

source§

impl<N, T, U> TOIDispatcher<N> for Chain<T, U>where N: RealField + Copy, T: TOIDispatcher<N>, U: TOIDispatcher<N>,