Trait ncollide2d::query::TOIDispatcher
source · [−]pub trait TOIDispatcher<N: RealField + Copy>: Send + Sync {
fn nonlinear_time_of_impact(
&self,
root_dispatcher: &dyn TOIDispatcher<N>,
motion1: &dyn RigidMotion<N>,
g1: &dyn Shape<N>,
motion2: &dyn RigidMotion<N>,
g2: &dyn Shape<N>,
max_toi: N,
target_distance: N
) -> Result<Option<TOI<N>>, Unsupported>;
fn time_of_impact(
&self,
root_dispatcher: &dyn TOIDispatcher<N>,
m1: &Isometry<N>,
vel1: &Vector<N>,
g1: &dyn Shape<N>,
m2: &Isometry<N>,
vel2: &Vector<N>,
g2: &dyn Shape<N>,
max_toi: N,
target_distance: N
) -> Result<Option<TOI<N>>, Unsupported>;
fn chain<U: TOIDispatcher<N>>(self, other: U) -> Chain<Self, U>
where
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
fn nonlinear_time_of_impact(
&self,
root_dispatcher: &dyn TOIDispatcher<N>,
motion1: &dyn RigidMotion<N>,
g1: &dyn Shape<N>,
motion2: &dyn RigidMotion<N>,
g2: &dyn Shape<N>,
max_toi: N,
target_distance: N
) -> Result<Option<TOI<N>>, Unsupported>
fn nonlinear_time_of_impact(
&self,
root_dispatcher: &dyn TOIDispatcher<N>,
motion1: &dyn RigidMotion<N>,
g1: &dyn Shape<N>,
motion2: &dyn RigidMotion<N>,
g2: &dyn Shape<N>,
max_toi: N,
target_distance: N
) -> Result<Option<TOI<N>>, Unsupported>
Computes the smallest time of impact of two shapes under translational movement.
fn time_of_impact(
&self,
root_dispatcher: &dyn TOIDispatcher<N>,
m1: &Isometry<N>,
vel1: &Vector<N>,
g1: &dyn Shape<N>,
m2: &Isometry<N>,
vel2: &Vector<N>,
g2: &dyn Shape<N>,
max_toi: N,
target_distance: N
) -> Result<Option<TOI<N>>, Unsupported>
fn time_of_impact(
&self,
root_dispatcher: &dyn TOIDispatcher<N>,
m1: &Isometry<N>,
vel1: &Vector<N>,
g1: &dyn Shape<N>,
m2: &Isometry<N>,
vel2: &Vector<N>,
g2: &dyn Shape<N>,
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
fn chain<U: TOIDispatcher<N>>(self, other: U) -> Chain<Self, U> where
Self: Sized,
fn chain<U: TOIDispatcher<N>>(self, other: U) -> Chain<Self, U> where
Self: Sized,
Construct a TOIDispatcher
that falls back on other
for cases not handled by self