pub trait ContactManifoldGenerator<N>: Any + Send + Syncwhere
    N: RealField + Copy,{
    // Required method
    fn generate_contacts(
        &mut self,
        dispatcher: &(dyn ContactDispatcher<N> + 'static),
        ma: &Isometry<N, Unit<Complex<N>>, 2>,
        a: &(dyn Shape<N> + 'static),
        proc1: Option<&dyn ContactPreprocessor<N>>,
        mb: &Isometry<N, Unit<Complex<N>>, 2>,
        b: &(dyn Shape<N> + 'static),
        proc2: Option<&dyn ContactPreprocessor<N>>,
        prediction: &ContactPrediction<N>,
        manifold: &mut ContactManifold<N>
    ) -> bool;

    // Provided method
    fn init_manifold(&self) -> ContactManifold<N> { ... }
}
Expand description

An algorithm to compute contact points, normals and penetration depths between two specific objects.

Required Methods§

source

fn generate_contacts( &mut self, dispatcher: &(dyn ContactDispatcher<N> + 'static), ma: &Isometry<N, Unit<Complex<N>>, 2>, a: &(dyn Shape<N> + 'static), proc1: Option<&dyn ContactPreprocessor<N>>, mb: &Isometry<N, Unit<Complex<N>>, 2>, b: &(dyn Shape<N> + 'static), proc2: Option<&dyn ContactPreprocessor<N>>, prediction: &ContactPrediction<N>, manifold: &mut ContactManifold<N> ) -> bool

Runs the collision detection on two objects. It is assumed that the same collision detector (the same structure) is always used with the same pair of objects.

Returns false if persisting this algorithm for re-use is unlikely to improve performance, e.g. due to the objects being distant. Note that if the ContactManifoldGenerator would likely be immediately reconstructed in the next time-step, dropping it is sub-optimal regardless.

Provided Methods§

source

fn init_manifold(&self) -> ContactManifold<N>

Generate an empty contact manifold configured as required by this contact manifold generator.

Implementors§